public class UnknownCommand extends Object implements Command, Runnable
CommandFactory
when the command is not
known, as it is supposed to always return a valid Command
object.Constructor and Description |
---|
UnknownCommand(String command) |
Modifier and Type | Method and Description |
---|---|
void |
destroy(ChannelSession channel)
This method is called by the SSH server to destroy the command because the client has disconnected somehow.
|
boolean |
equals(Object obj) |
String |
getCommand() |
String |
getMessage() |
int |
hashCode() |
void |
run() |
void |
setErrorStream(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(InputStream in)
Set the input stream that can be used by the shell to read input.
|
void |
setOutputStream(OutputStream out)
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.
|
String |
toString() |
public UnknownCommand(String command)
public String getCommand()
public String getMessage()
public void setInputStream(InputStream in)
CommandDirectInputStreamAware
setInputStream
in interface CommandDirectInputStreamAware
in
- The InputStream
used by the shell to read input.public void setOutputStream(OutputStream out)
CommandDirectOutputStreamAware
setOutputStream
in interface CommandDirectOutputStreamAware
out
- The OutputStream
used by the shell to write its outputpublic void setErrorStream(OutputStream err)
CommandDirectErrorStreamAware
setErrorStream
in interface CommandDirectErrorStreamAware
err
- The OutputStream
used by the shell to write its errorspublic void setExitCallback(ExitCallback callback)
Command
setExitCallback
in interface Command
callback
- The ExitCallback
to call when shell is closedpublic void start(ChannelSession channel, Environment env) throws IOException
CommandLifecycle
Runnable
, and this method should spawn a new thread like:
Thread(this).start();
start
in interface CommandLifecycle
channel
- The ChannelSession
through which the command has been receivedenv
- The Environment
IOException
- If failed to startpublic void destroy(ChannelSession channel)
CommandLifecycle
destroy
in interface CommandLifecycle
channel
- The ChannelSession
through which the command has been receivedCopyright © 2008–2024 The Apache Software Foundation. All rights reserved.