public interface SimpleTrigger extends Trigger
Trigger that is used to fire a Job
at a given moment in time, and optionally repeated at a specified interval.TriggerBuilder,
SimpleScheduleBuilderTrigger.CompletedExecutionInstruction, Trigger.TriggerState, Trigger.TriggerTimeComparator| Modifier and Type | Field and Description |
|---|---|
static int |
MISFIRE_INSTRUCTION_FIRE_NOW
Instructs the
that upon a mis-fire
situation, the wants to be fired
now by Scheduler. |
static int |
MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_EXISTING_COUNT
Instructs the
that upon a mis-fire
situation, the wants to be
re-scheduled to the next scheduled time after 'now' - taking into
account any associated , and with the
repeat count left unchanged. |
static int |
MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT
Instructs the
that upon a mis-fire
situation, the wants to be
re-scheduled to the next scheduled time after 'now' - taking into
account any associated , and with the
repeat count set to what it would be, if it had not missed any firings. |
static int |
MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT
Instructs the
that upon a mis-fire
situation, the wants to be
re-scheduled to 'now' (even if the associated
excludes 'now') with the repeat count left as-is. |
static int |
MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_REMAINING_REPEAT_COUNT
Instructs the
that upon a mis-fire
situation, the wants to be
re-scheduled to 'now' (even if the associated
excludes 'now') with the repeat count set to what it would be, if it had
not missed any firings. |
static int |
REPEAT_INDEFINITELY
Used to indicate the 'repeat count' of the trigger is indefinite.
|
static long |
serialVersionUID |
DEFAULT_PRIORITY, MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY, MISFIRE_INSTRUCTION_SMART_POLICY| Modifier and Type | Method and Description |
|---|---|
int |
getRepeatCount()
Get the the number of times the
SimpleTrigger should
repeat, after which it will be automatically deleted. |
long |
getRepeatInterval()
Get the the time interval (in milliseconds) at which the
SimpleTrigger should repeat. |
int |
getTimesTriggered()
Get the number of times the
SimpleTrigger has already fired. |
TriggerBuilder<SimpleTrigger> |
getTriggerBuilder()
Get a
TriggerBuilder that is configured to produce a
Trigger identical to this one. |
compareTo, equals, getCalendarName, getDescription, getEndTime, getFinalFireTime, getFireTimeAfter, getJobDataMap, getJobKey, getKey, getMisfireInstruction, getNextFireTime, getPreviousFireTime, getPriority, getScheduleBuilder, getStartTime, mayFireAgainstatic final long serialVersionUID
static final int MISFIRE_INSTRUCTION_FIRE_NOW
Instructs the that upon a mis-fire
situation, the Scheduler wants to be fired
now by SimpleTriggerScheduler.
NOTE: This instruction should typically only be used for
'one-shot' (non-repeating) Triggers. If it is used on a trigger with a
repeat count > 0 then it is equivalent to the instruction .
MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_REMAINING_REPEAT_COUNT
static final int MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT
Instructs the that upon a mis-fire
situation, the Scheduler wants to be
re-scheduled to 'now' (even if the associated SimpleTrigger
excludes 'now') with the repeat count left as-is. This does obey the
CalendarTrigger end-time however, so if 'now' is after the
end-time the Trigger will not fire again.
NOTE: Use of this instruction causes the trigger to 'forget' the start-time and repeat-count that it was originally setup with (this is only an issue if you for some reason wanted to be able to tell what the original values were at some later time).
static final int MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_REMAINING_REPEAT_COUNT
Instructs the that upon a mis-fire
situation, the Scheduler wants to be
re-scheduled to 'now' (even if the associated SimpleTrigger
excludes 'now') with the repeat count set to what it would be, if it had
not missed any firings. This does obey the CalendarTrigger end-time
however, so if 'now' is after the end-time the Trigger will
not fire again.
NOTE: Use of this instruction causes the trigger to 'forget' the start-time and repeat-count that it was originally setup with. Instead, the repeat count on the trigger will be changed to whatever the remaining repeat count is (this is only an issue if you for some reason wanted to be able to tell what the original values were at some later time).
NOTE: This instruction could cause the Trigger
to go to the 'COMPLETE' state after firing 'now', if all the
repeat-fire-times where missed.
static final int MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT
Instructs the that upon a mis-fire
situation, the Scheduler wants to be
re-scheduled to the next scheduled time after 'now' - taking into
account any associated SimpleTrigger, and with the
repeat count set to what it would be, if it had not missed any firings.
Calendar
NOTE/WARNING: This instruction could cause the Trigger
to go directly to the 'COMPLETE' state if all fire-times where missed.
static final int MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_EXISTING_COUNT
Instructs the that upon a mis-fire
situation, the Scheduler wants to be
re-scheduled to the next scheduled time after 'now' - taking into
account any associated SimpleTrigger, and with the
repeat count left unchanged.
Calendar
NOTE/WARNING: This instruction could cause the Trigger
to go directly to the 'COMPLETE' state if the end-time of the trigger
has arrived.
static final int REPEAT_INDEFINITELY
Used to indicate the 'repeat count' of the trigger is indefinite. Or in other words, the trigger should repeat continually until the trigger's ending timestamp.
int getRepeatCount()
Get the the number of times the SimpleTrigger should
repeat, after which it will be automatically deleted.
REPEAT_INDEFINITELYlong getRepeatInterval()
Get the the time interval (in milliseconds) at which the SimpleTrigger should repeat.
int getTimesTriggered()
Get the number of times the SimpleTrigger has already fired.
TriggerBuilder<SimpleTrigger> getTriggerBuilder()
TriggerTriggerBuilder that is configured to produce a
Trigger identical to this one.getTriggerBuilder in interface TriggerTrigger.getScheduleBuilder()Copyright 2001-2019, Terracotta, Inc.