Package com.consol.citrus.ssh
Class SshCommand
- java.lang.Object
-
- com.consol.citrus.ssh.SshCommand
-
- All Implemented Interfaces:
Runnable,org.apache.sshd.server.command.Command,org.apache.sshd.server.command.CommandDirectErrorStreamAware,org.apache.sshd.server.command.CommandDirectInputStreamAware,org.apache.sshd.server.command.CommandDirectOutputStreamAware,org.apache.sshd.server.command.CommandDirectStreamsAware,org.apache.sshd.server.command.CommandLifecycle
public class SshCommand extends Object implements org.apache.sshd.server.command.Command, Runnable
A command for delegation to a endpoint adapter- Since:
- 1.3
- Author:
- Roland Huss
-
-
Constructor Summary
Constructors Constructor Description SshCommand(String command, EndpointAdapter endpointAdapter, SshEndpointConfiguration endpointConfiguration)Constructor taking a command and the endpoint adapter as arguments
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy(org.apache.sshd.server.channel.ChannelSession session)StringgetCommand()Gets the command.voidrun()voidsetErrorStream(OutputStream err)voidsetExitCallback(org.apache.sshd.server.ExitCallback callback)voidsetInputStream(InputStream in)voidsetOutputStream(OutputStream out)voidstart(org.apache.sshd.server.channel.ChannelSession session, org.apache.sshd.server.Environment env)
-
-
-
Constructor Detail
-
SshCommand
public SshCommand(String command, EndpointAdapter endpointAdapter, SshEndpointConfiguration endpointConfiguration)
Constructor taking a command and the endpoint adapter as arguments- Parameters:
command- command performedendpointAdapter- endpoint adapterendpointConfiguration-
-
-
Method Detail
-
start
public void start(org.apache.sshd.server.channel.ChannelSession session, org.apache.sshd.server.Environment env) throws IOException- Specified by:
startin interfaceorg.apache.sshd.server.command.CommandLifecycle- Throws:
IOException
-
destroy
public void destroy(org.apache.sshd.server.channel.ChannelSession session)
- Specified by:
destroyin interfaceorg.apache.sshd.server.command.CommandLifecycle
-
setInputStream
public void setInputStream(InputStream in)
- Specified by:
setInputStreamin interfaceorg.apache.sshd.server.command.CommandDirectInputStreamAware
-
setOutputStream
public void setOutputStream(OutputStream out)
- Specified by:
setOutputStreamin interfaceorg.apache.sshd.server.command.CommandDirectOutputStreamAware
-
setErrorStream
public void setErrorStream(OutputStream err)
- Specified by:
setErrorStreamin interfaceorg.apache.sshd.server.command.CommandDirectErrorStreamAware
-
setExitCallback
public void setExitCallback(org.apache.sshd.server.ExitCallback callback)
- Specified by:
setExitCallbackin interfaceorg.apache.sshd.server.command.Command
-
getCommand
public String getCommand()
Gets the command.- Returns:
-
-