Package org.apache.sshd.server.shell
Class UnknownCommand
java.lang.Object
org.apache.sshd.server.shell.UnknownCommand
- All Implemented Interfaces:
Runnable
,Command
,CommandDirectErrorStreamAware
,CommandDirectInputStreamAware
,CommandDirectOutputStreamAware
,CommandDirectStreamsAware
,CommandLifecycle
Implementation of an unknown command that can be returned by
CommandFactory
when the command is not
known, as it is supposed to always return a valid Command
object.- Author:
- Apache MINA SSHD Project
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy
(ChannelSession channel) This method is called by the SSH server to destroy the command because the client has disconnected somehow.boolean
int
hashCode()
void
run()
void
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
Set the input stream that can be used by the shell to read input.void
Set the output stream that can be used by the shell to write its output.void
start
(ChannelSession channel, Environment env) Starts the command execution.toString()
-
Constructor Details
-
UnknownCommand
-
-
Method Details
-
getCommand
-
getMessage
-
setInputStream
Description copied from interface:CommandDirectInputStreamAware
Set the input stream that can be used by the shell to read input.- Specified by:
setInputStream
in interfaceCommandDirectInputStreamAware
- Parameters:
in
- TheInputStream
used by the shell to read input.
-
setOutputStream
Description copied from interface:CommandDirectOutputStreamAware
Set the output stream that can be used by the shell to write its output.- Specified by:
setOutputStream
in interfaceCommandDirectOutputStreamAware
- Parameters:
out
- TheOutputStream
used by the shell to write its output
-
setErrorStream
Description copied from interface:CommandDirectErrorStreamAware
Set the error stream that can be used by the shell to write its errors.- Specified by:
setErrorStream
in interfaceCommandDirectErrorStreamAware
- Parameters:
err
- TheOutputStream
used by the shell to write its errors
-
setExitCallback
Description copied from interface:Command
Set the callback that the shell has to call when it is closed.- Specified by:
setExitCallback
in interfaceCommand
- Parameters:
callback
- TheExitCallback
to call when shell is closed
-
run
public void run() -
start
Description copied from interface:CommandLifecycle
Starts the command execution. All streams must have been set before calling this method. The command should implementRunnable
, and this method should spawn a new thread like:Thread(this).start();
- Specified by:
start
in interfaceCommandLifecycle
- Parameters:
channel
- TheChannelSession
through which the command has been receivedenv
- TheEnvironment
- Throws:
IOException
- If failed to start
-
destroy
Description copied from interface:CommandLifecycle
This method is called by the SSH server to destroy the command because the client has disconnected somehow.- Specified by:
destroy
in interfaceCommandLifecycle
- Parameters:
channel
- TheChannelSession
through which the command has been received
-
hashCode
public int hashCode() -
equals
-
toString
-