public class DailyTimeIntervalTriggerImpl extends AbstractTrigger<DailyTimeIntervalTrigger> implements DailyTimeIntervalTrigger, CoreTrigger
JobDetailThe trigger will fire every N (see setRepeatInterval(int) ) seconds, minutes or hours
 (see setRepeatIntervalUnit(org.quartz.DateBuilder.IntervalUnit)) during a given time window on specified days of the week.
For example#1, a trigger can be set to fire every 72 minutes between 8:00 and 11:00 everyday. It's fire times would be 8:00, 9:12, 10:24, then next day would repeat: 8:00, 9:12, 10:24 again.
For example#2, a trigger can be set to fire every 23 minutes between 9:20 and 16:47 Monday through Friday.
On each day, the starting fire time is reset to startTimeOfDay value, and then it will add repeatInterval value to it until the endTimeOfDay is reached. If you set daysOfWeek values, then fire time will only occur during those week days period. Again, remember this trigger will reset fire time each day with startTimeOfDay, regardless of your interval or endTimeOfDay!
The default values for fields if not set are: startTimeOfDay defaults to 00:00:00, the endTimeOfDay default to 23:59:59, and daysOfWeek is default to every day. The startTime default to current time-stamp now, while endTime has not value.
If startTime is before startTimeOfDay, then startTimeOfDay will be used and startTime has no affect other than to specify the first day of firing. Else if startTime is after startTimeOfDay, then the first fire time for that day will be the next interval after the startTime. For example, if you set startingTimeOfDay=9am, endingTimeOfDay=11am, interval=15 mins, and startTime=9:33am, then the next fire time will be 9:45pm. Note also that if you do not set startTime value, the trigger builder will default to current time, and current time maybe before or after the startTimeOfDay! So be aware how you set your startTime.
This trigger also supports "repeatCount" feature to end the trigger fire time after a certain number of count is reached. Just as the SimpleTrigger, setting repeatCount=0 means trigger will fire once only! Setting any positive count then the trigger will repeat count + 1 times. Unlike SimpleTrigger, the default value of repeatCount of this trigger is set to REPEAT_INDEFINITELY instead of 0 though.
DailyTimeIntervalTrigger, 
DailyTimeIntervalScheduleBuilder, 
Serialized FormTrigger.CompletedExecutionInstruction, Trigger.TriggerState, Trigger.TriggerTimeComparatorMISFIRE_INSTRUCTION_DO_NOTHING, MISFIRE_INSTRUCTION_FIRE_ONCE_NOW, REPEAT_INDEFINITELYDEFAULT_PRIORITY, MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY, MISFIRE_INSTRUCTION_SMART_POLICY| Constructor and Description | 
|---|
| DailyTimeIntervalTriggerImpl()
 Create a  DailyTimeIntervalTriggerwith no settings. | 
| DailyTimeIntervalTriggerImpl(String name,
                            Date startTime,
                            Date endTime,
                            TimeOfDay startTimeOfDay,
                            TimeOfDay endTimeOfDay,
                            DateBuilder.IntervalUnit intervalUnit,
                            int repeatInterval)
 Create a  DailyTimeIntervalTriggerthat will occur at the given time,
 and repeat at the the given interval until the given end time. | 
| DailyTimeIntervalTriggerImpl(String name,
                            String group,
                            Date startTime,
                            Date endTime,
                            TimeOfDay startTimeOfDay,
                            TimeOfDay endTimeOfDay,
                            DateBuilder.IntervalUnit intervalUnit,
                            int repeatInterval)
 Create a  DailyTimeIntervalTriggerthat will occur at the given time,
 and repeat at the the given interval until the given end time. | 
| DailyTimeIntervalTriggerImpl(String name,
                            String group,
                            String jobName,
                            String jobGroup,
                            Date startTime,
                            Date endTime,
                            TimeOfDay startTimeOfDay,
                            TimeOfDay endTimeOfDay,
                            DateBuilder.IntervalUnit intervalUnit,
                            int repeatInterval)
 Create a  DailyTimeIntervalTriggerthat will occur at the given time,
 fire the identifiedJoband repeat at the the given
 interval until the given end time. | 
| DailyTimeIntervalTriggerImpl(String name,
                            String group,
                            TimeOfDay startTimeOfDay,
                            TimeOfDay endTimeOfDay,
                            DateBuilder.IntervalUnit intervalUnit,
                            int repeatInterval)
 Create a  DailyTimeIntervalTriggerthat will occur immediately, and
 repeat at the the given interval. | 
| DailyTimeIntervalTriggerImpl(String name,
                            TimeOfDay startTimeOfDay,
                            TimeOfDay endTimeOfDay,
                            DateBuilder.IntervalUnit intervalUnit,
                            int repeatInterval)
 Create a  DailyTimeIntervalTriggerthat will occur immediately, and
 repeat at the the given interval. | 
| Modifier and Type | Method and Description | 
|---|---|
| Date | computeFirstFireTime(Calendar calendar)
 Called by the scheduler at the time a  Triggeris first
 added to the scheduler, in order to have theTriggercompute its first fire time, based on any associated calendar. | 
| Set<Integer> | getDaysOfWeek()The days of the week upon which to fire. | 
| Date | getEndTime()
 Get the time at which the  DailyTimeIntervalTriggershould quit
 repeating. | 
| TimeOfDay | getEndTimeOfDay()The time of day to complete firing at the given interval. | 
| Date | getFinalFireTime()
 Returns the final time at which the  DailyTimeIntervalTriggerwill
 fire, if there is no end time set, null will be returned. | 
| Date | getFireTimeAfter(Date afterTime)
 Returns the next time at which the  DailyTimeIntervalTriggerwill
 fire, after the given time. | 
| Date | getNextFireTime()
 Returns the next time at which the  Triggeris scheduled to fire. | 
| Date | getPreviousFireTime()
 Returns the previous time at which the  DailyTimeIntervalTriggerfired. | 
| int | getRepeatCount()
 Get the the number of times for interval this trigger should
 repeat, after which it will be automatically deleted. | 
| int | getRepeatInterval()
 Get the the time interval that will be added to the  DateIntervalTrigger's
 fire time (in the set repeat interval unit) in order to calculate the time of the 
 next trigger repeat. | 
| DateBuilder.IntervalUnit | getRepeatIntervalUnit()Get the interval unit - the time unit on with the interval applies. | 
| ScheduleBuilder<DailyTimeIntervalTrigger> | getScheduleBuilder()Get a  ScheduleBuilderthat is configured to produce a 
 schedule identical to this trigger's schedule. | 
| Date | getStartTime()
 Get the time at which the  DailyTimeIntervalTriggershould occur. | 
| TimeOfDay | getStartTimeOfDay()The time of day to start firing at the given interval. | 
| int | getTimesTriggered()
 Get the number of times the  DateIntervalTriggerhas already
 fired. | 
| boolean | hasAdditionalProperties()This trigger has no additional properties besides what's defined in this class. | 
| boolean | mayFireAgain()
 Determines whether or not the  DailyTimeIntervalTriggerwill occur
 again. | 
| void | setDaysOfWeek(Set<Integer> daysOfWeek) | 
| void | setEndTime(Date endTime)
 Set the time at which the  DailyTimeIntervalTriggershould quit
 repeating (and be automatically deleted). | 
| void | setEndTimeOfDay(TimeOfDay endTimeOfDay) | 
| void | setNextFireTime(Date nextFireTime)
 Set the next time at which the  DailyTimeIntervalTriggershould fire. | 
| void | setPreviousFireTime(Date previousFireTime)
 Set the previous time at which the  DailyTimeIntervalTriggerfired. | 
| void | setRepeatCount(int repeatCount) | 
| void | setRepeatInterval(int repeatInterval)
 set the the time interval that will be added to the  DailyTimeIntervalTrigger's
 fire time (in the set repeat interval unit) in order to calculate the time of the 
 next trigger repeat. | 
| void | setRepeatIntervalUnit(DateBuilder.IntervalUnit intervalUnit)Set the interval unit - the time unit on with the interval applies. | 
| void | setStartTime(Date startTime)
 Set the time at which the  DailyTimeIntervalTriggershould occur. | 
| void | setStartTimeOfDay(TimeOfDay startTimeOfDay) | 
| void | setTimesTriggered(int timesTriggered)
 Set the number of times the  DailyTimeIntervalTriggerhas already
 fired. | 
| void | triggered(Calendar calendar)
 Called when the  has decided to 'fire'
 the trigger (execute the associatedJob), in order to
 give theTriggera chance to update itself for its next
 triggering (if any). | 
| void | updateAfterMisfire(Calendar cal)
 Updates the  DailyTimeIntervalTrigger's state based on the
 MISFIRE_INSTRUCTION_XXX that was selected when theDailyTimeIntervalTriggerwas created. | 
| void | updateWithNewCalendar(Calendar calendar,
                     long misfireThreshold)
 This method should not be used by the Quartz client. | 
| void | validate()
 Validates whether the properties of the  JobDetailare
 valid for submission into aScheduler. | 
| protected boolean | validateMisfireInstruction(int misfireInstruction) | 
clone, compareTo, equals, executionComplete, getCalendarName, getDescription, getFireInstanceId, getFullJobName, getFullName, getGroup, getJobDataMap, getJobGroup, getJobKey, getJobName, getKey, getMisfireInstruction, getName, getPriority, getTriggerBuilder, hashCode, setCalendarName, setDescription, setFireInstanceId, setGroup, setJobDataMap, setJobGroup, setJobKey, setJobName, setKey, setMisfireInstruction, setName, setPriority, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitgetTriggerBuildercompareTo, equals, getCalendarName, getDescription, getJobDataMap, getJobKey, getKey, getMisfireInstruction, getPrioritypublic DailyTimeIntervalTriggerImpl()
 Create a DailyTimeIntervalTrigger with no settings.
 
public DailyTimeIntervalTriggerImpl(String name, TimeOfDay startTimeOfDay, TimeOfDay endTimeOfDay, DateBuilder.IntervalUnit intervalUnit, int repeatInterval)
 Create a DailyTimeIntervalTrigger that will occur immediately, and
 repeat at the the given interval.
 
startTimeOfDay - The TimeOfDay that the repeating should begin occurring.endTimeOfDay - The TimeOfDay that the repeating should stop occurring.intervalUnit - The repeat interval unit. The only intervals that are valid for this type of trigger are 
 DateBuilder.IntervalUnit.SECOND, DateBuilder.IntervalUnit.MINUTE, and DateBuilder.IntervalUnit.HOUR.IllegalArgumentException - if an invalid IntervalUnit is given, or the repeat interval is zero or less.public DailyTimeIntervalTriggerImpl(String name, String group, TimeOfDay startTimeOfDay, TimeOfDay endTimeOfDay, DateBuilder.IntervalUnit intervalUnit, int repeatInterval)
 Create a DailyTimeIntervalTrigger that will occur immediately, and
 repeat at the the given interval.
 
startTimeOfDay - The TimeOfDay that the repeating should begin occurring.endTimeOfDay - The TimeOfDay that the repeating should stop occurring.intervalUnit - The repeat interval unit. The only intervals that are valid for this type of trigger are 
 DateBuilder.IntervalUnit.SECOND, DateBuilder.IntervalUnit.MINUTE, and DateBuilder.IntervalUnit.HOUR.IllegalArgumentException - if an invalid IntervalUnit is given, or the repeat interval is zero or less.public DailyTimeIntervalTriggerImpl(String name, Date startTime, Date endTime, TimeOfDay startTimeOfDay, TimeOfDay endTimeOfDay, DateBuilder.IntervalUnit intervalUnit, int repeatInterval)
 Create a DailyTimeIntervalTrigger that will occur at the given time,
 and repeat at the the given interval until the given end time.
 
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.startTimeOfDay - The TimeOfDay that the repeating should begin occurring.endTimeOfDay - The TimeOfDay that the repeating should stop occurring.intervalUnit - The repeat interval unit. The only intervals that are valid for this type of trigger are
 DateBuilder.IntervalUnit.SECOND, DateBuilder.IntervalUnit.MINUTE, and DateBuilder.IntervalUnit.HOUR.repeatInterval - The number of milliseconds to pause between the repeat firing.IllegalArgumentException - if an invalid IntervalUnit is given, or the repeat interval is zero or less.public DailyTimeIntervalTriggerImpl(String name, String group, Date startTime, Date endTime, TimeOfDay startTimeOfDay, TimeOfDay endTimeOfDay, DateBuilder.IntervalUnit intervalUnit, int repeatInterval)
 Create a DailyTimeIntervalTrigger that will occur at the given time,
 and repeat at the the given interval until the given end time.
 
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.startTimeOfDay - The TimeOfDay that the repeating should begin occurring.endTimeOfDay - The TimeOfDay that the repeating should stop occurring.intervalUnit - The repeat interval unit. The only intervals that are valid for this type of trigger are 
 DateBuilder.IntervalUnit.SECOND, DateBuilder.IntervalUnit.MINUTE, and DateBuilder.IntervalUnit.HOUR.repeatInterval - The number of milliseconds to pause between the repeat firing.IllegalArgumentException - if an invalid IntervalUnit is given, or the repeat interval is zero or less.public DailyTimeIntervalTriggerImpl(String name, String group, String jobName, String jobGroup, Date startTime, Date endTime, TimeOfDay startTimeOfDay, TimeOfDay endTimeOfDay, DateBuilder.IntervalUnit intervalUnit, int repeatInterval)
 Create a DailyTimeIntervalTrigger that will occur at the given time,
 fire the identified Job and repeat at the the given
 interval until the given end time.
 
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.startTimeOfDay - The TimeOfDay that the repeating should begin occurring.endTimeOfDay - The TimeOfDay that the repeating should stop occurring.intervalUnit - The repeat interval unit. The only intervals that are valid for this type of trigger are 
 DateBuilder.IntervalUnit.SECOND, DateBuilder.IntervalUnit.MINUTE, and DateBuilder.IntervalUnit.HOUR.repeatInterval - The number of milliseconds to pause between the repeat firing.IllegalArgumentException - if an invalid IntervalUnit is given, or the repeat interval is zero or less.public Date getStartTime()
 Get the time at which the DailyTimeIntervalTrigger should occur. It defaults to 
 the getStartTimeOfDay of current day.
 
getStartTime in interface TriggergetStartTime in class AbstractTrigger<DailyTimeIntervalTrigger>public void setStartTime(Date startTime)
 Set the time at which the DailyTimeIntervalTrigger should occur.
 
setStartTime in interface MutableTriggersetStartTime in class AbstractTrigger<DailyTimeIntervalTrigger>IllegalArgumentException - if startTime is null.public Date getEndTime()
 Get the time at which the DailyTimeIntervalTrigger should quit
 repeating.
 
getEndTime in interface TriggergetEndTime in class AbstractTrigger<DailyTimeIntervalTrigger>getFinalFireTime()public void setEndTime(Date endTime)
 Set the time at which the DailyTimeIntervalTrigger should quit
 repeating (and be automatically deleted).
 
setEndTime in interface MutableTriggersetEndTime in class AbstractTrigger<DailyTimeIntervalTrigger>IllegalArgumentException - if endTime is before start time.TriggerUtils.computeEndTimeToAllowParticularNumberOfFirings(org.quartz.spi.OperableTrigger, org.quartz.Calendar, int)public DateBuilder.IntervalUnit getRepeatIntervalUnit()
DailyTimeIntervalTriggerGet the interval unit - the time unit on with the interval applies.
The only intervals that are valid for this type of trigger are DateBuilder.IntervalUnit.SECOND,
 DateBuilder.IntervalUnit.MINUTE, and DateBuilder.IntervalUnit.HOUR.
getRepeatIntervalUnit in interface DailyTimeIntervalTriggerpublic void setRepeatIntervalUnit(DateBuilder.IntervalUnit intervalUnit)
Set the interval unit - the time unit on with the interval applies.
intervalUnit - The repeat interval unit. The only intervals that are valid for this type of trigger are 
 DateBuilder.IntervalUnit.SECOND, DateBuilder.IntervalUnit.MINUTE, and DateBuilder.IntervalUnit.HOUR.public int getRepeatInterval()
DailyTimeIntervalTrigger
 Get the the time interval that will be added to the DateIntervalTrigger's
 fire time (in the set repeat interval unit) in order to calculate the time of the 
 next trigger repeat.
 
getRepeatInterval in interface DailyTimeIntervalTriggerpublic void setRepeatInterval(int repeatInterval)
 set the the time interval that will be added to the DailyTimeIntervalTrigger's
 fire time (in the set repeat interval unit) in order to calculate the time of the 
 next trigger repeat.
 
IllegalArgumentException - if repeatInterval is < 1public int getTimesTriggered()
DailyTimeIntervalTrigger
 Get the number of times the DateIntervalTrigger has already
 fired.
 
getTimesTriggered in interface DailyTimeIntervalTriggerpublic void setTimesTriggered(int timesTriggered)
 Set the number of times the DailyTimeIntervalTrigger has already
 fired.
 
protected boolean validateMisfireInstruction(int misfireInstruction)
validateMisfireInstruction in class AbstractTrigger<DailyTimeIntervalTrigger>public void updateAfterMisfire(Calendar cal)
 Updates the DailyTimeIntervalTrigger's state based on the
 MISFIRE_INSTRUCTION_XXX that was selected when the DailyTimeIntervalTrigger
 was created.
 
 If the misfire instruction is set to MISFIRE_INSTRUCTION_SMART_POLICY,
 then the following scheme will be used: 
 
MISFIRE_INSTRUCTION_FIRE_ONCE_NOW
 updateAfterMisfire in interface OperableTriggerupdateAfterMisfire in class AbstractTrigger<DailyTimeIntervalTrigger>public void triggered(Calendar calendar)
 Called when the SchedulerJob), in order to
 give the Trigger a chance to update itself for its next
 triggering (if any).
 
triggered in interface OperableTriggertriggered in class AbstractTrigger<DailyTimeIntervalTrigger>AbstractTrigger.executionComplete(JobExecutionContext, JobExecutionException)public void updateWithNewCalendar(Calendar calendar, long misfireThreshold)
AbstractTriggerThis method should not be used by the Quartz client.
To be implemented by the concrete class.
 The implementation should update the Trigger's state
 based on the given new version of the associated Calendar
 (the state should be updated so that it's next fire time is appropriate
 given the Calendar's new settings). 
 
updateWithNewCalendar in interface OperableTriggerupdateWithNewCalendar in class AbstractTrigger<DailyTimeIntervalTrigger>calendar - the modifying calendarAbstractTrigger.updateWithNewCalendar(org.quartz.Calendar, long)public 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.
 
computeFirstFireTime in interface OperableTriggercomputeFirstFireTime in class AbstractTrigger<DailyTimeIntervalTrigger>Trigger will be fired
         by the scheduler, which is also the same value getNextFireTime()
         will return (until after the first firing of the Trigger).
         public Date getNextFireTime()
 Returns the next time at which the Trigger is scheduled to fire. If
 the trigger will not fire again, null will be returned.  Note that
 the time returned can possibly be in the past, if the time that was computed
 for the trigger to next fire has already arrived, but the scheduler has not yet
 been able to fire the trigger (which would likely be due to lack of resources
 e.g. threads).
 
The value returned is not guaranteed to be valid until after the Trigger
 has been added to the scheduler.
 
getNextFireTime in interface TriggergetNextFireTime in class AbstractTrigger<DailyTimeIntervalTrigger>TriggerUtils.computeFireTimesBetween(org.quartz.spi.OperableTrigger, org.quartz.Calendar, java.util.Date, java.util.Date)public Date getPreviousFireTime()
 Returns the previous time at which the DailyTimeIntervalTrigger 
 fired. If the trigger has not yet fired, null will be
 returned.
getPreviousFireTime in interface TriggergetPreviousFireTime in class AbstractTrigger<DailyTimeIntervalTrigger>public void setNextFireTime(Date nextFireTime)
 Set the next time at which the DailyTimeIntervalTrigger should fire.
 
This method should not be invoked by client code.
setNextFireTime in interface OperableTriggerpublic void setPreviousFireTime(Date previousFireTime)
 Set the previous time at which the DailyTimeIntervalTrigger fired.
 
This method should not be invoked by client code.
setPreviousFireTime in interface OperableTriggerpublic Date getFireTimeAfter(Date afterTime)
 Returns the next time at which the DailyTimeIntervalTrigger will
 fire, after the given time. If the trigger will not fire after the given
 time, null will be returned.
 
getFireTimeAfter in interface TriggergetFireTimeAfter in class AbstractTrigger<DailyTimeIntervalTrigger>public Date getFinalFireTime()
 Returns the final time at which the DailyTimeIntervalTrigger will
 fire, if there is no end time set, null will be returned.
 
Note that the return time may be in the past.
getFinalFireTime in interface TriggergetFinalFireTime in class AbstractTrigger<DailyTimeIntervalTrigger>public boolean mayFireAgain()
 Determines whether or not the DailyTimeIntervalTrigger will occur
 again.
 
mayFireAgain in interface TriggermayFireAgain in class AbstractTrigger<DailyTimeIntervalTrigger>public void validate()
              throws SchedulerException
 Validates whether the properties of the JobDetail are
 valid for submission into a Scheduler.
validate in interface OperableTriggervalidate in class AbstractTrigger<DailyTimeIntervalTrigger>IllegalStateException - if a required property (such as Name, Group, Class) is not
           set.SchedulerExceptionpublic Set<Integer> getDaysOfWeek()
getDaysOfWeek in interface DailyTimeIntervalTriggerCalendar.SUNDAY - Calendar.SATURDAY.public TimeOfDay getStartTimeOfDay()
getStartTimeOfDay in interface DailyTimeIntervalTriggerpublic void setStartTimeOfDay(TimeOfDay startTimeOfDay)
public TimeOfDay getEndTimeOfDay()
getEndTimeOfDay in interface DailyTimeIntervalTriggerpublic void setEndTimeOfDay(TimeOfDay endTimeOfDay)
public ScheduleBuilder<DailyTimeIntervalTrigger> getScheduleBuilder()
ScheduleBuilder that is configured to produce a 
 schedule identical to this trigger's schedule.getScheduleBuilder in interface TriggergetScheduleBuilder in class AbstractTrigger<DailyTimeIntervalTrigger>AbstractTrigger.getTriggerBuilder()public boolean hasAdditionalProperties()
hasAdditionalProperties in interface CoreTriggerpublic int getRepeatCount()
DailyTimeIntervalTriggerGet the the number of times for interval this trigger should repeat, after which it will be automatically deleted.
getRepeatCount in interface DailyTimeIntervalTriggerDailyTimeIntervalTrigger.REPEAT_INDEFINITELYpublic void setRepeatCount(int repeatCount)
Copyright 2001-2019, Terracotta, Inc.