public class SchedulerServiceImpl extends java.lang.Object implements SchedulerService
JOB_DESCRIPTOR, JOB_FAILED, JOB_PARAMETER, SCHEDULER_STARTED, SCHEDULER_STOPPED| Constructor and Description |
|---|
SchedulerServiceImpl(SchedulerExecutor schedulerExecutor,
JobService jobService,
TechnicalLoggerService logger,
EventService eventService,
TransactionService transactionService,
SessionAccessor sessionAccessor,
ServicesResolver servicesResolver,
PersistenceService persistenceService)
Create a new instance of scheduler service.
|
| 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)
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
|
void |
initializeScheduler()
Initialize the scheduler if this method has not be previously called (after shutdown); otherwise, do nothing.
|
boolean |
isExistingJob(java.lang.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 |
pause()
Temporary halt the execution of this service.
|
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 |
resume()
resume the execution the service
|
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.
|
public SchedulerServiceImpl(SchedulerExecutor schedulerExecutor, JobService jobService, TechnicalLoggerService logger, EventService eventService, TransactionService transactionService, SessionAccessor sessionAccessor, ServicesResolver servicesResolver, PersistenceService persistenceService)
public void schedule(SJobDescriptor jobDescriptor, Trigger trigger) throws SSchedulerException
SchedulerServiceschedule in interface SchedulerServiceSSchedulerException - if an exception occurs.public void schedule(SJobDescriptor jobDescriptor, java.util.List<SJobParameter> parameters, Trigger trigger) throws SSchedulerException
SchedulerServiceschedule in interface SchedulerServiceSSchedulerException - if an exception occurs.public void executeAgain(long jobDescriptorId)
throws SSchedulerException
SchedulerServiceexecuteAgain in interface SchedulerServicejobDescriptorId - the job to re executeSSchedulerExceptionpublic void retryJobThatFailed(long jobDescriptorId)
throws SSchedulerException
SchedulerServiceretryJobThatFailed in interface SchedulerServicejobDescriptorId - the job to retrySSchedulerExceptionpublic void retryJobThatFailed(long jobDescriptorId,
java.util.List<SJobParameter> parameters)
throws SSchedulerException
SchedulerServiceretryJobThatFailed in interface SchedulerServicejobDescriptorId - the job to retryparameters - the new parameters for the jobSSchedulerExceptionpublic boolean isStarted()
throws SSchedulerException
SchedulerServiceisStarted in interface SchedulerServiceSSchedulerException - if an exception occurs.public boolean isStopped()
throws SSchedulerException
SchedulerServiceisStopped in interface SchedulerServiceSSchedulerExceptionpublic void start()
throws SSchedulerException,
SFireEventException
SchedulerServicestart in interface LifecycleServicestart in interface SchedulerServiceSSchedulerExceptionSFireEventException#initializeScheduler()}public void stop()
throws SSchedulerException,
SFireEventException
SchedulerServicestop in interface LifecycleServicestop in interface SchedulerServiceSSchedulerExceptionSFireEventException#initializeScheduler()}public void pauseJobs(long tenantId)
throws SSchedulerException
SchedulerServicepauseJobs in interface SchedulerServiceSSchedulerExceptionpublic void resumeJobs(long tenantId)
throws SSchedulerException
SchedulerServiceresumeJobs in interface SchedulerServiceSSchedulerExceptionpublic boolean delete(java.lang.String jobName)
throws SSchedulerException
SchedulerServicedelete in interface SchedulerServicejobName - the job nameSSchedulerException - if an exception occurs.public void deleteJobs()
throws SSchedulerException
SchedulerServicedeleteJobs in interface SchedulerServiceSSchedulerException - if an exception occurs.public java.util.List<java.lang.String> getJobs()
throws SSchedulerException
SchedulerServicegetJobs in interface SchedulerServiceSSchedulerException - if an exception occurs.public java.util.List<java.lang.String> getAllJobs()
throws SSchedulerException
SchedulerServicegetAllJobs in interface SchedulerServiceSSchedulerException - if an exception occurs.public boolean isStillScheduled(SJobDescriptor jobDescriptor) throws SSchedulerException
isStillScheduled in interface SchedulerServiceSSchedulerExceptionpublic void pause()
throws SBonitaException
LifecycleServicepause in interface LifecycleServiceSBonitaExceptionpublic void resume()
throws SBonitaException
LifecycleServiceresume in interface LifecycleServiceSBonitaExceptionpublic void rescheduleErroneousTriggers()
throws SSchedulerException
rescheduleErroneousTriggers in interface SchedulerServiceSSchedulerExceptionpublic java.util.Date rescheduleJob(java.lang.String triggerName,
java.lang.String groupName,
java.util.Date triggerStartTime)
throws SSchedulerException
SchedulerServiceTrigger 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.rescheduleJob in interface SchedulerServicetriggerName - 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.SSchedulerExceptionpublic void initializeScheduler()
throws SSchedulerException
SchedulerServiceinitializeScheduler in interface SchedulerServiceSSchedulerExceptionpublic boolean isExistingJob(java.lang.String jobName)
throws SSchedulerException
SchedulerServiceisExistingJob in interface SchedulerServicejobName - The name of the jobSSchedulerException