org.springframework.batch.core.explore.support
Class SimpleJobExplorer

java.lang.Object
  extended by org.springframework.batch.core.explore.support.SimpleJobExplorer
All Implemented Interfaces:
JobExplorer

public class SimpleJobExplorer
extends Object
implements JobExplorer

Implementation of JobExplorer using the injected DAOs.

Since:
2.0
Author:
Dave Syer, Lucas Ward
See Also:
JobExplorer, JobInstanceDao, JobExecutionDao, StepExecutionDao

Constructor Summary
SimpleJobExplorer(JobInstanceDao jobInstanceDao, JobExecutionDao jobExecutionDao, StepExecutionDao stepExecutionDao, ExecutionContextDao ecDao)
           
 
Method Summary
 Set<JobExecution> findRunningJobExecutions(String jobName)
           
 JobExecution getJobExecution(Long executionId)
          Retrieve a JobExecution by its id.
 List<JobExecution> getJobExecutions(JobInstance jobInstance)
           
 JobInstance getJobInstance(Long instanceId)
           
 List<JobInstance> getJobInstances(String jobName, int start, int count)
          Fetch JobInstance values in descending order of creation (and therefore usually of first execution).
 StepExecution getStepExecution(Long jobExecutionId, Long executionId)
          Retrieve a StepExecution by its id and parent JobExecution id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleJobExplorer

public SimpleJobExplorer(JobInstanceDao jobInstanceDao,
                         JobExecutionDao jobExecutionDao,
                         StepExecutionDao stepExecutionDao,
                         ExecutionContextDao ecDao)
Method Detail

getJobExecutions

public List<JobExecution> getJobExecutions(JobInstance jobInstance)
Specified by:
getJobExecutions in interface JobExplorer
Parameters:
jobInstance - the JobInstance to query
Returns:
the set of all executions for the specified JobInstance

findRunningJobExecutions

public Set<JobExecution> findRunningJobExecutions(String jobName)
Specified by:
findRunningJobExecutions in interface JobExplorer
Parameters:
jobName - the name of the job
Returns:
the set of running executions for jobs with the specified name

getJobExecution

public JobExecution getJobExecution(Long executionId)
Description copied from interface: JobExplorer
Retrieve a JobExecution by its id.

Specified by:
getJobExecution in interface JobExplorer
Parameters:
executionId - the job execution id
Returns:
the JobExecution with this id, or null if not found

getStepExecution

public StepExecution getStepExecution(Long jobExecutionId,
                                      Long executionId)
Description copied from interface: JobExplorer
Retrieve a StepExecution by its id and parent JobExecution id.

Specified by:
getStepExecution in interface JobExplorer
Parameters:
jobExecutionId - the parent job execution id
executionId - the step execution id
Returns:
the StepExecution with this id, or null if not found

getJobInstance

public JobInstance getJobInstance(Long instanceId)
Specified by:
getJobInstance in interface JobExplorer
Returns:
the JobInstance with this id, or null

getJobInstances

public List<JobInstance> getJobInstances(String jobName,
                                         int start,
                                         int count)
Description copied from interface: JobExplorer
Fetch JobInstance values in descending order of creation (and therefore usually of first execution).

Specified by:
getJobInstances in interface JobExplorer
Parameters:
jobName - the name of the job to query
start - the start index of the instances to return
count - the maximum number of instances to return
Returns:
the JobInstance values up to a maximum of count values


Copyright © 2009 SpringSource. All Rights Reserved.