SmartFrog 3.10.000

org.smartfrog.services.shellscript
Class ScriptExecutionImpl.ScriptResultsImpl

java.lang.Object
  extended by org.smartfrog.services.shellscript.ScriptExecutionImpl.ScriptResultsImpl
All Implemented Interfaces:
java.io.Serializable, ScriptResults
Enclosing class:
ScriptExecutionImpl

public class ScriptExecutionImpl.ScriptResultsImpl
extends java.lang.Object
implements ScriptResults, java.io.Serializable

See Also:
Serialized Form

Field Summary
protected  java.lang.reflect.InvocationTargetException exception
           
protected  boolean resultReady
           
protected  boolean verbose
          Verbose script results output
 
Constructor Summary
ScriptExecutionImpl.ScriptResultsImpl()
           
 
Method Summary
 java.lang.reflect.InvocationTargetException getException()
           
 java.lang.Integer getExitCode()
           
 java.util.List getStderr()
           
 java.util.List getStdout()
           
 void ready(java.lang.Integer code)
           
 boolean resultsReady()
          check to see if the results have now been collated
 java.lang.String tailStderr(int num)
          Gets the tail end of the stderr output
 java.lang.String tailStdout(int num)
          Gets the tail end of the stdout output
 java.lang.String toString()
           
 void verbose()
          Script result will be verbose using system.out and system.err streams
 void waitFor(long timeout)
          wait for the results to be ready for the timeout
 ComponentDescription waitForResults(long timeout)
          wait for the results to be ready for the timeout, and return them when they are
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

resultReady

protected boolean resultReady

exception

protected java.lang.reflect.InvocationTargetException exception

verbose

protected boolean verbose
Verbose script results output

Constructor Detail

ScriptExecutionImpl.ScriptResultsImpl

public ScriptExecutionImpl.ScriptResultsImpl()
Method Detail

getStderr

public java.util.List getStderr()
                         throws SmartFrogException
Specified by:
getStderr in interface ScriptResults
Returns:
List list containing lines output to stderr by the command
Throws:
SmartFrogException - if called before results are ready

getStdout

public java.util.List getStdout()
                         throws SmartFrogException
Specified by:
getStdout in interface ScriptResults
Returns:
List list containing lines output to stdout by the command
Throws:
SmartFrogException - if called before results are ready

getExitCode

public java.lang.Integer getExitCode()
                              throws SmartFrogException
Specified by:
getExitCode in interface ScriptResults
Returns:
Integer exit code from command process
Throws:
SmartFrogException - if called before results are ready

getException

public java.lang.reflect.InvocationTargetException getException()
                                                         throws SmartFrogException
Specified by:
getException in interface ScriptResults
Throws:
SmartFrogException

tailStderr

public java.lang.String tailStderr(int num)
                            throws SmartFrogException
Description copied from interface: ScriptResults
Gets the tail end of the stderr output

Specified by:
tailStderr in interface ScriptResults
Parameters:
num - int number of lines to include up to end of stderr stream
Returns:
String containing last lines from stderr
Throws:
SmartFrogException - if called before results are ready

tailStdout

public java.lang.String tailStdout(int num)
                            throws SmartFrogException
Description copied from interface: ScriptResults
Gets the tail end of the stdout output

Specified by:
tailStdout in interface ScriptResults
Parameters:
num - int number of lines to include up to end of stdout stream
Returns:
String containing last lines from stdout
Throws:
SmartFrogException - if called before results are ready

resultsReady

public boolean resultsReady()
Description copied from interface: ScriptResults
check to see if the results have now been collated

Specified by:
resultsReady in interface ScriptResults
Returns:
true if the results are ready, false otherwise

verbose

public void verbose()
Description copied from interface: ScriptResults
Script result will be verbose using system.out and system.err streams

Specified by:
verbose in interface ScriptResults

waitForResults

public ComponentDescription waitForResults(long timeout)
                                    throws SmartFrogException
wait for the results to be ready for the timeout, and return them when they are

Specified by:
waitForResults in interface ScriptResults
Parameters:
timeout - the maximum time to wait in milliseconds for the results: 0 don't wait, -1 wait forever
Returns:
a component description containing aspects of the result: The resut contains three attributes as follows: "code" the int result code of the final command in the vector - 0 if not supported in shell, "stdOut" a list of lines on stdout - empty if not supported in shell, "stdErr" a list of lines on stderr - empty if not supported in shell.
Throws:
SmartFrogException - if the results are not ready in time

waitFor

public void waitFor(long timeout)
             throws SmartFrogException
wait for the results to be ready for the timeout

Specified by:
waitFor in interface ScriptResults
Parameters:
timeout - the maximum time to wait in milliseconds for the results: 0 don't wait, -1 wait forever
Throws:
SmartFrogException - if the results are not ready in time

ready

public void ready(java.lang.Integer code)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

SmartFrog CORE 3.10.000

(C) Copyright 1998-2006 Hewlett-Packard Development Company, LP