org.springframework.batch.core.repository.dao
Interface JobInstanceDao

All Known Implementing Classes:
JdbcJobInstanceDao, MapJobInstanceDao

public interface JobInstanceDao

Data Access Object for job instances.

Author:
Lucas Ward, Robert Kasanicky

Method Summary
 JobInstance createJobInstance(String jobName, JobParameters jobParameters)
          Create a JobInstance with given name and parameters.
 JobInstance getJobInstance(JobExecution jobExecution)
          Fetch the JobInstance for the provided JobExecution.
 JobInstance getJobInstance(Long instanceId)
          Fetch the job instance with the provided identifier.
 JobInstance getJobInstance(String jobName, JobParameters jobParameters)
          Find the job instance that matches the given name and parameters.
 List<JobInstance> getJobInstances(String jobName, int start, int count)
          Fetch the last job instances with the provided name, sorted backwards by primary key.
 List<String> getJobNames()
          Retrieve the names of all job instances sorted alphabetically - i.e. jobs that have ever been executed.
 

Method Detail

createJobInstance

JobInstance createJobInstance(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.

Parameters:
jobName -
jobParameters -
Returns:
JobInstance

getJobInstance

JobInstance getJobInstance(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.

Parameters:
jobName - the name of the job
jobParameters - the parameters with which the job was executed
Returns:
JobInstance object matching the job name and JobParameters or null

getJobInstance

JobInstance getJobInstance(Long instanceId)
Fetch the job instance with the provided identifier.

Parameters:
instanceId - the job identifier
Returns:
the job instance with this identifier or null if it doesn't exist

getJobInstance

JobInstance getJobInstance(JobExecution jobExecution)
Fetch the JobInstance for the provided JobExecution.

Parameters:
jobExecution - the JobExecution
Returns:
the JobInstance for the provided execution or null if it doesn't exist.

getJobInstances

List<JobInstance> getJobInstances(String jobName,
                                  int start,
                                  int count)
Fetch the last job instances with the provided name, sorted backwards by primary key.

Parameters:
jobName - the job name
start - the start index of the instances to return
count - the maximum number of objects to return
Returns:
the job instances with this name or empty if none

getJobNames

List<String> getJobNames()
Retrieve the names of all job instances sorted alphabetically - i.e. jobs that have ever been executed.

Returns:
the names of all job instances


Copyright © 2013 SpringSource. All Rights Reserved.