Class SimpleTriggerImpl

    • Constructor Detail

      • SimpleTriggerImpl

        public SimpleTriggerImpl()

        Create a SimpleTrigger with no settings.

      • SimpleTriggerImpl

        @Deprecated
        public SimpleTriggerImpl​(java.lang.String name)
        Deprecated.
        use a TriggerBuilder instead

        Create a SimpleTrigger that will occur immediately, and not repeat.

      • SimpleTriggerImpl

        @Deprecated
        public SimpleTriggerImpl​(java.lang.String name,
                                 java.lang.String group)
        Deprecated.
        use a TriggerBuilder instead

        Create a SimpleTrigger that will occur immediately, and not repeat.

      • SimpleTriggerImpl

        @Deprecated
        public SimpleTriggerImpl​(java.lang.String name,
                                 int repeatCount,
                                 long repeatInterval)
        Deprecated.
        use a TriggerBuilder instead

        Create a SimpleTrigger that will occur immediately, and repeat at the the given interval the given number of times.

      • SimpleTriggerImpl

        @Deprecated
        public SimpleTriggerImpl​(java.lang.String name,
                                 java.lang.String group,
                                 int repeatCount,
                                 long repeatInterval)
        Deprecated.
        use a TriggerBuilder instead

        Create a SimpleTrigger that will occur immediately, and repeat at the the given interval the given number of times.

      • SimpleTriggerImpl

        @Deprecated
        public SimpleTriggerImpl​(java.lang.String name,
                                 java.util.Date startTime)
        Deprecated.
        use a TriggerBuilder instead

        Create a SimpleTrigger that will occur at the given time, and not repeat.

      • SimpleTriggerImpl

        @Deprecated
        public SimpleTriggerImpl​(java.lang.String name,
                                 java.lang.String group,
                                 java.util.Date startTime)
        Deprecated.
        use a TriggerBuilder instead

        Create a SimpleTrigger that will occur at the given time, and not repeat.

      • SimpleTriggerImpl

        @Deprecated
        public SimpleTriggerImpl​(java.lang.String name,
                                 java.util.Date startTime,
                                 java.util.Date endTime,
                                 int repeatCount,
                                 long repeatInterval)
        Deprecated.
        use a TriggerBuilder instead

        Create a SimpleTrigger that will occur at the given time, and repeat at the the given interval the given number of times, or until the given end time.

        Parameters:
        startTime - A Date set to the time for the Trigger to fire.
        endTime - A Date set to the time for the Trigger to quit repeat firing.
        repeatCount - The number of times for the Trigger to repeat firing, use SimpleTrigger.REPEAT_INDEFINITELY for unlimited times.
        repeatInterval - The number of milliseconds to pause between the repeat firing.
      • SimpleTriggerImpl

        @Deprecated
        public SimpleTriggerImpl​(java.lang.String name,
                                 java.lang.String group,
                                 java.util.Date startTime,
                                 java.util.Date endTime,
                                 int repeatCount,
                                 long repeatInterval)
        Deprecated.
        use a TriggerBuilder instead

        Create a SimpleTrigger that will occur at the given time, and repeat at the the given interval the given number of times, or until the given end time.

        Parameters:
        startTime - A Date set to the time for the Trigger to fire.
        endTime - A Date set to the time for the Trigger to quit repeat firing.
        repeatCount - The number of times for the Trigger to repeat firing, use SimpleTrigger.REPEAT_INDEFINITELY for unlimited times.
        repeatInterval - The number of milliseconds to pause between the repeat firing.
      • SimpleTriggerImpl

        @Deprecated
        public SimpleTriggerImpl​(java.lang.String name,
                                 java.lang.String group,
                                 java.lang.String jobName,
                                 java.lang.String jobGroup,
                                 java.util.Date startTime,
                                 java.util.Date endTime,
                                 int repeatCount,
                                 long repeatInterval)
        Deprecated.
        use a TriggerBuilder instead

        Create a SimpleTrigger that will occur at the given time, fire the identified Job and repeat at the the given interval the given number of times, or until the given end time.

        Parameters:
        startTime - A Date set to the time for the Trigger to fire.
        endTime - A Date set to the time for the Trigger to quit repeat firing.
        repeatCount - The number of times for the Trigger to repeat firing, use SimpleTrigger.REPEAT_INDEFINITELYfor unlimitted times.
        repeatInterval - The number of milliseconds to pause between the repeat firing.
    • Method Detail

      • setRepeatCount

        public void setRepeatCount​(int repeatCount)

        Set the the number of time the SimpleTrigger should repeat, after which it will be automatically deleted.

        Throws:
        java.lang.IllegalArgumentException - if repeatCount is < 0
        See Also:
        SimpleTrigger.REPEAT_INDEFINITELY
      • getRepeatInterval

        public long getRepeatInterval()
        Description copied from interface: SimpleTrigger

        Get the the time interval (in milliseconds) at which the SimpleTrigger should repeat.

        Specified by:
        getRepeatInterval in interface SimpleTrigger
      • setRepeatInterval

        public void setRepeatInterval​(long repeatInterval)

        Set the the time interval (in milliseconds) at which the SimpleTrigger should repeat.

        Throws:
        java.lang.IllegalArgumentException - if repeatInterval is < 0
      • getTimesTriggered

        public int getTimesTriggered()

        Get the number of times the SimpleTrigger has already fired.

        Specified by:
        getTimesTriggered in interface SimpleTrigger
      • setTimesTriggered

        public void setTimesTriggered​(int timesTriggered)

        Set the number of times the SimpleTrigger has already fired.

      • updateAfterMisfire

        public void updateAfterMisfire​(Calendar cal)

        Updates the SimpleTrigger's state based on the MISFIRE_INSTRUCTION_XXX that was selected when the SimpleTrigger was created.

        If the misfire instruction is set to MISFIRE_INSTRUCTION_SMART_POLICY, then the following scheme will be used:

        • If the Repeat Count is 0, then the instruction will be interpreted as MISFIRE_INSTRUCTION_FIRE_NOW.
        • If the Repeat Count is REPEAT_INDEFINITELY, then the instruction will be interpreted as MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT. WARNING: using MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT with a trigger that has a non-null end-time may cause the trigger to never fire again if the end-time arrived during the misfire time span.
        • If the Repeat Count is > 0, then the instruction will be interpreted as MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT.
        Specified by:
        updateAfterMisfire in interface OperableTrigger
        Specified by:
        updateAfterMisfire in class AbstractTrigger<SimpleTrigger>
      • computeFirstFireTime

        public java.util.Date computeFirstFireTime​(Calendar calendar)

        Called by the scheduler at the time a Trigger is first added to the scheduler, in order to have the Trigger compute its first fire time, based on any associated calendar.

        After this method has been called, getNextFireTime() should return a valid answer.

        Specified by:
        computeFirstFireTime in interface OperableTrigger
        Specified by:
        computeFirstFireTime in class AbstractTrigger<SimpleTrigger>
        Returns:
        the first time at which the Trigger will be fired by the scheduler, which is also the same value getNextFireTime() will return (until after the first firing of the Trigger).
      • setNextFireTime

        public void setNextFireTime​(java.util.Date nextFireTime)

        Set the next time at which the SimpleTrigger should fire.

        This method should not be invoked by client code.

        Specified by:
        setNextFireTime in interface OperableTrigger
      • setPreviousFireTime

        public void setPreviousFireTime​(java.util.Date previousFireTime)

        Set the previous time at which the SimpleTrigger fired.

        This method should not be invoked by client code.

        Specified by:
        setPreviousFireTime in interface OperableTrigger
      • getFireTimeAfter

        public java.util.Date getFireTimeAfter​(java.util.Date afterTime)

        Returns the next time at which the SimpleTrigger will fire, after the given time. If the trigger will not fire after the given time, null will be returned.

        Specified by:
        getFireTimeAfter in interface Trigger
        Specified by:
        getFireTimeAfter in class AbstractTrigger<SimpleTrigger>
      • getFireTimeBefore

        public java.util.Date getFireTimeBefore​(java.util.Date end)

        Returns the last time at which the SimpleTrigger will fire, before the given time. If the trigger will not fire before the given time, null will be returned.

      • computeNumTimesFiredBetween

        public int computeNumTimesFiredBetween​(java.util.Date start,
                                               java.util.Date end)
      • getFinalFireTime

        public java.util.Date getFinalFireTime()

        Returns the final time at which the SimpleTrigger will fire, if repeatCount is REPEAT_INDEFINITELY, null will be returned.

        Note that the return time may be in the past.

        Specified by:
        getFinalFireTime in interface Trigger
        Specified by:
        getFinalFireTime in class AbstractTrigger<SimpleTrigger>
      • hasAdditionalProperties

        public boolean hasAdditionalProperties()
        Used by extensions of SimpleTrigger to imply that there are additional properties, specifically so that extensions can choose whether to be stored as a serialized blob, or as a flattened SimpleTrigger table.
        Specified by:
        hasAdditionalProperties in interface CoreTrigger