Class AbstractDelegatingCommandFactory

    • Field Detail

      • name

        private final java.lang.String name
    • Constructor Detail

      • AbstractDelegatingCommandFactory

        protected AbstractDelegatingCommandFactory​(java.lang.String name)
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getDelegateCommandFactory

        public CommandFactory getDelegateCommandFactory()
      • setDelegateCommandFactory

        public void setDelegateCommandFactory​(CommandFactory factory)
      • createCommand

        public Command createCommand​(ChannelSession channel,
                                     java.lang.String command)
                              throws java.io.IOException
        Description copied from interface: CommandFactory
        Create a command with the given name. If the command is not known, a dummy command should be returned to allow the display output to be sent back to the client.
        Specified by:
        createCommand in interface CommandFactory
        Parameters:
        channel - The ChannelSession through which the command has been received
        command - The command that will be run
        Returns:
        a non null Command instance
        Throws:
        java.io.IOException - if failed to create the instance
      • isSupportedCommand

        public abstract boolean isSupportedCommand​(java.lang.String command)
        Parameters:
        command - The command about to be executed
        Returns:
        true if this command is supported by the command factory, false if it will be passed on to the delegate factory
      • executeSupportedCommand

        protected abstract Command executeSupportedCommand​(java.lang.String command)
      • createUnsupportedCommand

        protected Command createUnsupportedCommand​(java.lang.String command)