public interface JobOperator
Modifier and Type | Method and Description |
---|---|
void |
abandon(long executionId)
Set batch status to ABANDONED.
|
JobExecution |
getJobExecution(long executionId)
Return job execution for specified execution id.
|
java.util.List<JobExecution> |
getJobExecutions(JobInstance instance)
Return all job executions belonging to the specified job instance.
|
JobInstance |
getJobInstance(long executionId)
Return the job instance for the specified execution id.
|
int |
getJobInstanceCount(java.lang.String jobName)
Returns number of instances of a job with a particular name.
|
java.util.List<JobInstance> |
getJobInstances(java.lang.String jobName,
int start,
int count)
Returns all JobInstances belonging to a job with a particular name
in reverse chronological order.
|
java.util.Set<java.lang.String> |
getJobNames()
Returns a set of all job names known to the batch runtime.
|
java.util.Properties |
getParameters(long executionId)
Returns job parameters for a specified job instance.
|
java.util.List<java.lang.Long> |
getRunningExecutions(java.lang.String jobName)
Returns execution ids for job instances with the specified
name that have running executions.
|
java.util.List<StepExecution> |
getStepExecutions(long jobExecutionId)
Return StepExecutions for specified execution id.
|
long |
restart(long executionId,
java.util.Properties restartParameters)
Restarts a failed or stopped job instance, which executes asynchronously.
|
long |
start(java.lang.String jobXMLName,
java.util.Properties jobParameters)
Creates a new job instance and starts the first execution of that
instance, which executes asynchronously.
|
void |
stop(long executionId)
Request a running job execution stops.
|
java.util.Set<java.lang.String> getJobNames() throws JobSecurityException
JobSecurityException
- Thrown when the implementation determines
that execution of this method with these parameters is not authorized
(by some implementation-specific mechanism).int getJobInstanceCount(java.lang.String jobName) throws NoSuchJobException, JobSecurityException
jobName
- specifies the name of the job.NoSuchJobException
- Thrown when the jobName parameter
value doesn't correspond to a job recognized by the
implementation's repository.JobSecurityException
- Thrown when the implementation determines
that execution of this method with these parameters is not authorized
(by some implementation-specific mechanism).java.util.List<JobInstance> getJobInstances(java.lang.String jobName, int start, int count) throws NoSuchJobException, JobSecurityException
jobName
- specifies the job name.start
- specifies the relative starting number (zero based) to
return from the
maximal list of job instances.count
- specifies the number of job instances to return from the
starting position of the maximal list of job instances.NoSuchJobException
- Thrown when the jobName parameter
value doesn't correspond to a job recognized by the
implementation's repository.JobSecurityException
- Thrown when the implementation determines
that execution of this method with these parameters is not authorized
(by some implementation-specific mechanism).java.util.List<java.lang.Long> getRunningExecutions(java.lang.String jobName) throws NoSuchJobException, JobSecurityException
jobName
- specifies the job name.NoSuchJobException
- Thrown when the jobName parameter
value doesn't correspond to a job recognized by the
implementation's repository.JobSecurityException
- Thrown when the implementation determines
that execution of this method with these parameters is not authorized
(by some implementation-specific mechanism).java.util.Properties getParameters(long executionId) throws NoSuchJobExecutionException, JobSecurityException
executionId
- specifies the execution from which to retrieve the
parameters.NoSuchJobExecutionException
- Thrown when the executionId parameter
value doesn't correspond to an execution recognized by the
implementation's repository.JobSecurityException
- Thrown when the implementation determines
that execution of this method with these parameters is not authorized
(by some implementation-specific mechanism).long start(java.lang.String jobXMLName, java.util.Properties jobParameters) throws JobStartException, JobSecurityException
jobXMLName
- specifies the name of the Job XML describing the job.jobParameters
- specifies the keyword/value pairs for attribute
substitution in the Job XML.JobStartException
- Thrown for some error condition other than
those listed by the other checked exceptions on this method. Note that
batch runtime implementations have a choice of detecting certain
conditions via upfront validation or only later, during execution.
This nets out to the fact that one implementation may throw
JobStartException on a given error condition while another may not.JobSecurityException
- Thrown when the implementation determines
that execution of this method with these parameters is not authorized
(by some implementation-specific mechanism).long restart(long executionId, java.util.Properties restartParameters) throws JobExecutionAlreadyCompleteException, NoSuchJobExecutionException, JobExecutionNotMostRecentException, JobRestartException, JobSecurityException
executionId
- specifies the execution to to restart. This execution
must be the most recent execution that ran.restartParameters
- specifies the keyword/value pairs for attribute
substitution in the Job XML.JobExecutionAlreadyCompleteException
- Thrown when the job execution
associated with executionId is currently complete.NoSuchJobExecutionException
- Thrown when the executionId parameter
value doesn't correspond to an execution recognized by the
implementation's repository.JobExecutionNotMostRecentException
- Thrown when the executionId
parameter value does not represent the most recent execution for the
corresponding job instance.JobRestartException
- Thrown for some error condition other than
those listed by the other checked exceptions on this method. Note that
batch runtime implementations have a choice of detecting certain
conditions via upfront validation or only later, during execution.
This nets out to the fact that one implementation may throw
JobRestartException on a given error condition while another may not.JobSecurityException
- Thrown when the implementation determines
that execution of this method with these parameters is not authorized
(by some implementation-specific mechanism).void stop(long executionId) throws NoSuchJobExecutionException, JobExecutionNotRunningException, JobSecurityException
Request a running job execution stops. This method notifies the job execution to stop and then returns. The job execution normally stops and does so asynchronously. Note JobOperator cannot guarantee the jobs stops: it is possible a badly behaved batch application does not relinquish control.
Note for partitioned batchlet steps the Batchlet stop method is invoked on each thread actively processing a partition.executionId
- specifies the job execution to stop.
The job execution must be running.NoSuchJobExecutionException
- Thrown when the executionId parameter
value doesn't correspond to an execution recognized by the
implementation's repository.JobExecutionNotRunningException
- Thrown when the associated
execution is not running (is not already STARTED or STARTING).JobSecurityException
- Thrown when the implementation determines
that execution of this method with these parameters is not authorized
(by some implementation-specific mechanism).void abandon(long executionId) throws NoSuchJobExecutionException, JobExecutionIsRunningException, JobSecurityException
Set batch status to ABANDONED. The instance must have no running execution.
Note that ABANDONED executions cannot be restarted.executionId
- specifies the job execution to abandon.NoSuchJobExecutionException
- Thrown when the executionId parameter
value doesn't correspond to an execution recognized by the
implementation's repository.JobExecutionIsRunningException
- Thrown when the job execution
associated with executionId is currently runningJobSecurityException
- Thrown when the implementation determines
that execution of this method with these parameters is not authorized
(by some implementation-specific mechanism).JobInstance getJobInstance(long executionId) throws NoSuchJobExecutionException, JobSecurityException
executionId
- specifies the job execution.NoSuchJobExecutionException
- Thrown when the executionId parameter
value doesn't correspond to an execution recognized by the
implementation's repository.JobSecurityException
- Thrown when the implementation determines
that execution of this method with these parameters is not authorized
(by some implementation-specific mechanism).java.util.List<JobExecution> getJobExecutions(JobInstance instance) throws NoSuchJobInstanceException, JobSecurityException
instance
- specifies the job instance.NoSuchJobInstanceException
- Thrown when the instance parameter
value doesn't correspond to a job instance recognized by the
implementation's repository.JobSecurityException
- Thrown when the implementation determines
that execution of this method with these parameters is not authorized
(by some implementation-specific mechanism).JobExecution getJobExecution(long executionId) throws NoSuchJobExecutionException, JobSecurityException
executionId
- specifies the job execution.NoSuchJobExecutionException
- Thrown when the executionId parameter
value doesn't correspond to an execution recognized by the
implementation's repository.JobSecurityException
- Thrown when the implementation determines
that execution of this method with these parameters is not authorized
(by some implementation-specific mechanism).java.util.List<StepExecution> getStepExecutions(long jobExecutionId) throws NoSuchJobExecutionException, JobSecurityException
jobExecutionId
- specifies the job execution.NoSuchJobExecutionException
- Thrown when the jobExecutionId parameter
value doesn't correspond to an execution recognized by the
implementation's repository.JobSecurityException
- Thrown when the implementation determines
that execution of this method with these parameters is not authorized
(by some implementation-specific mechanism).