public interface IJobStore
The interface to be implemented by classes that want to provide a
and
IJob storage mechanism for the
ITrigger's use.
QuartzScheduler
Storage of Job s and Trigger s should be keyed on
the combination of their name and group for uniqueness.
QuartzScheduler,
ITrigger,
IJob,
IJobDetail,
JobDataMap,
ICalendar| Modifier and Type | Method and Description |
|---|---|
com.helger.commons.collection.impl.ICommonsList<IOperableTrigger> |
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.
|
boolean |
checkExists(JobKey jobKey)
Determine whether a job with the given identifier already exists within the
scheduler.
|
boolean |
checkExists(TriggerKey triggerKey)
Determine whether a
ITrigger with the given identifier already
exists within the scheduler. |
void |
clearAllSchedulingData()
Clear (delete!)
|
com.helger.commons.collection.impl.ICommonsList<String> |
getCalendarNames()
Get the names of all of the
s in the
JobStore. |
long |
getEstimatedTimeToReleaseAndAcquireTrigger()
How long (in milliseconds) the
JobStore implementation
estimates that it will take to release a trigger and acquire a new one. |
com.helger.commons.collection.impl.ICommonsList<String> |
getJobGroupNames()
Get the names of all of the
groups. |
com.helger.commons.collection.impl.ICommonsSet<JobKey> |
getJobKeys(GroupMatcher<JobKey> matcher)
Get the keys of all of the
s
that have the given group name. |
int |
getNumberOfCalendars()
Get the number of
s that
are stored in the JobsStore. |
int |
getNumberOfJobs()
Get the number of
s that are
stored in the JobsStore. |
int |
getNumberOfTriggers()
Get the number of
s that
are stored in the JobsStore. |
com.helger.commons.collection.impl.ICommonsSet<String> |
getPausedTriggerGroups() |
com.helger.commons.collection.impl.ICommonsList<String> |
getTriggerGroupNames()
Get the names of all of the
groups. |
com.helger.commons.collection.impl.ICommonsSet<TriggerKey> |
getTriggerKeys(GroupMatcher<TriggerKey> matcher)
Get the names of all of the
s that have the given group name. |
com.helger.commons.collection.impl.ICommonsList<IOperableTrigger> |
getTriggersForJob(JobKey jobKey)
Get all of the Triggers that are associated to the given Job.
|
ITrigger.ETriggerState |
getTriggerState(TriggerKey triggerKey)
Get the current state of the identified
. |
void |
initialize(IClassLoadHelper loadHelper,
ISchedulerSignaler signaler)
Called by the QuartzScheduler before the
JobStore is used, in
order to give the it a chance to initialize. |
boolean |
isClustered()
Whether or not the
JobStore implementation is clustered. |
void |
pauseAll()
Pause all triggers - equivalent of calling
pauseTriggerGroup(group) on every group. |
void |
pauseJob(JobKey jobKey)
Pause the
with the given name -
by pausing all of its current Triggers. |
com.helger.commons.collection.impl.ICommonsCollection<String> |
pauseJobs(GroupMatcher<JobKey> groupMatcher)
Pause all of the
in the given
group - by pausing all of their Triggers. |
void |
pauseTrigger(TriggerKey triggerKey)
Pause the
with the given
key. |
com.helger.commons.collection.impl.ICommonsCollection<String> |
pauseTriggers(GroupMatcher<TriggerKey> matcher)
Pause all of the
in the
given group. |
void |
releaseAcquiredTrigger(IOperableTrigger trigger)
Inform the
JobStore that the scheduler no longer plans to fire
the given Trigger, that it had previously acquired (reserved). |
boolean |
removeCalendar(String calName)
Remove (delete) the
with
the given name. |
boolean |
removeJob(JobKey jobKey)
|
boolean |
removeJobs(List<JobKey> jobKeys) |
boolean |
removeTrigger(TriggerKey triggerKey)
Remove (delete) the
with
the given key. |
boolean |
removeTriggers(List<TriggerKey> triggerKeys) |
boolean |
replaceTrigger(TriggerKey triggerKey,
IOperableTrigger newTrigger)
Remove (delete) the
with
the given key, and store the new given one - which must be associated with
the same job. |
void |
resumeAll()
Resume (un-pause) all triggers - equivalent of calling
resumeTriggerGroup(group) on every group. |
void |
resumeJob(JobKey jobKey)
Resume (un-pause) the
with the
given key. |
com.helger.commons.collection.impl.ICommonsCollection<String> |
resumeJobs(GroupMatcher<JobKey> matcher)
Resume (un-pause) all of the
in the given group. |
void |
resumeTrigger(TriggerKey triggerKey)
Resume (un-pause) the
with
the given key. |
com.helger.commons.collection.impl.ICommonsCollection<String> |
resumeTriggers(GroupMatcher<TriggerKey> matcher)
Resume (un-pause) all of the
in the given group. |
ICalendar |
retrieveCalendar(String calName)
Retrieve the given
. |
IJobDetail |
retrieveJob(JobKey jobKey)
Retrieve the
for the
given . |
IOperableTrigger |
retrieveTrigger(TriggerKey triggerKey)
Retrieve the given
. |
void |
schedulerPaused()
Called by the QuartzScheduler to inform the
JobStore that the
scheduler has been paused. |
void |
schedulerResumed()
Called by the QuartzScheduler to inform the
JobStore that the
scheduler has resumed after being paused. |
void |
schedulerStarted()
Called by the QuartzScheduler to inform the
JobStore that the
scheduler has started. |
void |
setInstanceId(String schedInstId)
Inform the
JobStore of the Scheduler instance's Id, prior to
initialize being invoked. |
void |
setInstanceName(String schedName)
Inform the
JobStore of the Scheduler instance's name, prior to
initialize being invoked. |
void |
setThreadPoolSize(int poolSize)
Tells the JobStore the pool size used to execute jobs
|
void |
shutdown()
Called by the QuartzScheduler to inform the
JobStore that it
should free up all of it's resources because the scheduler is shutting
down. |
void |
storeCalendar(String name,
ICalendar calendar,
boolean replaceExisting,
boolean updateTriggers)
Store the given
. |
void |
storeJob(IJobDetail newJob,
boolean replaceExisting)
Store the given
. |
void |
storeJobAndTrigger(IJobDetail newJob,
IOperableTrigger newTrigger)
Store the given
and
. |
void |
storeJobsAndTriggers(Map<IJobDetail,Set<? extends ITrigger>> triggersAndJobs,
boolean replace) |
void |
storeTrigger(IOperableTrigger newTrigger,
boolean replaceExisting)
Store the given
. |
boolean |
supportsPersistence() |
void |
triggeredJobComplete(IOperableTrigger trigger,
IJobDetail jobDetail,
ITrigger.ECompletedExecutionInstruction 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. |
com.helger.commons.collection.impl.ICommonsList<TriggerFiredResult> |
triggersFired(List<IOperableTrigger> 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(IClassLoadHelper loadHelper, ISchedulerSignaler 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 schedulerPaused()
JobStore that the
scheduler has been paused.void schedulerResumed()
JobStore that the
scheduler has resumed after being paused.void shutdown()
JobStore that it
should free up all of it's resources because the scheduler is shutting
down.boolean supportsPersistence()
long getEstimatedTimeToReleaseAndAcquireTrigger()
JobStore implementation
estimates that it will take to release a trigger and acquire a new one.boolean isClustered()
JobStore implementation is clustered.void storeJobAndTrigger(IJobDetail newJob, IOperableTrigger newTrigger) throws JobPersistenceException
IJobDetail and
ITrigger.newJob - The JobDetail to be stored.newTrigger - The Trigger to be stored.JobPersistenceException - if a Job with the same name/group already exists.void storeJob(IJobDetail newJob, boolean replaceExisting) throws JobPersistenceException
IJobDetail.newJob - The JobDetail to be stored.replaceExisting - If true, any Job existing in the
JobStore with the same name & group should be
over-written.JobPersistenceException - if a Job with the same name/group already exists, and
replaceExisting is set to false.void storeJobsAndTriggers(Map<IJobDetail,Set<? extends ITrigger>> triggersAndJobs, boolean replace) throws JobPersistenceException
JobPersistenceExceptionboolean removeJob(JobKey jobKey) throws JobPersistenceException
IJob with the
given key, and any ITrigger 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.JobPersistenceExceptionboolean removeJobs(List<JobKey> jobKeys) throws JobPersistenceException
JobPersistenceExceptionIJobDetail retrieveJob(JobKey jobKey) throws JobPersistenceException
IJobDetail for the
given IJob.Job, or null if there is no match.JobPersistenceExceptionvoid storeTrigger(IOperableTrigger newTrigger, boolean replaceExisting) throws JobPersistenceException
ITrigger.newTrigger - The Trigger to be stored.replaceExisting - If true, any Trigger existing in the
JobStore with the same name & group should be
over-written.JobPersistenceException - if a Trigger with the same name/group already exists,
and replaceExisting is set to false.pauseTriggers(com.helger.quartz.impl.matchers.GroupMatcher)boolean removeTrigger(TriggerKey triggerKey) throws JobPersistenceException
ITrigger 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
& group was found and removed from the store.JobPersistenceExceptionboolean removeTriggers(List<TriggerKey> triggerKeys) throws JobPersistenceException
JobPersistenceExceptionboolean replaceTrigger(TriggerKey triggerKey, IOperableTrigger newTrigger) throws JobPersistenceException
ITrigger 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
& group was found and removed from the store.JobPersistenceExceptionIOperableTrigger retrieveTrigger(TriggerKey triggerKey) throws JobPersistenceException
ITrigger.Trigger, or null if there is no match.JobPersistenceExceptionboolean checkExists(JobKey jobKey) throws JobPersistenceException
jobKey - the identifier to check forJobPersistenceExceptionboolean checkExists(TriggerKey triggerKey) throws JobPersistenceException
ITrigger with the given identifier already
exists within the scheduler.triggerKey - the identifier to check forJobPersistenceExceptionvoid clearAllSchedulingData()
throws JobPersistenceException
JobPersistenceExceptionvoid storeCalendar(String name, ICalendar calendar, boolean replaceExisting, boolean updateTriggers) throws JobPersistenceException
ICalendar.calendar - The Calendar to be stored.replaceExisting - If true, any Calendar existing in the
JobStore with the same name & group should be
over-written.updateTriggers - If true, any Triggers existing in the
JobStore that reference an existing Calendar with the
same name with have their next fire time re-computed with the new
Calendar.JobPersistenceException - if a Calendar with the same name already exists, and
replaceExisting is set to false.boolean removeCalendar(String calName) throws JobPersistenceException
ICalendar with
the given name.
If removal of the Calendar would result in
Triggers pointing to non-existent calendars, then a
JobPersistenceException will be thrown.
calName - The name of the Calendar to be removed.true if a Calendar with the given name
was found and removed from the store.JobPersistenceExceptionICalendar retrieveCalendar(String calName) throws JobPersistenceException
ITrigger.calName - The name of the Calendar to be retrieved.Calendar, or null if there is no match.JobPersistenceExceptionint getNumberOfJobs()
throws JobPersistenceException
IJob s that are
stored in the JobsStore.JobPersistenceExceptionint getNumberOfTriggers()
throws JobPersistenceException
ITrigger s that
are stored in the JobsStore.JobPersistenceExceptionint getNumberOfCalendars()
throws JobPersistenceException
ICalendar s that
are stored in the JobsStore.JobPersistenceExceptioncom.helger.commons.collection.impl.ICommonsSet<JobKey> getJobKeys(GroupMatcher<JobKey> matcher) throws JobPersistenceException
IJob s
that have the given group name.
If there are no jobs in the given group name, the result should be an empty
collection (not null).
JobPersistenceExceptioncom.helger.commons.collection.impl.ICommonsSet<TriggerKey> getTriggerKeys(GroupMatcher<TriggerKey> matcher) throws JobPersistenceException
ITrigger
s that have the given group name.
If there are no triggers in the given group name, the result should be a
zero-length array (not null).
JobPersistenceExceptioncom.helger.commons.collection.impl.ICommonsList<String> getJobGroupNames() throws JobPersistenceException
IJob
groups.
If there are no known group names, the result should be a zero-length array
(not null).
JobPersistenceExceptioncom.helger.commons.collection.impl.ICommonsList<String> getTriggerGroupNames() throws JobPersistenceException
ITrigger
groups.
If there are no known group names, the result should be a zero-length array
(not null).
JobPersistenceExceptioncom.helger.commons.collection.impl.ICommonsList<String> getCalendarNames() throws JobPersistenceException
ICalendar s in the
JobStore.
If there are no Calendars in the given group name, the result should be a
zero-length array (not null).
JobPersistenceExceptioncom.helger.commons.collection.impl.ICommonsList<IOperableTrigger> getTriggersForJob(JobKey jobKey) throws JobPersistenceException
If there are no matches, a zero-length array should be returned.
JobPersistenceExceptionITrigger.ETriggerState getTriggerState(TriggerKey triggerKey) throws JobPersistenceException
ITrigger.JobPersistenceExceptionITrigger.ETriggerStatevoid pauseTrigger(TriggerKey triggerKey) throws JobPersistenceException
ITrigger with the given
key.JobPersistenceExceptionresumeTrigger(TriggerKey)com.helger.commons.collection.impl.ICommonsCollection<String> pauseTriggers(GroupMatcher<TriggerKey> matcher) throws JobPersistenceException
ITriggers in the
given group.
The JobStore should "remember" that the group is paused, and impose the pause on any new triggers that are added to the group while the group is paused.
JobPersistenceExceptionresumeTriggers(GroupMatcher)void pauseJob(JobKey jobKey) throws JobPersistenceException
IJob with the given name -
by pausing all of its current Triggers.JobPersistenceExceptionresumeJob(JobKey)com.helger.commons.collection.impl.ICommonsCollection<String> pauseJobs(GroupMatcher<JobKey> groupMatcher) throws JobPersistenceException
IJobs in the given
group - by pausing all of their Triggers.
The JobStore should "remember" that the group is paused, and impose the pause on any new jobs that are added to the group while the group is paused.
JobPersistenceExceptionresumeJobs(GroupMatcher)void resumeTrigger(TriggerKey triggerKey) throws JobPersistenceException
ITrigger with
the given key.
If the Trigger missed one or more fire-times, then the
Trigger's misfire instruction will be applied.
JobPersistenceExceptionpauseTrigger(TriggerKey)com.helger.commons.collection.impl.ICommonsCollection<String> resumeTriggers(GroupMatcher<TriggerKey> matcher) throws JobPersistenceException
ITriggers in the given group.
If any Trigger missed one or more fire-times, then the
Trigger's misfire instruction will be applied.
JobPersistenceExceptionpauseTriggers(GroupMatcher)com.helger.commons.collection.impl.ICommonsSet<String> getPausedTriggerGroups() throws JobPersistenceException
JobPersistenceExceptionvoid resumeJob(JobKey jobKey) throws JobPersistenceException
IJob with the
given key.
If any of the Job'sTrigger s missed one or more
fire-times, then the Trigger's misfire instruction will be
applied.
JobPersistenceExceptionpauseJob(JobKey)com.helger.commons.collection.impl.ICommonsCollection<String> resumeJobs(GroupMatcher<JobKey> matcher) throws JobPersistenceException
IJobs
in the given group.
If any of the Job s had Trigger s that missed one
or more fire-times, then the Trigger's misfire instruction
will be applied.
JobPersistenceExceptionpauseJobs(GroupMatcher)void pauseAll()
throws JobPersistenceException
pauseTriggerGroup(group) on every group.
When resumeAll() is called (to un-pause), trigger misfire
instructions WILL be applied.
JobPersistenceExceptionresumeAll(),
pauseTriggers(GroupMatcher)void resumeAll()
throws JobPersistenceException
resumeTriggerGroup(group) on every group.
If any Trigger missed one or more fire-times, then the
Trigger's misfire instruction will be applied.
JobPersistenceExceptionpauseAll()com.helger.commons.collection.impl.ICommonsList<IOperableTrigger> 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.JobPersistenceExceptionreleaseAcquiredTrigger(IOperableTrigger)void releaseAcquiredTrigger(IOperableTrigger trigger)
JobStore that the scheduler no longer plans to fire
the given Trigger, that it had previously acquired (reserved).com.helger.commons.collection.impl.ICommonsList<TriggerFiredResult> triggersFired(List<IOperableTrigger> 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(IOperableTrigger trigger, IJobDetail jobDetail, ITrigger.ECompletedExecutionInstruction triggerInstCode)
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.void setInstanceId(String schedInstId)
JobStore of the Scheduler instance's Id, prior to
initialize being invoked.void setInstanceName(String schedName)
JobStore of the Scheduler instance's name, prior to
initialize being invoked.void setThreadPoolSize(int poolSize)
poolSize - amount of threads allocated for job executionCopyright © 2016–2021 Philip Helger. All rights reserved.