public interface JobStore
The interface to be implemented by classes that want to provide a and
Job storage mechanism for the Trigger's use.
QuartzScheduler
Storage of Job s and Trigger s should be keyed on the combination of their name and group for uniqueness.
| Modifier and Type | Method and Description |
|---|---|
List<OperableTrigger> |
acquireNextTriggers(long noLaterThan,
int maxCount,
long timeWindow)
Get a handle to the next trigger to be fired, and mark it as 'reserved' by the calling scheduler.
|
Set<String> |
getJobKeys()
Get the keys of all of the
s |
List<Trigger> |
getTriggersForJob(String jobKey)
Get all of the Triggers that are associated to the given Job.
|
void |
initialize(SchedulerSignaler signaler)
Called by the QuartzScheduler before the
JobStore is used, in order to give the it a chance to initialize. |
void |
releaseAcquiredTrigger(OperableTrigger trigger)
Inform the
JobStore that the scheduler no longer plans to fire the given Trigger, that it had previously acquired
(reserved). |
boolean |
removeJob(String jobKey)
|
boolean |
removeTrigger(String triggerKey)
Remove (delete) the
with the given key. |
boolean |
replaceTrigger(String triggerKey,
OperableTrigger newTrigger)
Remove (delete) the
with the given key, and store the new given one - which must be associated
with the same job. |
Calendar |
retrieveCalendar(String calName)
Retrieve the given
. |
JobDetail |
retrieveJob(String jobKey)
|
OperableTrigger |
retrieveTrigger(String triggerKey)
Retrieve the given
. |
void |
schedulerStarted()
Called by the QuartzScheduler to inform the
JobStore that the scheduler has started. |
void |
setThreadPoolSize(int poolSize)
Tells the JobStore the pool size used to execute jobs
|
void |
storeJob(JobDetail newJob,
boolean replaceExisting)
Store the given
. |
void |
storeJobAndTrigger(JobDetail newJob,
OperableTrigger newTrigger)
|
void |
storeTrigger(OperableTrigger newTrigger,
boolean replaceExisting)
Store the given
. |
void |
triggeredJobComplete(OperableTrigger trigger,
JobDetail jobDetail,
Trigger.CompletedExecutionInstruction triggerInstCode)
Inform the
JobStore that the scheduler has completed the firing of the given Trigger (and the execution of its
associated Job completed, threw an exception, or was vetoed), and that the in the
given JobDetail should be updated if the Job is stateful. |
List<TriggerFiredResult> |
triggersFired(List<OperableTrigger> triggers)
Inform the
JobStore that the scheduler is now firing the given Trigger (executing its associated Job),
that it had previously acquired (reserved). |
void initialize(SchedulerSignaler signaler) throws SchedulerConfigException
JobStore is used, in order to give the it a chance to initialize.SchedulerConfigExceptionvoid schedulerStarted()
throws SchedulerException
JobStore that the scheduler has started.SchedulerExceptionvoid storeJobAndTrigger(JobDetail newJob, OperableTrigger newTrigger) throws ObjectAlreadyExistsException, JobPersistenceException
newJob - The JobDetail to be stored.newTrigger - The Trigger to be stored.ObjectAlreadyExistsException - if a Job with the same name/group already exists.JobPersistenceExceptionvoid storeJob(JobDetail newJob, boolean replaceExisting) throws ObjectAlreadyExistsException, JobPersistenceException
JobDetail.newJob - The JobDetail to be stored.replaceExisting - If true, any Job existing in the JobStore with the same name should be
over-written.ObjectAlreadyExistsException - if a Job with the same name/group already exists, and replaceExisting is set to false.JobPersistenceExceptionboolean removeJob(String jobKey) throws JobPersistenceException
Job with the given key, and any Trigger s that
reference it.
If removal of the Job results in an empty group, the group should be removed from the JobStore's list of known group
names.
true if a Job with the given name & group was found and removed from the store.JobPersistenceExceptionJobDetail retrieveJob(String jobKey) throws JobPersistenceException
Job, or null if there is no match.JobPersistenceExceptionvoid storeTrigger(OperableTrigger newTrigger, boolean replaceExisting) throws ObjectAlreadyExistsException, JobPersistenceException
Trigger.newTrigger - The Trigger to be stored.replaceExisting - If true, any Trigger existing in the JobStore with the same name & group should be
over-written.ObjectAlreadyExistsException - if a Trigger with the same name/group already exists, and replaceExisting is set to false.JobPersistenceException#pauseTriggers(org.quartz.impl.matchers.GroupMatcher)boolean removeTrigger(String triggerKey) throws JobPersistenceException
Trigger with the given key.
If removal of the Trigger results in an empty group, the group should be removed from the JobStore's list of known
group names.
If removal of the Trigger results in an 'orphaned' Job that is not 'durable', then the Job should be
deleted also.
true if a Trigger with the given name was found and removed from the store.JobPersistenceExceptionboolean replaceTrigger(String triggerKey, OperableTrigger newTrigger) throws JobPersistenceException
Trigger with the given key, and store the new given one - which must be associated
with the same job.newTrigger - The new Trigger to be stored.true if a Trigger with the given name was found and removed from the store.JobPersistenceExceptionOperableTrigger retrieveTrigger(String triggerKey) throws JobPersistenceException
Trigger.Trigger, or null if there is no match.JobPersistenceExceptionCalendar retrieveCalendar(String calName) throws JobPersistenceException
Trigger.calName - The name of the Calendar to be retrieved.Calendar, or null if there is no match.JobPersistenceExceptionList<Trigger> getTriggersForJob(String jobKey) throws JobPersistenceException
If there are no matches, a zero-length array should be returned.
JobPersistenceExceptionSet<String> getJobKeys() throws JobPersistenceException
Job s
If there are no jobs in the given group name, the result should be an empty collection (not null).
JobPersistenceExceptionList<OperableTrigger> acquireNextTriggers(long noLaterThan, int maxCount, long timeWindow) throws JobPersistenceException
noLaterThan - If > 0, the JobStore should only return a Trigger that will fire no later than the time represented in this value as
milliseconds.JobPersistenceException#releaseAcquiredTrigger(Trigger)void releaseAcquiredTrigger(OperableTrigger trigger) throws JobPersistenceException
JobStore that the scheduler no longer plans to fire the given Trigger, that it had previously acquired
(reserved).JobPersistenceExceptionList<TriggerFiredResult> triggersFired(List<OperableTrigger> triggers) throws JobPersistenceException
JobStore that the scheduler is now firing the given Trigger (executing its associated Job),
that it had previously acquired (reserved).JobPersistenceExceptionvoid triggeredJobComplete(OperableTrigger trigger, JobDetail jobDetail, Trigger.CompletedExecutionInstruction triggerInstCode) throws JobPersistenceException
JobStore that the scheduler has completed the firing of the given Trigger (and the execution of its
associated Job completed, threw an exception, or was vetoed), and that the JobDataMap in the
given JobDetail should be updated if the Job is stateful.JobPersistenceExceptionvoid setThreadPoolSize(int poolSize)
poolSize - amount of threads allocated for job executionCopyright © 2011–2017 Knowm Inc.. All rights reserved.