|
dLife Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdlife.tools.xgrid.XgridCommand
public class XgridCommand
A command to be submitted to the Xgrid as a job. This class essentially presents an interface to some (but not all) of the features of the xgrid command line tool (see the Xgrid man page for more information).
| Constructor Summary | |
|---|---|
XgridCommand(String cmd)
Construct a new XgridCommand that can be used to submit the specified command to an xgrid as a job. |
|
XgridCommand(String si,
String in,
String so,
String se,
String out,
String cmd)
Construct a new XgridCommand that can be used to submit the specified command to an xgrid as a job. |
|
| Method Summary | |
|---|---|
void |
deleteJob(String host,
String password,
String grid)
Delete this command's job from the xgrid controller. |
String |
getCommand()
Get the command to be executed on the xGrid agent. |
String |
getInputDir()
Get the path to the working directory that is to be copied to each agent for the execution of this command. |
String |
getJobID()
Get the xgrid ID of the job that is running this command. |
String |
getOutputDir()
Get the path of the directory to which any files created by the execution of this command should be copied. |
XgridResult |
getResults(String host,
String password,
String grid)
Get the results of the job for this command. |
String |
getStandardError()
Get the path of the file to which all output written to standard error by the execution of this command should be copied. |
String |
getStandardIn()
Get the path to the file that is to be used for standard input for the execution of this command. |
String |
getStandardOut()
Get the path of the file to which all output written to standard output by the execution of this command should be copied. |
boolean |
isFinished(String host,
String password,
String grid)
Determine if the job for this XgridCommand finished successfully. |
boolean |
isRunning(String host,
String password,
String grid)
Determine if the job for this XgridCommand is still running. |
boolean |
jobFailed(String host,
String password,
String grid)
Determine if the job for this XgridCommand failed. |
void |
stopJob(String host,
String password,
String grid)
Stop this command's job on the xgrid controller but do not delete it. |
String |
submitJob(String host,
String password,
String grid)
Submit this command to the xgrid as a job. |
String |
toString()
Get a String representation of this XgridCommand. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public XgridCommand(String cmd)
cmd - the command.
IllegalArgumentException - if cmd is null.
public XgridCommand(String si,
String in,
String so,
String se,
String out,
String cmd)
si - the the file to be used as standard input for the job.in - the working directory to submit with the job. This should be a
full path name on the local machine.so - the file to which standard output from the job should be
written. This should be a full path name on the local machine.se - the file to which standard error from the job should be
written. This should be a full path name on the local machine.out - the directory in which the results (files generated by) the
job. This should be a full path name on the local machine.cmd - the command to be submitted.
IllegalArgumentException - if cmd is null.| Method Detail |
|---|
public String getStandardIn()
public String getInputDir()
public String getStandardOut()
public String getStandardError()
public String getOutputDir()
public String getCommand()
public String getJobID()
public String submitJob(String host,
String password,
String grid)
host - the hostname of the grid controller to which to submit the
commands. Can be null if the XGRID_CONTROLLER_HOSTNAME
environment variable is set on the machine being used.password - the password for the grid. Can be null if the
XGRID_CONTROLLER_PASSWORD environment variable is set on the
machine being used or the grid does not require a password.grid - the name of the logical grid on which the command will be
run. If this is null the command will be run on the default
grid. Note: xgrid uses numeric gid's to identify the grids.
This is not that id, it is the text name of the grid. This
method will translate automatically to the xgrid gid value.
XgridCommunicationError - if unable to connect to the xgrid (e.g.
bad host or password or the xgrid is down).
BadXgridCommandException - if the xgrid command line utility is
unable to execute the command.
IllegalStateException - if this XgridCommand has already been
submitted.
public XgridResult getResults(String host,
String password,
String grid)
host - the hostname of the grid controller from which to retrieve
the results. Can be null if the XGRID_CONTROLLER_HOSTNAME
environment variable is set on the machine being used.password - the password for the grid. Can be null if the
XGRID_CONTROLLER_PASSWORD environment variable is set on the
machine being used or the grid does not require a password.grid - the name of the logical grid on which the command will be
run. If this is null the command will be run on the default
grid. Note: xgrid uses numeric gid's to identify the grids.
This is not that id, it is the text name of the grid. This
method will translate automatically to the xgrid gid value.
IllegalStateException - if this XgridCommand has not yet been
submitted or the job has been deleted.
public void deleteJob(String host,
String password,
String grid)
host - the hostname of the grid controller from which to delete the
job. Can be null if the XGRID_CONTROLLER_HOSTNAME environment
variable is set on the machine being used.password - the password for the grid. Can be null if the
XGRID_CONTROLLER_PASSWORD environment variable is set on the
machine being used or the grid does not require a password.grid - the name of the logical grid on which the command will be
run. If this is null the command will be run on the default
grid. Note: xgrid uses numeric gid's to identify the grids.
This is not that id, it is the text name of the grid. This
method will translate automatically to the xgrid gid value.
XgridCommunicationException - if unable to delete the job.
IllegalStateException - if this XgridCommand has not yet been
submitted.
public void stopJob(String host,
String password,
String grid)
host - the hostname of the grid controller on which to stop the job.
Can be null if the XGRID_CONTROLLER_HOSTNAME environment
variable is set on the machine being used.password - the password for the grid. Can be null if the
XGRID_CONTROLLER_PASSWORD environment variable is set on the
machine being used or the grid does not require a password.grid - the name of the logical grid on which the command will be
run. If this is null the command will be run on the default
grid. Note: xgrid uses numeric gid's to identify the grids.
This is not that id, it is the text name of the grid. This
method will translate automatically to the xgrid gid value.
XgridCommunicationException - if unable to stop the job.
IllegalStateException - if this XgridCommand has not yet been
submitted.
public boolean isFinished(String host,
String password,
String grid)
host - the hostname of the grid controller on which to check for the
running job. Can be null if the XGRID_CONTROLLER_HOSTNAME
environment variable is set on the machine being used.password - the password for the grid. Can be null if the
XGRID_CONTROLLER_PASSWORD environment variable is set on the
machine being used or the grid does not require a password.grid - the name of the logical grid on which the command will be
run. If this is null the command will be run on the default
grid. Note: xgrid uses numeric gid's to identify the grids.
This is not that id, it is the text name of the grid. This
method will translate automatically to the xgrid gid value.
IllegalStateException - if this XgridCommand has already been
deleted.
public boolean isRunning(String host,
String password,
String grid)
host - the hostname of the grid controller on which to check for the
running job. Can be null if the XGRID_CONTROLLER_HOSTNAME
environment variable is set on the machine being used.password - the password for the grid. Can be null if the
XGRID_CONTROLLER_PASSWORD environment variable is set on the
machine being used or the grid does not require a password.grid - the name of the logical grid on which the command will be
run. If this is null the command will be run on the default
grid. Note: xgrid uses numeric gid's to identify the grids.
This is not that id, it is the text name of the grid. This
method will translate automatically to the xgrid gid value.
IllegalStateException - if this XgridCommand has already been
deleted.
public boolean jobFailed(String host,
String password,
String grid)
host - the hostname of the grid controller to which to check for the
failed job. Can be null if the XGRID_CONTROLLER_HOSTNAME
environment variable is set on the machine being used.password - the password for the grid. Can be null if the
XGRID_CONTROLLER_PASSWORD environment variable is set on the
machine being used or the grid does not require a password.grid - the name of the logical grid on which the command will be
run. If this is null the command will be run on the default
grid. Note: xgrid uses numeric gid's to identify the grids.
This is not that id, it is the text name of the grid. This
method will translate automatically to the xgrid gid value.
IllegalStateException - if this XgridCommand has already been
deleted.public String toString()
toString in class Object
|
dLife Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||