com.pimeca.waster.oscmd
Class AbstractOsCmdLauncher

java.lang.Object
  extended by com.pimeca.waster.oscmd.AbstractOsCmdLauncher
All Implemented Interfaces:
OsCmdLauncher
Direct Known Subclasses:
AsterLauncher

public abstract class AbstractOsCmdLauncher
extends java.lang.Object
implements OsCmdLauncher

abstract class implementing OsCmdLauncher interface

Author:
maurel

Field Summary
private  int[] errorExitValues
          array of exit values that are considered as error if null no value throws exception (see apache.commons.cli)
private  java.io.OutputStream fileOutputStream
          file output stream for the os command
private  boolean isConsoleOutputRequired
          true if console output is required
private  java.util.List<java.lang.String> options
          list of options for the os command
private  boolean preDeleteWorkDir
          flag to delete os working directory before launching the command
private  long timeWait
          Watchdog time wait in milli-seconds negative value is for no watchdog
private  java.lang.String workingDirUri
          working directory for the os command
 
Constructor Summary
AbstractOsCmdLauncher()
           
 
Method Summary
 java.util.List<java.lang.String> getOptions()
           
 java.lang.String getWorkingDirUri()
           
 int launchCmd(java.util.List<java.lang.String> options)
           
 void setConsoleOutputRequired(boolean isConsoleOutputRequired)
           
 void setErrorExitValues(int[] errorExitValues)
           
 void setFileOutputStream(java.lang.String fileUri)
           
 void setPreDeleteWorkDir(boolean preDeleteWorkDir)
           
 void setTimeWait(long timeWait)
           
 void setWorkingDirUri(java.lang.String workingDirUri)
          sets os command working directory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timeWait

private long timeWait
Watchdog time wait in milli-seconds negative value is for no watchdog


options

private java.util.List<java.lang.String> options
list of options for the os command


workingDirUri

private java.lang.String workingDirUri
working directory for the os command


fileOutputStream

private java.io.OutputStream fileOutputStream
file output stream for the os command


isConsoleOutputRequired

private boolean isConsoleOutputRequired
true if console output is required


preDeleteWorkDir

private boolean preDeleteWorkDir
flag to delete os working directory before launching the command


errorExitValues

private int[] errorExitValues
array of exit values that are considered as error if null no value throws exception (see apache.commons.cli)

Constructor Detail

AbstractOsCmdLauncher

public AbstractOsCmdLauncher()
Method Detail

launchCmd

public int launchCmd(java.util.List<java.lang.String> options)
Specified by:
launchCmd in interface OsCmdLauncher

getOptions

public java.util.List<java.lang.String> getOptions()
Returns:
list of options

setWorkingDirUri

public void setWorkingDirUri(java.lang.String workingDirUri)
sets os command working directory

Parameters:
workingDirUri - absolute uri of os command working directory

getWorkingDirUri

public java.lang.String getWorkingDirUri()

setFileOutputStream

public void setFileOutputStream(java.lang.String fileUri)

setPreDeleteWorkDir

public void setPreDeleteWorkDir(boolean preDeleteWorkDir)

setErrorExitValues

public void setErrorExitValues(int[] errorExitValues)

setTimeWait

public void setTimeWait(long timeWait)

setConsoleOutputRequired

public void setConsoleOutputRequired(boolean isConsoleOutputRequired)
Parameters:
isConsoleOutputRequired - the isConsoleOutputRequired to set