org.apache.sshd.server.command
Class UnknownCommand

java.lang.Object
  extended by org.apache.sshd.server.command.UnknownCommand
All Implemented Interfaces:
Command

public class UnknownCommand
extends Object
implements Command

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
UnknownCommand(String command)
           
 
Method Summary
 void destroy()
          Destroy the shell.
 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(Environment env)
          Starts the shell.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnknownCommand

public UnknownCommand(String command)
Method Detail

setInputStream

public void setInputStream(InputStream in)
Description copied from interface: Command
Set the input stream that can be used by the shell to read input.

Specified by:
setInputStream in interface Command

setOutputStream

public void setOutputStream(OutputStream out)
Description copied from interface: Command
Set the output stream that can be used by the shell to write its output.

Specified by:
setOutputStream in interface Command

setErrorStream

public void setErrorStream(OutputStream err)
Description copied from interface: Command
Set the error stream that can be used by the shell to write its errors.

Specified by:
setErrorStream in interface Command

setExitCallback

public void setExitCallback(ExitCallback callback)
Description copied from interface: Command
Set the callback that the shell has to call when it is closed.

Specified by:
setExitCallback in interface Command

start

public void start(Environment env)
           throws IOException
Description copied from interface: Command
Starts the shell. All streams must have been set before calling this method. The command should implement Runnable, and this method should spawn a new thread like:
 Thread(this).start();
 
 

Specified by:
start in interface Command
Throws:
IOException

destroy

public void destroy()
Description copied from interface: Command
Destroy the shell. This method can be called by the SSH server to destroy the shell because the client has disconnected somehow.

Specified by:
destroy in interface Command


Copyright © 2008-2012 Apache Software Foundation. All Rights Reserved.