接口 JobInstanceDao
- 所有已知实现类:
JdbcJobInstanceDao
,MapJobInstanceDao
public interface JobInstanceDao
Data Access Object for job instances.- 作者:
- Lucas Ward, Robert Kasanicky, Michael Minella, Mahmoud Ben Hassine
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 JobInstance
createJobInstance(java.lang.String jobName, JobParameters jobParameters)
Create a JobInstance with given name and parameters.java.util.List<JobInstance>
findJobInstancesByName(java.lang.String jobName, int start, int count)
Fetch the last job instances with the provided name, sorted backwards by primary key, using a 'like' criteriaJobInstance
getJobInstance(java.lang.Long instanceId)
Fetch the job instance with the provided identifier.JobInstance
getJobInstance(java.lang.String jobName, JobParameters jobParameters)
Find the job instance that matches the given name and parameters.JobInstance
getJobInstance(JobExecution jobExecution)
Fetch the JobInstance for the provided JobExecution.int
getJobInstanceCount(java.lang.String jobName)
Query the repository for the number of uniqueJobInstance
s associated with the supplied job name.java.util.List<JobInstance>
getJobInstances(java.lang.String jobName, int start, int count)
Fetch the last job instances with the provided name, sorted backwards by primary key.java.util.List<java.lang.String>
getJobNames()
Retrieve the names of all job instances sorted alphabetically - i.e. jobs that have ever been executed.
方法详细资料
createJobInstance
JobInstance createJobInstance(java.lang.String jobName, JobParameters jobParameters)
Create a JobInstance with given name and parameters. PreConditions: JobInstance for given name and parameters must not already exist PostConditions: A valid job instance will be returned which has been persisted and contains an unique Id.- 参数:
jobName
-String
containing the name of the job.jobParameters
-JobParameters
containing the parameters for the JobInstance.- 返回:
- JobInstance
JobInstance
instance that was created.
getJobInstance
@Nullable JobInstance getJobInstance(java.lang.String jobName, JobParameters jobParameters)
Find the job instance that matches the given name and parameters. If no matching job instances are found, then returns null.- 参数:
jobName
- the name of the jobjobParameters
- the parameters with which the job was executed- 返回:
JobInstance
object matching the job name andJobParameters
ornull
getJobInstance
@Nullable JobInstance getJobInstance(@Nullable java.lang.Long instanceId)
Fetch the job instance with the provided identifier.- 参数:
instanceId
- the job identifier- 返回:
- the job instance with this identifier or
null
if it doesn't exist
getJobInstance
@Nullable JobInstance getJobInstance(JobExecution jobExecution)
Fetch the JobInstance for the provided JobExecution.- 参数:
jobExecution
- the JobExecution- 返回:
- the JobInstance for the provided execution or
null
if it doesn't exist.
getJobInstances
java.util.List<JobInstance> getJobInstances(java.lang.String jobName, int start, int count)
Fetch the last job instances with the provided name, sorted backwards by primary key. if using the JdbcJobInstance, you can provide the jobName with a wildcard (e.g. *Job) to return 'like' job names. (e.g. *Job will return 'someJob' and 'otherJob')- 参数:
jobName
- the job namestart
- the start index of the instances to returncount
- the maximum number of objects to return- 返回:
- the job instances with this name or empty if none
getJobNames
java.util.List<java.lang.String> getJobNames()
Retrieve the names of all job instances sorted alphabetically - i.e. jobs that have ever been executed.- 返回:
- the names of all job instances
findJobInstancesByName
java.util.List<JobInstance> findJobInstancesByName(java.lang.String jobName, int start, int count)
Fetch the last job instances with the provided name, sorted backwards by primary key, using a 'like' criteria- 参数:
jobName
-String
containing the name of the job.start
- int containing the offset of where list of job instances results should begin.count
- int containing the number of job instances to return.- 返回:
- a list of
JobInstance
for the job name requested.
getJobInstanceCount
int getJobInstanceCount(@Nullable java.lang.String jobName) throws NoSuchJobException
Query the repository for the number of uniqueJobInstance
s associated with the supplied job name.- 参数:
jobName
- the name of the job to query for- 返回:
- the number of
JobInstance
s that exist within the associated job repository - 抛出:
NoSuchJobException
- thrown if no Job has the jobName specified.