public interface SchedulerService
extends org.bonitasoft.engine.commons.PlatformLifecycleService
| Modifier and Type | Field and Description |
|---|---|
static String |
JOB_DESCRIPTOR |
static String |
JOB_FAILED |
static String |
JOB_PARAMETER |
static String |
SCHEDULER_STARTED
This service will fire the following events :
SCHEDULER_STARTED = "SCHEDULER_STARTED"
SCHEDULER_STOPPED = "SCHEDULER_STOPPED"
JOB_FAILED = "JOB_FAILED"
|
static String |
SCHEDULER_STOPPED |
| Modifier and Type | Method and Description |
|---|---|
void |
addJobListener(List<AbstractBonitaPlatformJobListener> jobListeners)
Add the given
to the Scheduler, and register it to receive events for all Jobs. |
void |
addJobListener(List<AbstractBonitaTenantJobListener> jobListeners,
String groupName)
Add the given
to the Scheduler,
and register it to receive events for Jobs that are matched by the group name. |
boolean |
delete(String jobName)
Deletes a job according to its name.
|
void |
deleteJobs()
Deletes all jobs.
|
void |
executeAgain(long jobDescriptorId) |
void |
executeAgain(long jobDescriptorId,
List<SJobParameter> parameters)
Schedules a job.
|
void |
executeNow(SJobDescriptor jobDescriptor,
List<SJobParameter> parameters)
execute a job.
|
List<String> |
getAllJobs()
Get all jobs on all tenants
\/!\Must be replaced by a platform scheduler/!\
|
List<String> |
getJobs()
Get all jobs on the current tenant
|
void |
initializeScheduler()
Initialize the scheduler if this method has not be previously called (after shutdown); otherwise, do nothing.
|
boolean |
isExistingJob(String jobName)
Check if a job exists.
|
boolean |
isStarted()
Checks whether the service is started.
|
boolean |
isStillScheduled(SJobDescriptor jobDescriptor) |
boolean |
isStopped()
Checks whether the service is shutdown.
|
void |
pauseJobs(long tenantId)
Pause all jobs running on the tenant
|
void |
rescheduleErroneousTriggers() |
Date |
rescheduleJob(String triggerName,
String groupName,
Date triggerStartTime)
Remove (delete) the
Trigger with 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 & group specified)
- however, the new trigger need not have the same name as the old trigger. |
void |
resumeJobs(long tenantId)
Resume all jobs paused on the tenant
|
void |
schedule(SJobDescriptor jobDescriptor,
List<SJobParameter> parameters,
Trigger trigger)
Schedules a job.
|
void |
schedule(SJobDescriptor jobDescriptor,
Trigger trigger)
Schedules a job.
|
void |
start()
Note that once a scheduler is shutdown, it cannot be restarted without being re-instantiated.
|
void |
stop()
Note that once a scheduler is shutdown, it cannot be restarted without being re-instantiated.
|
static final String JOB_DESCRIPTOR
static final String JOB_PARAMETER
static final String SCHEDULER_STARTED
static final String SCHEDULER_STOPPED
static final String JOB_FAILED
boolean isStarted()
throws SSchedulerException
SSchedulerException - if an exception occurs.boolean isStopped()
throws SSchedulerException
SSchedulerExceptionvoid schedule(SJobDescriptor jobDescriptor, Trigger trigger) throws SSchedulerException
jobDescriptor - trigger - SSchedulerException - if an exception occurs.void schedule(SJobDescriptor jobDescriptor, List<SJobParameter> parameters, Trigger trigger) throws SSchedulerException
jobDescriptor - jobParameters - trigger - SSchedulerException - if an exception occurs.void executeAgain(long jobDescriptorId)
throws SSchedulerException
SSchedulerExceptionvoid executeAgain(long jobDescriptorId,
List<SJobParameter> parameters)
throws SSchedulerException
jobDescriptorId - jobParameters - SSchedulerException - if an exception occurs.void executeNow(SJobDescriptor jobDescriptor, List<SJobParameter> parameters) throws SSchedulerException
jobDescriptor - jobParameters - SSchedulerException - if an exception occurs.boolean delete(String jobName) throws SSchedulerException
jobName - the job nameSSchedulerException - if an exception occurs.void deleteJobs()
throws SSchedulerException
SSchedulerException - if an exception occurs.List<String> getJobs() throws SSchedulerException
SSchedulerException - if an exception occurs.List<String> getAllJobs() throws SSchedulerException
SSchedulerException - if an exception occurs.boolean isStillScheduled(SJobDescriptor jobDescriptor) throws SSchedulerException
SSchedulerExceptionvoid rescheduleErroneousTriggers()
throws SSchedulerException
SSchedulerExceptionvoid pauseJobs(long tenantId)
throws SSchedulerException
tenantId - SSchedulerExceptionvoid resumeJobs(long tenantId)
throws SSchedulerException
tenantId - SSchedulerExceptionDate rescheduleJob(String triggerName, String groupName, Date triggerStartTime) throws SSchedulerException
Trigger with 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 & group specified)
- however, the new trigger need not have the same name as the old trigger.triggerName - The name of the trigger to replacegroupName - The group name of the trigger to replacetriggerStartTime - The start date of the new triggernull if a Trigger with the given
name & group 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.SSchedulerExceptionvoid addJobListener(List<AbstractBonitaTenantJobListener> jobListeners, String groupName) throws SSchedulerException
AbstractBonitaTenantJobListeners to the Scheduler,
and register it to receive events for Jobs that are matched by the group name.jobListeners - The job listeners to add to the schedulergroupName - The group name to filterSSchedulerExceptionvoid addJobListener(List<AbstractBonitaPlatformJobListener> jobListeners) throws SSchedulerException
AbstractBonitaPlatformJobListeners to the Scheduler, and register it to receive events for all Jobs.jobListeners - The job listeners to add to the schedulerSSchedulerExceptionvoid initializeScheduler()
throws SSchedulerException
SSchedulerExceptionvoid start()
throws org.bonitasoft.engine.commons.exceptions.SBonitaException
start in interface org.bonitasoft.engine.commons.LifecycleServiceSSchedulerExceptionorg.bonitasoft.engine.commons.exceptions.SBonitaException#initializeScheduler()}void stop() throws org.bonitasoft.engine.commons.exceptions.SBonitaException
stop in interface org.bonitasoft.engine.commons.LifecycleServiceSSchedulerExceptionorg.bonitasoft.engine.commons.exceptions.SBonitaException#initializeScheduler()}boolean isExistingJob(String jobName) throws SSchedulerException
jobName - The name of the jobSSchedulerExceptionCopyright © 2018 Bonitasoft S.A.. All rights reserved.