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.
|
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(String jobName)
Returns number of instances of a job with a particular name.
|
List<JobInstance> |
getJobInstances(String jobName,
int start,
int count)
Returns all JobInstances belonging to a job with a particular name
in reverse chronological order.
|
Set<String> |
getJobNames()
Returns a set of all job names known to the batch runtime.
|
Properties |
getParameters(long executionId)
Returns job parameters for a specified job instance.
|
List<Long> |
getRunningExecutions(String jobName)
Returns execution ids for job instances with the specified
name that have running executions.
|
List<StepExecution> |
getStepExecutions(long jobExecutionId)
Return StepExecutions for specified execution id.
|
long |
restart(long executionId,
Properties restartParameters)
Restarts a failed or stopped job instance, which executes asynchronously.
|
long |
start(String jobXMLName,
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.
|
Set<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(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).List<JobInstance> getJobInstances(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).List<Long> getRunningExecutions(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).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(String jobXMLName, 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, 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).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).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).Copyright © 2018,2020 Eclipse Foundation.
Use is subject to license terms.