disman
Class Run

java.lang.Object
  |
  +--disman.Run

public class Run
extends java.lang.Object


Field Summary
static int CONTROL_ABORT
          Valid control code
static int CONTROL_NOP
          Valid control code
static int CONTROL_RESUME
          Valid control code
static int CONTROL_SUSPEND
          Valid control code
static java.lang.String[] controlStrings
          Array of control code strings.
static int EXIT_CODE_GENERIC_ERROR
          Valid exit code
static int EXIT_CODE_HALTED
          Valid exit code
static int EXIT_CODE_INVALID_ARGUMENT
          Valid exit code
static int EXIT_CODE_LANGUAGE_ERROR
          Valid exit code
static int EXIT_CODE_LIFE_TIME_EXCEEDED
          Valid exit code
static int EXIT_CODE_NO_ERROR
          Valid exit code
static int EXIT_CODE_NO_RESOURCES_LEFT
          Valid exit code
static int EXIT_CODE_RUNTIME_ERROR
          Valid exit code
static int EXIT_CODE_SECURITY_VIOLATION
          Valid exit code
static java.lang.String[] exitCodeStrings
          Array of exit code strings.
static long LIFETIME_NEVERENDING
          Special smLifeTime value for never ending scripts.
static int STATE_ABORTING
          Valid run state
static int STATE_EXECUTING
          Valid run state
static int STATE_INITIALIZING
          Valid run state
static int STATE_RESUMING
          Valid run state
static int STATE_SUSPENDED
          Valid run state
static int STATE_SUSPENDING
          Valid run state
static int STATE_TERMINATED
          Valid run state
static java.lang.String[] stateStrings
          Array of run state strings.
 
Constructor Summary
Run(Disman disman, Launch launch, int index)
          Create a Run object for a given Disman object indexed by the owner and name of a given Launch object, and a given index by retrieval from the agent.
Run(Disman disman, java.lang.String owner, java.lang.String name, int index)
          Create a Run object for a given Disman object indexed by a given launch button owner, launch button name, and index by retrieval from the agent.
 
Method Summary
 void abort()
          Abort the run.
 void block()
          Block until this script has been terminated.
 java.lang.String getArgument()
          Return the argument string (smRunArgument).
 int getControl()
          Get the smRunControl value.
 java.lang.String getControlString()
          Get the string representation of the smRunControl value.
 java.util.Date getEnd()
          Return the end time as a Date object (smRunEndTime).
 int[] getEndTime()
          Return the end time as an array of integer values representing the MIB value's octets (smRunEndTime).
 java.lang.String getError()
          Return the error string (smRunError).
 java.util.Date getErrorTime()
          Return the time of the last error change as a Date object (smRunErrorTime).
 int[] getErrorTimeIntArray()
          Return the time of the last error change as an array of integer values representing the MIB value's octets (smRunErrorTime).
 int getExitCode()
          Return the exit code (smRunExitCode).
 java.lang.String getExitCodeString()
          Return the string representation of the exit code (smRunExitCode).
 long getExpireTime()
          Return the script's expire time after termination in milli seconds (smRunExpireTime).
 int getIndex()
          Return the index of this Run object according to the launch button from which this Run object has been created (smRunIndex).
 Launch getLaunch()
          Return the Launch object from which this Run object has been created.
 long getLifeTime()
          Return the script's life time in milli seconds (smRunLifeTime).
 java.lang.String getName()
          Return the name of the launch button from which this Run object has been created (smLaunchName).
 java.lang.String getOwner()
          Return the owner of the launch button from which this Run object has been created (smLaunchOwner).
 java.lang.String getResult()
          Return the result string (smRunResult).
 java.util.Date getResultTime()
          Return the time of the last result change as a Date object (smRunResultTime).
 int[] getResultTimeIntArray()
          Return the time of the last result change as an array of integer values representing the MIB value's octets (smRunResultTime).
 Script getScript()
          Return the Script object that is executed by this Run object.
 java.util.Date getStart()
          Return the start time as a Date object (smRunStartTime).
 int[] getStartTime()
          Return the start time as an array of integer values representing the MIB value's octets (smRunStartTime).
 int getState()
          Return an integer value representing the smRunState.
 java.lang.String getStateString()
          Return a String representing the smRunState.
 boolean isExecuting()
          Return true, if this script is executing (smRunState == executing(2).
 boolean isInitializing()
          Return true, if this script is initializing (smRunState == initializing(1).
 boolean isSuspended()
          Return true, if this script is suspended (smRunState == suspended(4).
 boolean isTerminated()
          Return true, if this script is terminated (smRunState == terminated(7).
 void remove()
          Remove this Run object.
 void resume()
          Resume the script.
 void setControl(int control)
          Set the smRunControl value to a given integer value.
 void setExpireTime(long time)
          Set the script's expire time after termination in milli seconds (smRunExpireTime).
 void setLifeTime(long time)
          Set the script's life time in milli seconds (smRunLifeTime).
 void suspend()
          Suspend the script.
 java.lang.String toString()
          Return a String representation of the Run.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LIFETIME_NEVERENDING

public static final long LIFETIME_NEVERENDING
Special smLifeTime value for never ending scripts.

EXIT_CODE_NO_ERROR

public static final int EXIT_CODE_NO_ERROR
Valid exit code

EXIT_CODE_HALTED

public static final int EXIT_CODE_HALTED
Valid exit code

EXIT_CODE_LIFE_TIME_EXCEEDED

public static final int EXIT_CODE_LIFE_TIME_EXCEEDED
Valid exit code

EXIT_CODE_NO_RESOURCES_LEFT

public static final int EXIT_CODE_NO_RESOURCES_LEFT
Valid exit code

EXIT_CODE_LANGUAGE_ERROR

public static final int EXIT_CODE_LANGUAGE_ERROR
Valid exit code

EXIT_CODE_RUNTIME_ERROR

public static final int EXIT_CODE_RUNTIME_ERROR
Valid exit code

EXIT_CODE_INVALID_ARGUMENT

public static final int EXIT_CODE_INVALID_ARGUMENT
Valid exit code

EXIT_CODE_SECURITY_VIOLATION

public static final int EXIT_CODE_SECURITY_VIOLATION
Valid exit code

EXIT_CODE_GENERIC_ERROR

public static final int EXIT_CODE_GENERIC_ERROR
Valid exit code

exitCodeStrings

public static final java.lang.String[] exitCodeStrings
Array of exit code strings.

CONTROL_ABORT

public static final int CONTROL_ABORT
Valid control code

CONTROL_SUSPEND

public static final int CONTROL_SUSPEND
Valid control code

CONTROL_RESUME

public static final int CONTROL_RESUME
Valid control code

CONTROL_NOP

public static final int CONTROL_NOP
Valid control code

controlStrings

public static final java.lang.String[] controlStrings
Array of control code strings.

STATE_INITIALIZING

public static final int STATE_INITIALIZING
Valid run state

STATE_EXECUTING

public static final int STATE_EXECUTING
Valid run state

STATE_SUSPENDING

public static final int STATE_SUSPENDING
Valid run state

STATE_SUSPENDED

public static final int STATE_SUSPENDED
Valid run state

STATE_RESUMING

public static final int STATE_RESUMING
Valid run state

STATE_ABORTING

public static final int STATE_ABORTING
Valid run state

STATE_TERMINATED

public static final int STATE_TERMINATED
Valid run state

stateStrings

public static final java.lang.String[] stateStrings
Array of run state strings.
Constructor Detail

Run

public Run(Disman disman,
           java.lang.String owner,
           java.lang.String name,
           int index)
    throws java.io.IOException,
           SnmpException,
           NoSuchRowException
Create a Run object for a given Disman object indexed by a given launch button owner, launch button name, and index by retrieval from the agent.
Parameters:
disman - the Disman object associated with this Run object
owner - the launch button owner
name - the launch button name
index - the run index related to the launch button
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs
NoSuchRowException - if the indexed row of the launch table cannot be accessed

Run

public Run(Disman disman,
           Launch launch,
           int index)
    throws java.io.IOException,
           SnmpException
Create a Run object for a given Disman object indexed by the owner and name of a given Launch object, and a given index by retrieval from the agent.
Parameters:
disman - the Disman object associated with this Run object
launch - the Launch object
index - the run index related to the launch button
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs
Method Detail

remove

public void remove()
            throws TimeoutException,
                   java.io.IOException,
                   SnmpException
Remove this Run object.
Throws:
TimeoutException - if the Run object cannot be removed in time
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs

getOwner

public java.lang.String getOwner()
Return the owner of the launch button from which this Run object has been created (smLaunchOwner).
Returns:
the launch button owner

getName

public java.lang.String getName()
Return the name of the launch button from which this Run object has been created (smLaunchName).
Returns:
the launch button name

getIndex

public int getIndex()
Return the index of this Run object according to the launch button from which this Run object has been created (smRunIndex).
Returns:
the run index

getLaunch

public Launch getLaunch()
                 throws java.io.IOException,
                        SnmpException
Return the Launch object from which this Run object has been created.
Returns:
the Launch object
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs

getScript

public Script getScript()
                 throws java.io.IOException,
                        SnmpException
Return the Script object that is executed by this Run object.
Returns:
the Script object
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs

getArgument

public java.lang.String getArgument()
                             throws java.io.IOException,
                                    SnmpException
Return the argument string (smRunArgument).
Returns:
the argument string
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs

getStartTime

public int[] getStartTime()
                   throws java.io.IOException,
                          SnmpException
Return the start time as an array of integer values representing the MIB value's octets (smRunStartTime). This method should not be used by high level Script MIB applications.
Returns:
the array of octets of the smRunStartTime
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs

getStart

public java.util.Date getStart()
                        throws java.io.IOException,
                               SnmpException
Return the start time as a Date object (smRunStartTime).
Returns:
Date object representing the script's start time, or null if the start time has not been set so far.
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs

getEndTime

public int[] getEndTime()
                 throws java.io.IOException,
                        SnmpException
Return the end time as an array of integer values representing the MIB value's octets (smRunEndTime). This method should not be used by high level Script MIB applications.
Returns:
the array of octets of the smRunEndTime
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs

getEnd

public java.util.Date getEnd()
                      throws java.io.IOException,
                             SnmpException
Return the end time as a Date object (smRunEndTime).
Returns:
Date object representing the script's end time, or null if the script is not yet terminated
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs

getLifeTime

public long getLifeTime()
                 throws java.io.IOException,
                        SnmpException
Return the script's life time in milli seconds (smRunLifeTime).
Returns:
the life time in milli seconds
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs

setLifeTime

public void setLifeTime(long time)
                 throws java.io.IOException,
                        SnmpException
Set the script's life time in milli seconds (smRunLifeTime).
Parameters:
time - the life time in milli seconds
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs

getExpireTime

public long getExpireTime()
                   throws java.io.IOException,
                          SnmpException
Return the script's expire time after termination in milli seconds (smRunExpireTime).
Returns:
the expire time in milli seconds
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs

setExpireTime

public void setExpireTime(long time)
                   throws java.io.IOException,
                          SnmpException
Set the script's expire time after termination in milli seconds (smRunExpireTime).
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs

getExitCode

public int getExitCode()
                throws java.io.IOException,
                       SnmpException
Return the exit code (smRunExitCode).
Returns:
the exit code
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs

getExitCodeString

public java.lang.String getExitCodeString()
                                   throws java.io.IOException,
                                          SnmpException
Return the string representation of the exit code (smRunExitCode).
Returns:
the exit code string
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs

getResult

public java.lang.String getResult()
                           throws java.io.IOException,
                                  SnmpException
Return the result string (smRunResult).
Returns:
the result string
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs

getControl

public int getControl()
               throws java.io.IOException,
                      SnmpException
Get the smRunControl value. This method should not be used by high level Script MIB applications.
Returns:
the smRunControl value
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs

getControlString

public java.lang.String getControlString()
                                  throws java.io.IOException,
                                         SnmpException
Get the string representation of the smRunControl value.
Returns:
the smRunControl string
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs

setControl

public void setControl(int control)
                throws java.io.IOException,
                       SnmpException
Set the smRunControl value to a given integer value. This method should not be used by high level Script MIB applications.
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs

abort

public void abort()
           throws TimeoutException,
                  java.io.IOException,
                  SnmpException
Abort the run.
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs
TimeoutException - if the run cannot be aborted in time

suspend

public void suspend()
             throws TimeoutException,
                    java.io.IOException,
                    SnmpException
Suspend the script.
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs
TimeoutException - if the run cannot be suspended in time

resume

public void resume()
            throws TimeoutException,
                   java.io.IOException,
                   SnmpException
Resume the script.
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs
TimeoutException - if the run cannot be resumed in time

getState

public int getState()
             throws java.io.IOException,
                    SnmpException
Return an integer value representing the smRunState. This method should not be used by high level Script MIB applications.
Returns:
the smRunState value
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs

getStateString

public java.lang.String getStateString()
                                throws java.io.IOException,
                                       SnmpException
Return a String representing the smRunState.
Returns:
the smRunState string
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs

isExecuting

public boolean isExecuting()
                    throws java.io.IOException,
                           SnmpException
Return true, if this script is executing (smRunState == executing(2).
Returns:
true, if script is executing
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs

isInitializing

public boolean isInitializing()
                       throws java.io.IOException,
                              SnmpException
Return true, if this script is initializing (smRunState == initializing(1).
Returns:
true, if script is initializing
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs

isSuspended

public boolean isSuspended()
                    throws java.io.IOException,
                           SnmpException
Return true, if this script is suspended (smRunState == suspended(4).
Returns:
true, if script is suspended
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs

isTerminated

public boolean isTerminated()
                     throws java.io.IOException,
                            SnmpException
Return true, if this script is terminated (smRunState == terminated(7).
Returns:
true, if script is terminated
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs

block

public void block()
           throws java.io.IOException,
                  SnmpException
Block until this script has been terminated.
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs

getError

public java.lang.String getError()
                          throws java.io.IOException,
                                 SnmpException,
                                 DismanReadException
Return the error string (smRunError).
Returns:
the error string
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs

getResultTimeIntArray

public int[] getResultTimeIntArray()
                            throws java.io.IOException,
                                   SnmpException
Return the time of the last result change as an array of integer values representing the MIB value's octets (smRunResultTime). This method should not be used by high level Script MIB applications.
Returns:
the array of octets of the smRunResultTime
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs

getResultTime

public java.util.Date getResultTime()
                             throws java.io.IOException,
                                    SnmpException
Return the time of the last result change as a Date object (smRunResultTime).
Returns:
Date object representing the last result change time, or null if it has not yet been modified.
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs

getErrorTimeIntArray

public int[] getErrorTimeIntArray()
                           throws java.io.IOException,
                                  SnmpException
Return the time of the last error change as an array of integer values representing the MIB value's octets (smRunErrorTime). This method should not be used by high level Script MIB applications.
Returns:
the array of octets of the smRunErrorTime
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs

getErrorTime

public java.util.Date getErrorTime()
                            throws java.io.IOException,
                                   SnmpException
Return the time of the last error change as a Date object (smRunErrorTime).
Returns:
Date object representing the last error change time, or null if it has not yet been modified.
Throws:
SnmpException - if an Snmp request fails
java.io.IOException - if a local I/O problem occurs

toString

public java.lang.String toString()
Return a String representation of the Run. Overrides java.lang.Object.
Overrides:
toString in class java.lang.Object