Interface SimpleTrigger

All Superinterfaces:
Cloneable, Comparable<Trigger>, 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.
  • Field Details

    • serialVersionUID

      static final long serialVersionUID
      See Also:
    • MISFIRE_INSTRUCTION_FIRE_NOW

      static final int MISFIRE_INSTRUCTION_FIRE_NOW
      Instructs the Scheduler that upon a mis-fire situation, the SimpleTrigger wants to be fired now by Scheduler.

      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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
  • Method Details

    • getRepeatCount

      int getRepeatCount()
      Get the the number of times the SimpleTrigger should repeat, after which it will be automatically deleted.
      See Also:
    • getRepeatInterval

      long getRepeatInterval()
      Get the the time interval (in milliseconds) at which the SimpleTrigger should repeat.
    • getTimesTriggered

      int getTimesTriggered()
      Get the number of times the SimpleTrigger has already fired.