Class ExampleCommand

java.lang.Object
  extended by com.maverick.sshd.platform.ExecutableCommand
      extended by ExampleCommand

public class ExampleCommand
extends ExecutableCommand

A simple demonstration of an executable command that simply prints out the currently logged on users.

Author:
Lee David Painter

Field Summary
 
Fields inherited from class com.maverick.sshd.platform.ExecutableCommand
session, stderr, stdin, stdout, STILL_ACTIVE
 
Constructor Summary
ExampleCommand()
           
 
Method Summary
 boolean createProcess(String cmd, Map environment)
          Here you process the command and get ready to execute but DO NOT perform any IO yet, wait for onStart()
 int getExitCode()
           
 void kill()
           
 void onStart()
          The session is now open so you can perform all the IO you want but DONT block this method; if you have lots of interaction you will need to start a thread or override the processStdinData method to receive notification of data.
 
Methods inherited from class com.maverick.sshd.platform.ExecutableCommand
getInputStream, getOutputStream, getStderrOutputStream, init, processStdinData, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExampleCommand

public ExampleCommand()
Method Detail

getExitCode

public int getExitCode()
Specified by:
getExitCode in class ExecutableCommand

kill

public void kill()
Specified by:
kill in class ExecutableCommand

createProcess

public boolean createProcess(String cmd,
                             Map environment)
Here you process the command and get ready to execute but DO NOT perform any IO yet, wait for onStart()

Specified by:
createProcess in class ExecutableCommand
Parameters:
cmd -
environment -
Returns:

onStart

public void onStart()
The session is now open so you can perform all the IO you want but DONT block this method; if you have lots of interaction you will need to start a thread or override the processStdinData method to receive notification of data.

Specified by:
onStart in class ExecutableCommand


Copyright © 2012. All Rights Reserved.