org.kuali.kfs.sys.batch.service
Interface SchedulerService

All Known Implementing Classes:
SchedulerServiceImpl

public interface SchedulerService


Field Summary
static String CANCELLED_JOB_STATUS_CODE
           
static String FAILED_JOB_STATUS_CODE
           
static String PENDING_JOB_STATUS_CODE
           
static String RUNNING_JOB_STATUS_CODE
           
static String SCHEDULED_GROUP
           
static String SCHEDULED_JOB_STATUS_CODE
           
static String SUCCEEDED_JOB_STATUS_CODE
           
static String UNSCHEDULED_GROUP
           
 
Method Summary
 void addScheduled(org.quartz.JobDetail job)
          Adds the given job to the "scheduled" group.
 void addUnscheduled(org.quartz.JobDetail job)
          Adds the given job to the "unscheduled" group.
 BatchJobStatus getJob(String groupName, String jobName)
          Gets a single job based on its name and group.
 List<BatchJobStatus> getJobs()
          Get all jobs known to the scheduler wrapped within a BusinessObject-derived class.
 List<BatchJobStatus> getJobs(String groupName)
           
 List<String> getJobStatuses()
          Returns a list of all possible statuses.
 Date getNextStartTime(BatchJobStatus job)
          Returns the next start time for the given job.
 Date getNextStartTime(String groupName, String jobName)
          Returns the next start time for the given job.
 List<org.quartz.JobExecutionContext> getRunningJobs()
          Returns the list of job currently running within the scheduler.
 List<String> getSchedulerGroups()
          Returns a list of all groups defined in the scheduler.
 String getStatus(org.quartz.JobDetail jobDetail)
           
 boolean hasIncompleteJob()
          This method checks whether any jobs in the SCHEDULED job group are pending or currently scheduled.
 void initialize()
           
 void initializeJob(String jobName, Job job)
           
 void interruptJob(String jobName)
          Requests that the given job be stopped as soon as possble.
 boolean isJobRunning(String jobName)
          Tests whether the referenced job name is running, regardless of group.
 boolean isPastScheduleCutoffTime()
          This method should be used to determine when the daily batch schedule should terminate.
 void logScheduleResults()
           
 void processWaitingJobs()
           
 void reinitializeScheduledJobs()
           
 void removeScheduled(String jobName)
          Removes a job from the scheduled group.
 void runJob(String jobName, int startStep, int stopStep, Date startTime, String requestorEmailAddress)
          Immediately runs the specified job.
 void runJob(String jobName, String requestorEmailAddress)
          Immediately runs the specified job.
 void setScheduler(org.quartz.Scheduler scheduler)
           
 boolean shouldNotRun(org.quartz.JobDetail jobDetail)
           
 void updateStatus(org.quartz.JobDetail jobDetail, String jobStatus)
           
 

Field Detail

PENDING_JOB_STATUS_CODE

static final String PENDING_JOB_STATUS_CODE
See Also:
Constant Field Values

SCHEDULED_JOB_STATUS_CODE

static final String SCHEDULED_JOB_STATUS_CODE
See Also:
Constant Field Values

RUNNING_JOB_STATUS_CODE

static final String RUNNING_JOB_STATUS_CODE
See Also:
Constant Field Values

SUCCEEDED_JOB_STATUS_CODE

static final String SUCCEEDED_JOB_STATUS_CODE
See Also:
Constant Field Values

FAILED_JOB_STATUS_CODE

static final String FAILED_JOB_STATUS_CODE
See Also:
Constant Field Values

CANCELLED_JOB_STATUS_CODE

static final String CANCELLED_JOB_STATUS_CODE
See Also:
Constant Field Values

SCHEDULED_GROUP

static final String SCHEDULED_GROUP
See Also:
Constant Field Values

UNSCHEDULED_GROUP

static final String UNSCHEDULED_GROUP
See Also:
Constant Field Values
Method Detail

initialize

void initialize()

initializeJob

void initializeJob(String jobName,
                   Job job)

hasIncompleteJob

boolean hasIncompleteJob()
This method checks whether any jobs in the SCHEDULED job group are pending or currently scheduled.

Returns:
hasIncompleteJob

isPastScheduleCutoffTime

boolean isPastScheduleCutoffTime()
This method should be used to determine when the daily batch schedule should terminate. It compares the start time of the schedule job from quartz with a time specified by the scheduleStep_CUTOFF_TIME system parameter in the SYSTEM security group on the day after the schedule job started running.

Returns:
pastScheduleCutoffTime

processWaitingJobs

void processWaitingJobs()

logScheduleResults

void logScheduleResults()

shouldNotRun

boolean shouldNotRun(org.quartz.JobDetail jobDetail)

getStatus

String getStatus(org.quartz.JobDetail jobDetail)

updateStatus

void updateStatus(org.quartz.JobDetail jobDetail,
                  String jobStatus)

setScheduler

void setScheduler(org.quartz.Scheduler scheduler)

getJobs

List<BatchJobStatus> getJobs(String groupName)

getJobs

List<BatchJobStatus> getJobs()
Get all jobs known to the scheduler wrapped within a BusinessObject-derived class.

Returns:

getJob

BatchJobStatus getJob(String groupName,
                      String jobName)
Gets a single job based on its name and group.

Parameters:
groupName -
jobName -
Returns:

runJob

void runJob(String jobName,
            int startStep,
            int stopStep,
            Date startTime,
            String requestorEmailAddress)
Immediately runs the specified job.

Parameters:
jobName -
startStep -
stopStep -
requestorEmailAddress -

runJob

void runJob(String jobName,
            String requestorEmailAddress)
Immediately runs the specified job.

Parameters:
jobName -
requestorEmailAddress -

getRunningJobs

List<org.quartz.JobExecutionContext> getRunningJobs()
Returns the list of job currently running within the scheduler.

Returns:

removeScheduled

void removeScheduled(String jobName)
Removes a job from the scheduled group.

Parameters:
jobName -

addScheduled

void addScheduled(org.quartz.JobDetail job)
Adds the given job to the "scheduled" group.

Parameters:
job -

addUnscheduled

void addUnscheduled(org.quartz.JobDetail job)
Adds the given job to the "unscheduled" group.

Parameters:
job -

getSchedulerGroups

List<String> getSchedulerGroups()
Returns a list of all groups defined in the scheduler.

Returns:

getJobStatuses

List<String> getJobStatuses()
Returns a list of all possible statuses.

Returns:

interruptJob

void interruptJob(String jobName)
Requests that the given job be stopped as soon as possble. It is up to the job to watch for this request and terminiate. Long running steps may not end unless they check for the interrupted status on their current Thread ot Step instance.

Parameters:
jobName -

isJobRunning

boolean isJobRunning(String jobName)
Tests whether the referenced job name is running, regardless of group.

Parameters:
jobName -
Returns:

getNextStartTime

Date getNextStartTime(BatchJobStatus job)
Returns the next start time for the given job.

Parameters:
job -
Returns:

getNextStartTime

Date getNextStartTime(String groupName,
                      String jobName)
Returns the next start time for the given job.

Parameters:
groupName -
jobName -
Returns:

reinitializeScheduledJobs

void reinitializeScheduledJobs()


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.