|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.maverick.sshd.platform.ExecutableCommand
public abstract class ExecutableCommand
This class can be extended to provide a single executable command. Commands
are configured in the com.maverick.sshd.ConfigurationContext and they
make use of the input/output streams provided to communicate with the client.
| Field Summary | |
|---|---|
protected SessionChannel |
session
The session channel instance on which this command is being executed |
protected java.io.OutputStream |
stderr
Write STDERR data to this OutputStream |
protected java.io.InputStream |
stdin
Receive STDIN from this InputStream |
protected java.io.OutputStream |
stdout
Write STDOUT data to this OutputStream * |
static int |
STILL_ACTIVE
Value returned from getExitCode() to indicate that the process
is still active. |
| Constructor Summary | |
|---|---|
ExecutableCommand()
|
|
ExecutableCommand(int incomingBufferSize)
|
|
| Method Summary | |
|---|---|
abstract boolean |
createProcess(java.lang.String cmd,
java.util.Map environment)
Create the process but wait for the onStart() method before
performing any IO. |
abstract int |
getExitCode()
Get the exit code for this process. |
java.io.InputStream |
getInputStream()
Get the STDIN InputStream for this process. |
java.io.OutputStream |
getOutputStream()
Get the STDOUT OutputStream for this process. |
java.io.OutputStream |
getStderrOutputStream()
Get the STDERR OutputStream for this process. |
void |
init(SessionChannel session)
Initialize the command. |
abstract void |
kill()
Kill the command. |
abstract void |
onStart()
Called once the command has been started. |
void |
processStdinData(byte[] data)
Called by the session to pass incoming data into the process. |
void |
start()
Start the command. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int STILL_ACTIVE
getExitCode() to indicate that the process
is still active.
protected SessionChannel session
protected java.io.OutputStream stdout
protected java.io.OutputStream stderr
protected java.io.InputStream stdin
| Constructor Detail |
|---|
public ExecutableCommand()
public ExecutableCommand(int incomingBufferSize)
| Method Detail |
|---|
public void init(SessionChannel session)
session -
public abstract boolean createProcess(java.lang.String cmd,
java.util.Map environment)
onStart() method before
performing any IO.
cmd - environment -
public void start()
public abstract void onStart()
public abstract void kill()
public abstract int getExitCode()
STILL_ACTIVE.
public java.io.OutputStream getOutputStream()
public java.io.OutputStream getStderrOutputStream()
public java.io.InputStream getInputStream()
public void processStdinData(byte[] data)
throws java.io.IOException
data -
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||