|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
QuartzScheduler
,
Trigger
,
Job
,
JobDetail
,
JobDataMap
,
Calendar
Method Summary | |
---|---|
java.util.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. |
boolean |
checkExists(JobKey jobKey)
Determine whether a Job with the given identifier already
exists within the scheduler. |
boolean |
checkExists(TriggerKey triggerKey)
Determine whether a Trigger with the given identifier already
exists within the scheduler. |
void |
clearAllSchedulingData()
Clear (delete!) all scheduling data - all Job s, Trigger s
Calendar s. |
java.util.List<java.lang.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. |
java.util.List<java.lang.String> |
getJobGroupNames()
Get the names of all of the
groups. |
java.util.Set<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 . |
java.util.Set<java.lang.String> |
getPausedTriggerGroups()
|
java.util.List<java.lang.String> |
getTriggerGroupNames()
Get the names of all of the
groups. |
java.util.Set<TriggerKey> |
getTriggerKeys(GroupMatcher<TriggerKey> matcher)
Get the names of all of the s
that have the given group name. |
java.util.List<OperableTrigger> |
getTriggersForJob(JobKey jobKey)
Get all of the Triggers that are associated to the given Job. |
Trigger.TriggerState |
getTriggerState(TriggerKey triggerKey)
Get the current state of the identified . |
void |
initialize(ClassLoadHelper loadHelper,
SchedulerSignaler 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 Trigger s. |
java.util.Collection<java.lang.String> |
pauseJobs(GroupMatcher<JobKey> groupMatcher)
Pause all of the in the given
group - by pausing all of their Trigger s. |
void |
pauseTrigger(TriggerKey triggerKey)
Pause the with the given key. |
java.util.Collection<java.lang.String> |
pauseTriggers(GroupMatcher<TriggerKey> matcher)
Pause all of the in the
given group. |
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 |
removeCalendar(java.lang.String calName)
Remove (delete) the with the
given name. |
boolean |
removeJob(JobKey jobKey)
Remove (delete) the with the given
key, and any s that reference
it. |
boolean |
removeJobs(java.util.List<JobKey> jobKeys)
|
boolean |
removeTrigger(TriggerKey triggerKey)
Remove (delete) the with the
given key. |
boolean |
removeTriggers(java.util.List<TriggerKey> triggerKeys)
|
boolean |
replaceTrigger(TriggerKey triggerKey,
OperableTrigger 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. |
java.util.Collection<java.lang.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. |
java.util.Collection<java.lang.String> |
resumeTriggers(GroupMatcher<TriggerKey> matcher)
Resume (un-pause) all of the
in the given group. |
Calendar |
retrieveCalendar(java.lang.String calName)
Retrieve the given . |
JobDetail |
retrieveJob(JobKey jobKey)
Retrieve the for the given
. |
OperableTrigger |
retrieveTrigger(TriggerKey triggerKey)
Retrieve the given . |
void |
schedulerStarted()
Called by the QuartzScheduler to inform the JobStore that
the scheduler has started. |
void |
setInstanceId(java.lang.String schedInstId)
Inform the JobStore of the Scheduler instance's Id,
prior to initialize being invoked. |
void |
setInstanceName(java.lang.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(java.lang.String name,
Calendar calendar,
boolean replaceExisting,
boolean updateTriggers)
Store the given . |
void |
storeJob(JobDetail newJob,
boolean replaceExisting)
Store the given . |
void |
storeJobAndTrigger(JobDetail newJob,
OperableTrigger newTrigger)
Store the given and . |
void |
storeJobsAndTriggers(java.util.Map<JobDetail,java.util.List<Trigger>> triggersAndJobs,
boolean replace)
|
void |
storeTrigger(OperableTrigger newTrigger,
boolean replaceExisting)
Store the given . |
boolean |
supportsPersistence()
|
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. |
java.util.List<TriggerFiredResult> |
triggersFired(java.util.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). |
Method Detail |
---|
void initialize(ClassLoadHelper loadHelper, SchedulerSignaler signaler) throws SchedulerConfigException
JobStore
is
used, in order to give the it a chance to initialize.
SchedulerConfigException
void schedulerStarted() throws SchedulerException
JobStore
that
the scheduler has started.
SchedulerException
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(JobDetail newJob, OperableTrigger newTrigger) throws ObjectAlreadyExistsException, JobPersistenceException
JobDetail
and Trigger
.
newJob
- The JobDetail
to be stored.newTrigger
- The Trigger
to be stored.
ObjectAlreadyExistsException
- if a Job
with the same name/group already
exists.
JobPersistenceException
void 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 & group should be
over-written.
ObjectAlreadyExistsException
- if a Job
with the same name/group already
exists, and replaceExisting is set to false.
JobPersistenceException
void storeJobsAndTriggers(java.util.Map<JobDetail,java.util.List<Trigger>> triggersAndJobs, boolean replace) throws ObjectAlreadyExistsException, JobPersistenceException
ObjectAlreadyExistsException
JobPersistenceException
boolean removeJob(JobKey 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.
JobPersistenceException
boolean removeJobs(java.util.List<JobKey> jobKeys) throws JobPersistenceException
JobPersistenceException
JobDetail retrieveJob(JobKey jobKey) throws JobPersistenceException
JobDetail
for the given
Job
.
Job
, or null if there is no match.
JobPersistenceException
void 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(TriggerKey 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 & group was found and removed from the store.
JobPersistenceException
boolean removeTriggers(java.util.List<TriggerKey> triggerKeys) throws JobPersistenceException
JobPersistenceException
boolean replaceTrigger(TriggerKey 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 & group was found and removed from the store.
JobPersistenceException
OperableTrigger retrieveTrigger(TriggerKey triggerKey) throws JobPersistenceException
Trigger
.
Trigger
, or null if there is no
match.
JobPersistenceException
boolean checkExists(JobKey jobKey) throws JobPersistenceException
Job
with the given identifier already
exists within the scheduler.
jobKey
- the identifier to check for
SchedulerException
JobPersistenceException
boolean checkExists(TriggerKey triggerKey) throws JobPersistenceException
Trigger
with the given identifier already
exists within the scheduler.
triggerKey
- the identifier to check for
SchedulerException
JobPersistenceException
void clearAllSchedulingData() throws JobPersistenceException
Job
s, Trigger
s
Calendar
s.
JobPersistenceException
void storeCalendar(java.lang.String name, Calendar calendar, boolean replaceExisting, boolean updateTriggers) throws ObjectAlreadyExistsException, JobPersistenceException
Calendar
.
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 Trigger
s 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
.
ObjectAlreadyExistsException
- if a Calendar
with the same name already
exists, and replaceExisting is set to false.
JobPersistenceException
boolean removeCalendar(java.lang.String calName) throws JobPersistenceException
Calendar
with the
given name.
If removal of the Calendar
would result in
Trigger
s 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.
JobPersistenceException
Calendar retrieveCalendar(java.lang.String calName) throws JobPersistenceException
Trigger
.
calName
- The name of the Calendar
to be retrieved.
Calendar
, or null if there is no
match.
JobPersistenceException
int getNumberOfJobs() throws JobPersistenceException
Job
s that are
stored in the JobsStore
.
JobPersistenceException
int getNumberOfTriggers() throws JobPersistenceException
Trigger
s that are
stored in the JobsStore
.
JobPersistenceException
int getNumberOfCalendars() throws JobPersistenceException
Calendar
s that are
stored in the JobsStore
.
JobPersistenceException
java.util.Set<JobKey> getJobKeys(GroupMatcher<JobKey> matcher) throws JobPersistenceException
Job
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
).
JobPersistenceException
java.util.Set<TriggerKey> getTriggerKeys(GroupMatcher<TriggerKey> matcher) throws JobPersistenceException
Trigger
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
).
JobPersistenceException
java.util.List<java.lang.String> getJobGroupNames() throws JobPersistenceException
Job
groups.
If there are no known group names, the result should be a zero-length
array (not null
).
JobPersistenceException
java.util.List<java.lang.String> getTriggerGroupNames() throws JobPersistenceException
Trigger
groups.
If there are no known group names, the result should be a zero-length
array (not null
).
JobPersistenceException
java.util.List<java.lang.String> getCalendarNames() throws JobPersistenceException
Calendar
s
in the JobStore
.
If there are no Calendars in the given group name, the result should be
a zero-length array (not null
).
JobPersistenceException
java.util.List<OperableTrigger> getTriggersForJob(JobKey jobKey) throws JobPersistenceException
If there are no matches, a zero-length array should be returned.
JobPersistenceException
Trigger.TriggerState getTriggerState(TriggerKey triggerKey) throws JobPersistenceException
Trigger
.
JobPersistenceException
Trigger.TriggerState
void pauseTrigger(TriggerKey triggerKey) throws JobPersistenceException
Trigger
with the given key.
JobPersistenceException
resumeTrigger(TriggerKey)
java.util.Collection<java.lang.String> pauseTriggers(GroupMatcher<TriggerKey> matcher) throws JobPersistenceException
Trigger
s
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.
JobPersistenceException
#resumeTriggerGroup(String)
void pauseJob(JobKey jobKey) throws JobPersistenceException
Job
with the given name - by
pausing all of its current Trigger
s.
JobPersistenceException
resumeJob(JobKey)
java.util.Collection<java.lang.String> pauseJobs(GroupMatcher<JobKey> groupMatcher) throws JobPersistenceException
Job
s
in the given
group - by pausing all of their Trigger
s.
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.
JobPersistenceException
#resumeJobGroup(String)
void resumeTrigger(TriggerKey triggerKey) throws JobPersistenceException
Trigger
with the
given key.
If the Trigger
missed one or more fire-times, then the
Trigger
's misfire instruction will be applied.
JobPersistenceException
pauseTrigger(TriggerKey)
java.util.Collection<java.lang.String> resumeTriggers(GroupMatcher<TriggerKey> matcher) throws JobPersistenceException
Trigger
s
in the given group.
If any Trigger
missed one or more fire-times, then the
Trigger
's misfire instruction will be applied.
JobPersistenceException
#pauseTriggers(String)
java.util.Set<java.lang.String> getPausedTriggerGroups() throws JobPersistenceException
JobPersistenceException
void resumeJob(JobKey jobKey) throws JobPersistenceException
Job
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.
JobPersistenceException
pauseJob(JobKey)
java.util.Collection<java.lang.String> resumeJobs(GroupMatcher<JobKey> matcher) throws JobPersistenceException
Job
s
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.
JobPersistenceException
#pauseJobGroup(String)
void pauseAll() throws JobPersistenceException
pauseTriggerGroup(group)
on every group.
When resumeAll()
is called (to un-pause), trigger misfire
instructions WILL be applied.
JobPersistenceException
resumeAll()
,
#pauseTriggers(String)
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.
JobPersistenceException
pauseAll()
java.util.List<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).
JobPersistenceException
java.util.List<TriggerFiredResult> triggersFired(java.util.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).
JobPersistenceException
void 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.
JobPersistenceException
void setInstanceId(java.lang.String schedInstId)
JobStore
of the Scheduler instance's Id,
prior to initialize being invoked.
void setInstanceName(java.lang.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 execution
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |