Package org.apache.sshd.server.command
Interface Command
-
- All Superinterfaces:
CommandLifecycle
- All Known Subinterfaces:
AsyncCommand
- All Known Implementing Classes:
AbstractCommandSupport
,AbstractFileSystemCommand
,InvertedShellWrapper
,ScpCommand
,SftpSubsystem
,UnknownCommand
public interface Command extends CommandLifecycle
Represents a command, shell or subsystem that can be used to send command.
This command have direct streams, meaning those streams will be provided by the ssh server for the shell to use directly. This interface is suitable for implementing commands in java, rather than using external processes. For wrapping such processes or using inverted streams,
seeInvertedShellWrapper
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
setErrorStream(java.io.OutputStream err)
Set the error stream that can be used by the shell to write its errors.void
setExitCallback(ExitCallback callback)
Set the callback that the shell has to call when it is closed.void
setInputStream(java.io.InputStream in)
Set the input stream that can be used by the shell to read input.void
setOutputStream(java.io.OutputStream out)
Set the output stream that can be used by the shell to write its output.-
Methods inherited from interface org.apache.sshd.server.command.CommandLifecycle
destroy, start
-
-
-
-
Method Detail
-
setInputStream
void setInputStream(java.io.InputStream in)
Set the input stream that can be used by the shell to read input.- Parameters:
in
- TheInputStream
used by the shell to read input.
-
setOutputStream
void setOutputStream(java.io.OutputStream out)
Set the output stream that can be used by the shell to write its output.- Parameters:
out
- TheOutputStream
used by the shell to write its output
-
setErrorStream
void setErrorStream(java.io.OutputStream err)
Set the error stream that can be used by the shell to write its errors.- Parameters:
err
- TheOutputStream
used by the shell to write its errors
-
setExitCallback
void setExitCallback(ExitCallback callback)
Set the callback that the shell has to call when it is closed.- Parameters:
callback
- TheExitCallback
to call when shell is closed
-
-