Interface SimpleTrigger
-
- All Superinterfaces:
java.lang.Cloneable,java.lang.Comparable<Trigger>,java.io.Serializable,Trigger
- All Known Implementing Classes:
SimpleTriggerImpl
public interface SimpleTrigger extends Trigger
Athat is used to fire aTriggerJobat a given moment in time, and optionally repeated at a specified interval.- Author:
- James House, contributions by Lieven Govaerts of Ebitec Nv, Belgium.
- See Also:
TriggerBuilder,SimpleScheduleBuilder
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.quartz.Trigger
Trigger.CompletedExecutionInstruction, Trigger.TriggerState, Trigger.TriggerTimeComparator
-
-
Field Summary
Fields Modifier and Type Field Description static intMISFIRE_INSTRUCTION_FIRE_NOWInstructs thethat upon a mis-fire situation, theSchedulerwants to be fired now bySimpleTriggerScheduler.static intMISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_EXISTING_COUNTInstructs thethat upon a mis-fire situation, theSchedulerwants to be re-scheduled to the next scheduled time after 'now' - taking into account any associatedSimpleTrigger, and with the repeat count left unchanged.Calendarstatic intMISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNTInstructs thethat upon a mis-fire situation, theSchedulerwants to be re-scheduled to the next scheduled time after 'now' - taking into account any associatedSimpleTrigger, and with the repeat count set to what it would be, if it had not missed any firings.Calendarstatic intMISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNTInstructs thethat upon a mis-fire situation, theSchedulerwants to be re-scheduled to 'now' (even if the associatedSimpleTriggerexcludes 'now') with the repeat count left as-is.Calendarstatic intMISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_REMAINING_REPEAT_COUNTInstructs thethat upon a mis-fire situation, theSchedulerwants to be re-scheduled to 'now' (even if the associatedSimpleTriggerexcludes 'now') with the repeat count set to what it would be, if it had not missed any firings.Calendarstatic intREPEAT_INDEFINITELYUsed to indicate the 'repeat count' of the trigger is indefinite.static longserialVersionUID-
Fields inherited from interface org.quartz.Trigger
DEFAULT_PRIORITY, MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY, MISFIRE_INSTRUCTION_SMART_POLICY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetRepeatCount()Get the number of times theSimpleTriggershould repeat, after the initial firing, after which it will be automatically deleted.longgetRepeatInterval()Get the time interval (in milliseconds) at which theSimpleTriggershould repeat.intgetTimesTriggered()Get the number of times theSimpleTriggerhas already fired.TriggerBuilder<SimpleTrigger>getTriggerBuilder()Get aTriggerBuilderthat is configured to produce aTriggeridentical to this one.-
Methods inherited from interface org.quartz.Trigger
compareTo, equals, getCalendarName, getDescription, getEndTime, getFinalFireTime, getFireTimeAfter, getJobDataMap, getJobKey, getKey, getMisfireInstruction, getNextFireTime, getPreviousFireTime, getPriority, getScheduleBuilder, getStartTime, mayFireAgain
-
-
-
-
Field Detail
-
serialVersionUID
static final long serialVersionUID
- See Also:
- Constant Field Values
-
MISFIRE_INSTRUCTION_FIRE_NOW
static final int MISFIRE_INSTRUCTION_FIRE_NOW
Instructs the
that upon a mis-fire situation, theSchedulerwants to be fired now bySimpleTriggerScheduler.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- See Also:
- Constant Field Values
-
MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT
static final int MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT
Instructs the
that upon a mis-fire situation, theSchedulerwants to be re-scheduled to 'now' (even if the associatedSimpleTriggerexcludes 'now') with the repeat count left as-is. This does obey theCalendarTriggerend-time however, so if 'now' is after the end-time theTriggerwill 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).
- See Also:
- Constant Field Values
-
MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_REMAINING_REPEAT_COUNT
static final int MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_REMAINING_REPEAT_COUNT
Instructs the
that upon a mis-fire situation, theSchedulerwants to be re-scheduled to 'now' (even if the associatedSimpleTriggerexcludes 'now') with the repeat count set to what it would be, if it had not missed any firings. This does obey theCalendarTriggerend-time however, so if 'now' is after the end-time theTriggerwill 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
Triggerto go to the 'COMPLETE' state after firing 'now', if all the repeat-fire-times where missed.- See Also:
- Constant Field Values
-
MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT
static final int MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT
Instructs the
that upon a mis-fire situation, theSchedulerwants to be re-scheduled to the next scheduled time after 'now' - taking into account any associatedSimpleTrigger, and with the repeat count set to what it would be, if it had not missed any firings.CalendarNOTE/WARNING: This instruction could cause the
Triggerto go directly to the 'COMPLETE' state if all fire-times where missed.- See Also:
- Constant Field Values
-
MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_EXISTING_COUNT
static final int MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_EXISTING_COUNT
Instructs the
that upon a mis-fire situation, theSchedulerwants to be re-scheduled to the next scheduled time after 'now' - taking into account any associatedSimpleTrigger, and with the repeat count left unchanged.CalendarNOTE/WARNING: This instruction could cause the
Triggerto go directly to the 'COMPLETE' state if the end-time of the trigger has arrived.- See Also:
- Constant Field Values
-
REPEAT_INDEFINITELY
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.
- See Also:
- Constant Field Values
-
-
Method Detail
-
getRepeatCount
int getRepeatCount()
Get the number of times theSimpleTriggershould repeat, after the initial firing, after which it will be automatically deleted. The total number of firings will be this number + 1.- Returns:
- the number of times the trigger should repeat after the initial firing.
- See Also:
REPEAT_INDEFINITELY
-
getRepeatInterval
long getRepeatInterval()
Get the time interval (in milliseconds) at which the
SimpleTriggershould repeat.
-
getTimesTriggered
int getTimesTriggered()
Get the number of times the
SimpleTriggerhas already fired.
-
getTriggerBuilder
TriggerBuilder<SimpleTrigger> getTriggerBuilder()
Description copied from interface:TriggerGet aTriggerBuilderthat is configured to produce aTriggeridentical to this one.- Specified by:
getTriggerBuilderin interfaceTrigger- See Also:
Trigger.getScheduleBuilder()
-
-