Top Description Fields Constructors Methods
org.apache.sshd.server.command

public abstract Class AbstractDelegatingCommandFactory

extends AbstractLoggingBean
implements CommandFactory
Class Inheritance
All Implemented Interfaces
org.apache.sshd.server.command.CommandFactory
Imports
java.io.IOException, org.apache.sshd.common.util.ValidateUtils, org.apache.sshd.common.util.logging.AbstractLoggingBean, org.apache.sshd.server.channel.ChannelSession

A CommandFactory wrapper that delegates calls to a proxy
Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
private CommandFactory
private final String
Inherited from org.apache.sshd.common.util.logging.AbstractLoggingBean:
log

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public Command
createCommand(ChannelSession
The ChannelSession through which the command has been received
channel
,
String
The command that will be run
command
)

Implements org.apache.sshd.server.command.CommandFactory.createCommand.

Create a command with the given name.

protected Command
protected abstract Command
public CommandFactory
public abstract boolean

Returns:

true if this command is supported by the command factory, false if it will be passed on to the delegate factory
isSupportedCommand
(ChannelSession
The ChannelSession through which the command was received
channel
,
String
The command about to be executed
command
)

public void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from org.apache.sshd.common.util.logging.AbstractLoggingBean:
debugdebugdebugdebugdebugerrorerrorerrorerrorerrorgetSimplifiedLoggerinfoinfowarnwarnwarnwarnwarnwarnwarnwarn

Field Detail

delegateback to summary
private CommandFactory delegate
nameback to summary
private final String name

Constructor Detail

AbstractDelegatingCommandFactoryback to summary
protected AbstractDelegatingCommandFactory(String name)

Method Detail

createCommandback to summary
public Command createCommand(ChannelSession channel, String command) throws IOException

Implements org.apache.sshd.server.command.CommandFactory.createCommand.

Doc from org.apache.sshd.server.command.CommandFactory.createCommand.

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.

Parameters
channel:ChannelSession

The ChannelSession through which the command has been received

command:String

The command that will be run

Returns:Command

a non null Command instance

Annotations
@Override
Exceptions
IOException:
if failed to create the instance
createUnsupportedCommandback to summary
protected Command createUnsupportedCommand(ChannelSession channel, String command)
executeSupportedCommandback to summary
protected abstract Command executeSupportedCommand(ChannelSession channel, String command)
getDelegateCommandFactoryback to summary
public CommandFactory getDelegateCommandFactory()
isSupportedCommandback to summary
public abstract boolean isSupportedCommand(ChannelSession channel, String command)
Parameters
channel:ChannelSession

The ChannelSession through which the command was received

command:String

The command about to be executed

Returns:boolean

true if this command is supported by the command factory, false if it will be passed on to the delegate factory

setDelegateCommandFactoryback to summary
public void setDelegateCommandFactory(CommandFactory factory)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override