SmartFrog 3.10.000

org.smartfrog.services.shellscript
Interface ScriptResults

All Known Implementing Classes:
ScriptExecutionImpl.ScriptResultsImpl

public interface ScriptResults

Interface to the "future" object returned from submiting an execute request to A ScriptExecution implementing object. The result contains three attributes as follows: "code" the int result code of the final command - 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. These result attributes may be accessed directly using the getter methods once the results are ready, or may be accessed via a ComponentDescription object returned by the waitForResults() method.


Method Summary
 java.lang.reflect.InvocationTargetException getException()
           
 java.lang.Integer getExitCode()
           
 java.util.List getStderr()
           
 java.util.List getStdout()
           
 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
 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)
          Deprecated.  
 

Method Detail

resultsReady

boolean resultsReady()
check to see if the results have now been collated

Returns:
true if the results are ready, false otherwise

waitForResults

ComponentDescription waitForResults(long timeout)
                                    throws SmartFrogException
Deprecated. 

wait for the results to be ready for the timeout, and return them when they are

Parameters:
timeout - the maximum time to wait 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, "stdRrr" a list of lines on stderr - empty if not supported in shell.
Throws:
SmartFrogException - if the results are not ready in time

waitFor

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

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

verbose

void verbose()
Script result will be verbose using system.out and system.err streams


getStderr

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

getStdout

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

getExitCode

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

getException

java.lang.reflect.InvocationTargetException getException()
                                                         throws SmartFrogException
Throws:
SmartFrogException

tailStderr

java.lang.String tailStderr(int num)
                            throws SmartFrogException
Gets the tail end of the stderr output

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

java.lang.String tailStdout(int num)
                            throws SmartFrogException
Gets the tail end of the stdout output

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

SmartFrog CORE 3.10.000

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