org.icenigrid.gridsam.core
Interface JobManager

All Known Implementing Classes:
DefaultJobManager

public interface JobManager

Interface representing the entry-point to the GridSAM job submission and monitoring system.

Author:
wwhl

Method Summary
 JobInstance findJobInstance(java.lang.String pID)
          find a job instance using the job identifier
 JobInstance[] findJobInstance(java.lang.String[] pIDs)
          find a job instance using the job identifier
 void registerChangeListener(java.lang.String pID, JobInstanceChangeListener pChangeListener)
          register a listener to listen to change to job
 JobInstance rerunJob(java.lang.String pJobID, JobState startState, org.icenigrid.schema.jsdl.y2005.m11.JobDefinitionDocument pDesc, boolean pStartSuspend)
          Rerun a job from a specified stage and reuse the same working directory.
 JobInstance startJob(java.lang.String pID)
          Start a pending job.
 JobInstance[] startJob(java.lang.String[] pIDs)
          Start a set of pending jobs.
 JobInstance submitJob(org.icenigrid.schema.jsdl.y2005.m11.JobDefinitionDocument pDesc)
          submit a job to this JobManager instance.
 JobInstance[] submitJob(org.icenigrid.schema.jsdl.y2005.m11.JobDefinitionDocument[] pDesc, boolean pSuspended)
          submit a set of jobs to this JobManager instance as a bulk operation.
 JobInstance submitJob(org.icenigrid.schema.jsdl.y2005.m11.JobDefinitionDocument pDesc, boolean pSuspended)
          submit a job to this JobManager instances
 void terminateJob(java.lang.String pID)
          terminate the job identified
 void terminateJob(java.lang.String[] pIDs)
          terminate the jobs identified
 void unregisterChangeListener(java.lang.String pID, JobInstanceChangeListener pChangeListener)
          unregister a previously registered listener with the given job ID
 

Method Detail

submitJob

JobInstance submitJob(org.icenigrid.schema.jsdl.y2005.m11.JobDefinitionDocument pDesc)
                      throws JobManagerException,
                             SubmissionException,
                             UnsupportedFeatureException
submit a job to this JobManager instance. The job enter the job lifecycle immediately. This is the same as calling submitJob(pDesc, true)

Parameters:
pDesc - the job description
Returns:
JobInstance the job instance
Throws:
SubmissionException - if the job cannot be submitted
UnsupportedFeatureException - if the job description contains a feature this JobManager does not common
JobManagerException

submitJob

JobInstance[] submitJob(org.icenigrid.schema.jsdl.y2005.m11.JobDefinitionDocument[] pDesc,
                        boolean pSuspended)
                        throws JobManagerException,
                               SubmissionException,
                               UnsupportedFeatureException
submit a set of jobs to this JobManager instance as a bulk operation. The job enter the job lifecycle immediately. This is the same as calling submitJob(pDesc, true)

Parameters:
pDesc - the job description
pSuspended - should the job be suspended initially
Returns:
JobInstance the job instance
Throws:
SubmissionException - if the job cannot be submitted
UnsupportedFeatureException - if the job description contains a feature this JobManager does not common
JobManagerException

submitJob

JobInstance submitJob(org.icenigrid.schema.jsdl.y2005.m11.JobDefinitionDocument pDesc,
                      boolean pSuspended)
                      throws JobManagerException,
                             SubmissionException,
                             UnsupportedFeatureException
submit a job to this JobManager instances

Parameters:
pDesc - the job description
pSuspended - submit the job but leave it suspended. The job must be started with the startJob method.
Returns:
JobInstance the job instance
Throws:
SubmissionException - if the job cannot be submitted
UnsupportedFeatureException - if the job description contains a feature this JobManager does not common
JobManagerException

rerunJob

JobInstance rerunJob(java.lang.String pJobID,
                     JobState startState,
                     org.icenigrid.schema.jsdl.y2005.m11.JobDefinitionDocument pDesc,
                     boolean pStartSuspend)
                     throws JobManagerException,
                            SubmissionException,
                            UnsupportedFeatureException
Rerun a job from a specified stage and reuse the same working directory.

Parameters:
pJobID - Which job do you want to rerun? The job is also called parent job.
startState - job will run from this state. It can be pending, staged-in or executed.
pDesc - the job description. If is omitted, the JSDL of the parent job will be used.
pStartSuspend - suspend job or not when rerun the job.
Returns:
new job instance.
Throws:
SubmissionException - if the job cannot be submitted
UnsupportedFeatureException - if the job description contains a feature this JobManager does not common
JobManagerException

startJob

JobInstance startJob(java.lang.String pID)
                     throws JobManagerException,
                            ControlException,
                            UnknownJobException,
                            SubmissionException
Start a pending job.

Parameters:
pID - the pending job to be started. This job must be submitted to the job manager using submitJob(desc, false)
Returns:
JobInstance the job instance
Throws:
JobManagerException - if the job manager engine is not functioning
SubmissionException - if the job is not a pending job
ControlException - if the job cannot be started
UnknownJobException - if pID does not identify a known job

startJob

JobInstance[] startJob(java.lang.String[] pIDs)
                       throws JobManagerException,
                              ControlException,
                              UnknownJobException,
                              SubmissionException
Start a set of pending jobs.

Parameters:
pID - an arryay of IDs to the pending jobs to be started. This job must be submitted to the job manager using submitJob(desc, false)
Returns:
array of JobInstance the job instances
Throws:
JobManagerException - if the job manager engine is not functioning
SubmissionException - if the job is not a pending job
ControlException - if the job cannot be started
UnknownJobException - if one of the pIDs does not identify a known job

findJobInstance

JobInstance findJobInstance(java.lang.String pID)
                            throws JobManagerException,
                                   UnknownJobException
find a job instance using the job identifier

Parameters:
pID - job identifier
Returns:
JobInstance the job instance
Throws:
UnknownJobException - if the job instance cannot be found
JobManagerException - if the job manager is at fault

findJobInstance

JobInstance[] findJobInstance(java.lang.String[] pIDs)
                              throws JobManagerException,
                                     UnknownJobException
find a job instance using the job identifier

Parameters:
pID - job identifier
Returns:
JobInstance the job instance
Throws:
UnknownJobException - if the job instance cannot be found
JobManagerException - if the job manager is at fault

terminateJob

void terminateJob(java.lang.String pID)
                  throws JobManagerException,
                         ControlException,
                         UnknownJobException
terminate the job identified

Parameters:
pID -
Throws:
JobManagerException - if the job manager is at fault
ControlException - if the job cannot be terminated
UnknownJobException - if the job instance cannot be found

terminateJob

void terminateJob(java.lang.String[] pIDs)
                  throws JobManagerException,
                         ControlException,
                         UnknownJobException
terminate the jobs identified

Parameters:
pIDs - the jobs to be terminated
Throws:
JobManagerException - if the job manager is at fault
ControlException - if the job cannot be terminated
UnknownJobException - if the job instance cannot be found

registerChangeListener

void registerChangeListener(java.lang.String pID,
                            JobInstanceChangeListener pChangeListener)
                            throws JobManagerException
register a listener to listen to change to job

Parameters:
pID - the job id
pChangeListener - the listener
Throws:
JobManagerException - if the job manager cannot register the listener

unregisterChangeListener

void unregisterChangeListener(java.lang.String pID,
                              JobInstanceChangeListener pChangeListener)
                              throws JobManagerException
unregister a previously registered listener with the given job ID

Parameters:
pID - the job id
pChangeListener - the listener previously registered with registerChangeListener()
Throws:
JobManagerException - if the job manager cannot register the listener


Copyright © 2008. All Rights Reserved.