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
SchedulerService
schedule
in interface SchedulerService
SSchedulerException
- if an exception occurs.public void schedule(SJobDescriptor jobDescriptor, java.util.List<SJobParameter> parameters, Trigger trigger) throws SSchedulerException
SchedulerService
schedule
in interface SchedulerService
SSchedulerException
- if an exception occurs.public void executeAgain(long jobDescriptorId) throws SSchedulerException
SchedulerService
executeAgain
in interface SchedulerService
jobDescriptorId
- the job to re executeSSchedulerException
public void retryJobThatFailed(long jobDescriptorId) throws SSchedulerException
SchedulerService
retryJobThatFailed
in interface SchedulerService
jobDescriptorId
- the job to retrySSchedulerException
public void retryJobThatFailed(long jobDescriptorId, java.util.List<SJobParameter> parameters) throws SSchedulerException
SchedulerService
retryJobThatFailed
in interface SchedulerService
jobDescriptorId
- the job to retryparameters
- the new parameters for the jobSSchedulerException
public boolean isStarted() throws SSchedulerException
SchedulerService
isStarted
in interface SchedulerService
SSchedulerException
- if an exception occurs.public boolean isStopped() throws SSchedulerException
SchedulerService
isStopped
in interface SchedulerService
SSchedulerException
public void start() throws SSchedulerException, SFireEventException
SchedulerService
start
in interface LifecycleService
start
in interface SchedulerService
SSchedulerException
SFireEventException
#initializeScheduler()}
public void stop() throws SSchedulerException, SFireEventException
SchedulerService
stop
in interface LifecycleService
stop
in interface SchedulerService
SSchedulerException
SFireEventException
#initializeScheduler()}
public void pauseJobs(long tenantId) throws SSchedulerException
SchedulerService
pauseJobs
in interface SchedulerService
SSchedulerException
public void resumeJobs(long tenantId) throws SSchedulerException
SchedulerService
resumeJobs
in interface SchedulerService
SSchedulerException
public boolean delete(java.lang.String jobName) throws SSchedulerException
SchedulerService
delete
in interface SchedulerService
jobName
- the job nameSSchedulerException
- if an exception occurs.public void deleteJobs() throws SSchedulerException
SchedulerService
deleteJobs
in interface SchedulerService
SSchedulerException
- if an exception occurs.public java.util.List<java.lang.String> getJobs() throws SSchedulerException
SchedulerService
getJobs
in interface SchedulerService
SSchedulerException
- if an exception occurs.public java.util.List<java.lang.String> getAllJobs() throws SSchedulerException
SchedulerService
getAllJobs
in interface SchedulerService
SSchedulerException
- if an exception occurs.public boolean isStillScheduled(SJobDescriptor jobDescriptor) throws SSchedulerException
isStillScheduled
in interface SchedulerService
SSchedulerException
public void pause() throws SBonitaException
LifecycleService
pause
in interface LifecycleService
SBonitaException
public void resume() throws SBonitaException
LifecycleService
resume
in interface LifecycleService
SBonitaException
public void rescheduleErroneousTriggers() throws SSchedulerException
rescheduleErroneousTriggers
in interface SchedulerService
SSchedulerException
public java.util.Date rescheduleJob(java.lang.String triggerName, java.lang.String groupName, java.util.Date triggerStartTime) throws SSchedulerException
SchedulerService
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.rescheduleJob
in interface SchedulerService
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.SSchedulerException
public void initializeScheduler() throws SSchedulerException
SchedulerService
initializeScheduler
in interface SchedulerService
SSchedulerException
public boolean isExistingJob(java.lang.String jobName) throws SSchedulerException
SchedulerService
isExistingJob
in interface SchedulerService
jobName
- The name of the jobSSchedulerException