Package org.bonitasoft.engine.scheduler
Interface SchedulerService
- All Superinterfaces:
LifecycleService,PlatformLifecycleService
- All Known Implementing Classes:
SchedulerServiceImpl
- Since:
- 6.0
- Author:
- Matthieu Chaffotte
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanDeletes a job according to its name.voidDeletes all jobs.voidexecuteAgain(long jobDescriptorId, int delayInMillis) Execute a job againgetJobs()Get all jobsbooleanisExistingJob(String jobName) Check if a job exists.booleanChecks whether the service is started.booleanChecks whether the service is shutdown.booleanmayFireAgain(String jobName) voidPause all running jobsvoidrescheduleJob(String triggerName, Date triggerStartTime) Remove (delete) theTriggerwith the given key, and store the new given one - which must be associated with the same job (the new trigger must have the job name specified) - however, the new trigger need not have the same name as the old trigger.voidResume all paused jobsvoidretryJobThatFailed(long jobDescriptorId) Retry a job once In addition to executing the job again, this will also delete failed job logsvoidretryJobThatFailed(long jobDescriptorId, List<SJobParameter> parameters) Change parameters of a job and retry it once In addition to executing the job again, this will also delete failed job logsvoidschedule(SJobDescriptor jobDescriptor, List<SJobParameter> parameters, Trigger trigger) Schedules a job.voidschedule(SJobDescriptor jobDescriptor, Trigger trigger) Schedules a job.voidstart()Note that once a scheduler is shutdown, it cannot be restarted without being re-instantiated.voidstop()Note that once a scheduler is shutdown, it cannot be restarted without being re-instantiated.Methods inherited from interface org.bonitasoft.engine.commons.LifecycleService
pause, resume
-
Field Details
-
SCHEDULER_STARTED
This service will fire the following events :- SCHEDULER_STARTED = "SCHEDULER_STARTED"
- SCHEDULER_STOPPED = "SCHEDULER_STOPPED"
- JOB_FAILED = "JOB_FAILED"
- See Also:
-
SCHEDULER_STOPPED
- See Also:
-
JOB_FAILED
- See Also:
-
-
Method Details
-
isStarted
Checks whether the service is started.- Returns:
- true if the service is started; false otherwise.
- Throws:
SSchedulerException- if an exception occurs.
-
isStopped
Checks whether the service is shutdown.- Returns:
- true if the service is shutdown; false otherwise.
- Throws:
SSchedulerException
-
schedule
Schedules a job.- Parameters:
jobDescriptor-trigger-- Throws:
SSchedulerException- if an exception occurs.
-
schedule
void schedule(SJobDescriptor jobDescriptor, List<SJobParameter> parameters, Trigger trigger) throws SSchedulerException Schedules a job.- Parameters:
jobDescriptor-parameters-trigger-- Throws:
SSchedulerException- if an exception occurs.
-
executeAgain
Execute a job again- Parameters:
jobDescriptorId- the job to re executedelayInMillis-- Throws:
SSchedulerException
-
retryJobThatFailed
Retry a job once In addition to executing the job again, this will also delete failed job logs- Parameters:
jobDescriptorId- the job to retry- Throws:
SSchedulerException
-
retryJobThatFailed
void retryJobThatFailed(long jobDescriptorId, List<SJobParameter> parameters) throws SSchedulerException Change parameters of a job and retry it once In addition to executing the job again, this will also delete failed job logs- Parameters:
jobDescriptorId- the job to retryparameters- the new parameters for the job- Throws:
SSchedulerException
-
delete
Deletes a job according to its name.- Parameters:
jobName- the job name- Returns:
- true if delete a job, otherwise return false.
- Throws:
SSchedulerException- if an exception occurs.
-
deleteJobs
Deletes all jobs.- Throws:
SSchedulerException- if an exception occurs.
-
getJobs
Get all jobs- Returns:
- all jobs
- Throws:
SSchedulerException- if an exception occurs.
-
rescheduleErroneousTriggers
- Throws:
SSchedulerException
-
pauseJobs
Pause all running jobs- Throws:
SSchedulerException
-
resumeJobs
Resume all paused jobs- Throws:
SSchedulerException
-
rescheduleJob
Remove (delete) theTriggerwith the given key, and store the new given one - which must be associated with the same job (the new trigger must have the job name specified) - however, the new trigger need not have the same name as the old trigger.- Parameters:
triggerName- The name of the trigger to replacetriggerStartTime- The start date of the new trigger- Returns:
nullif aTriggerwith the given name was not found and removed from the store (and the new trigger is therefore not stored), otherwise the first fire time of the newly scheduled trigger is returned.- Throws:
SSchedulerException- Since:
- 6.4.0
-
start
Note that once a scheduler is shutdown, it cannot be restarted without being re-instantiated.- Specified by:
startin interfaceLifecycleService- Throws:
SSchedulerExceptionSBonitaException- Since:
- 6.4.0
-
stop
Note that once a scheduler is shutdown, it cannot be restarted without being re-instantiated.- Specified by:
stopin interfaceLifecycleService- Throws:
SSchedulerExceptionSBonitaException- Since:
- 6.4.0
-
isExistingJob
Check if a job exists.- Parameters:
jobName- The name of the job- Returns:
- True if the job exists, else False.
- Throws:
SSchedulerException- Since:
- 6.4.0
-
mayFireAgain
- Throws:
SSchedulerException
-