Package org.quartz

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
    A Trigger that is used to fire a Job at 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
    • Field Detail

      • MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT

        static final int MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT

        Instructs the Scheduler that upon a mis-fire situation, the SimpleTrigger wants to be re-scheduled to 'now' (even if the associated Calendar excludes 'now') with the repeat count left as-is. This does obey the Trigger 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).

        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 Scheduler that upon a mis-fire situation, the SimpleTrigger wants to be re-scheduled to 'now' (even if the associated Calendar excludes 'now') with the repeat count set to what it would be, if it had not missed any firings. This does obey the Trigger 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.

        See Also:
        Constant Field Values
      • MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT

        static final int MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT

        Instructs the Scheduler that upon a mis-fire situation, the SimpleTrigger wants to be re-scheduled to the next scheduled time after 'now' - taking into account any associated Calendar, and with the repeat count set to what it would be, if it had not missed any firings.

        NOTE/WARNING: This instruction could cause the Trigger to 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 Scheduler that upon a mis-fire situation, the SimpleTrigger wants to be re-scheduled to the next scheduled time after 'now' - taking into account any associated Calendar, and with the repeat count left unchanged.

        NOTE/WARNING: This instruction could cause the Trigger to 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 the SimpleTrigger should 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 SimpleTrigger should repeat.

      • getTimesTriggered

        int getTimesTriggered()

        Get the number of times the SimpleTrigger has already fired.