Package org.apache.sshd.server.command
Class AbstractDelegatingCommandFactory
- java.lang.Object
-
- org.apache.sshd.common.util.logging.AbstractLoggingBean
-
- org.apache.sshd.server.command.AbstractDelegatingCommandFactory
-
- All Implemented Interfaces:
CommandFactory
- Direct Known Subclasses:
ScpCommandFactory
public abstract class AbstractDelegatingCommandFactory extends AbstractLoggingBean implements CommandFactory
ACommandFactorywrapper that delegates calls to a proxy
-
-
Field Summary
Fields Modifier and Type Field Description private CommandFactorydelegateprivate java.lang.Stringname-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractDelegatingCommandFactory(java.lang.String name)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description CommandcreateCommand(ChannelSession channel, java.lang.String command)Create a command with the given name.protected CommandcreateUnsupportedCommand(ChannelSession channel, java.lang.String command)protected abstract CommandexecuteSupportedCommand(ChannelSession channel, java.lang.String command)CommandFactorygetDelegateCommandFactory()abstract booleanisSupportedCommand(ChannelSession channel, java.lang.String command)voidsetDelegateCommandFactory(CommandFactory factory)java.lang.StringtoString()
-
-
-
Field Detail
-
name
private final java.lang.String name
-
delegate
private CommandFactory delegate
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.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:CommandFactoryCreate 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:
createCommandin interfaceCommandFactory- Parameters:
channel- TheChannelSessionthrough which the command has been receivedcommand- The command that will be run- Returns:
- a non
nullCommandinstance - Throws:
java.io.IOException- if failed to create the instance
-
isSupportedCommand
public abstract boolean isSupportedCommand(ChannelSession channel, java.lang.String command)
- Parameters:
channel- TheChannelSessionthrough which the command was receivedcommand- The command about to be executed- Returns:
trueif this command is supported by the command factory,falseif it will be passed on to thedelegatefactory
-
executeSupportedCommand
protected abstract Command executeSupportedCommand(ChannelSession channel, java.lang.String command)
-
createUnsupportedCommand
protected Command createUnsupportedCommand(ChannelSession channel, java.lang.String command)
-
-