public interface SchedulerService extends PlatformLifecycleService
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
JOB_FAILED |
static java.lang.String |
SCHEDULER_STARTED
This service will fire the following events :
SCHEDULER_STARTED = "SCHEDULER_STARTED"
SCHEDULER_STOPPED = "SCHEDULER_STOPPED"
JOB_FAILED = "JOB_FAILED"
|
static java.lang.String |
SCHEDULER_STOPPED |
| Modifier and Type | Method and Description |
|---|---|
boolean |
delete(java.lang.String jobName)
Deletes a job according to its name.
|
void |
deleteJobs()
Deletes all jobs.
|
void |
executeAgain(long jobDescriptorId,
int delayInMillis)
Execute a job again
|
java.util.List<java.lang.String> |
getAllJobs()
Get all jobs on all tenants
\/!\Must be replaced by a platform scheduler/!\
|
java.util.List<java.lang.String> |
getJobs()
Get all jobs on the current tenant
|
boolean |
isExistingJob(java.lang.String jobName)
Check if a job exists.
|
boolean |
isStarted()
Checks whether the service is started.
|
boolean |
isStopped()
Checks whether the service is shutdown.
|
boolean |
mayFireAgain(java.lang.String groupName,
java.lang.String jobName) |
void |
pauseJobs(long tenantId)
Pause all jobs running on the tenant
|
void |
rescheduleErroneousTriggers() |
java.util.Date |
rescheduleJob(java.lang.String triggerName,
java.lang.String groupName,
java.util.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 |
retryJobThatFailed(long jobDescriptorId)
Retry a job once
In addition to executing the job again, this will also delete failed job logs
|
void |
retryJobThatFailed(long jobDescriptorId,
java.util.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 logs
|
void |
schedule(SJobDescriptor jobDescriptor,
java.util.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.
|
pause, resumestatic final java.lang.String SCHEDULER_STARTED
static final java.lang.String SCHEDULER_STOPPED
static final java.lang.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, java.util.List<SJobParameter> parameters, Trigger trigger) throws SSchedulerException
jobDescriptor - jobParameters - trigger - SSchedulerException - if an exception occurs.void executeAgain(long jobDescriptorId,
int delayInMillis)
throws SSchedulerException
jobDescriptorId - the job to re executedelayInMillis - SSchedulerExceptionvoid retryJobThatFailed(long jobDescriptorId)
throws SSchedulerException
jobDescriptorId - the job to retrySSchedulerExceptionvoid retryJobThatFailed(long jobDescriptorId,
java.util.List<SJobParameter> parameters)
throws SSchedulerException
jobDescriptorId - the job to retryparameters - the new parameters for the jobSSchedulerExceptionboolean delete(java.lang.String jobName)
throws SSchedulerException
jobName - the job nameSSchedulerException - if an exception occurs.void deleteJobs()
throws SSchedulerException
SSchedulerException - if an exception occurs.java.util.List<java.lang.String> getJobs()
throws SSchedulerException
SSchedulerException - if an exception occurs.java.util.List<java.lang.String> getAllJobs()
throws SSchedulerException
SSchedulerException - if an exception occurs.void rescheduleErroneousTriggers()
throws SSchedulerException
SSchedulerExceptionvoid pauseJobs(long tenantId)
throws SSchedulerException
tenantId - SSchedulerExceptionvoid resumeJobs(long tenantId)
throws SSchedulerException
tenantId - SSchedulerExceptionjava.util.Date rescheduleJob(java.lang.String triggerName,
java.lang.String groupName,
java.util.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 start()
throws SBonitaException
start in interface LifecycleServiceSSchedulerExceptionSBonitaExceptionvoid stop() throws SBonitaException
stop in interface LifecycleServiceSSchedulerExceptionSBonitaExceptionboolean isExistingJob(java.lang.String jobName)
throws SSchedulerException
jobName - The name of the jobSSchedulerExceptionboolean mayFireAgain(java.lang.String groupName,
java.lang.String jobName)
throws SSchedulerException
SSchedulerException