RandomRecurrentTriggerExecutor
Runs a RandomRecurrentTrigger: fires a random number of times per day.
The times are random, between startTime and endTime. A daily cron job at startTime sets up the timers for the day. If resumed after startTime, the timers for today are set up right away, unless hasBeenScheduledForToday is true.
- Inheritance
-
- Object
- AbstractExecutor<
RandomRecurrentTrigger> - TriggerExecutor<
RandomRecurrentTrigger> - SchedulableTriggerExecutor<
RandomRecurrentTrigger> - RandomRecurrentTriggerExecutor
Constructors
RandomRecurrentTriggerExecutor
Properties
endTime
hasBeenScheduledForToday
Whether the timers for today have already been set up.
maxNumberOfTriggers
minNumberOfTriggers
numberOfSampling
A new random number of triggers for a day. Changes on every read.
randomTime
A new random time between startTime and endTime. Changes on every read.
samplingTimes
A new list of random times between startTime and endTime. Changes on every read.
startTime
todayString
Today's date as year-month-day, without zero padding. Used in logs.
Methods
getSchedule
Returns the times this trigger fires between from and to.
Ordered by time, except for RandomRecurrentTriggerExecutor.
max limits the number of iterations; its default depends on the implementation.
onResume
Called by resume. Returns true if successfully resumed.
If false, the executor moves to ExecutorState.PausedButShouldBeResumed.