Class DailyTimeIntervalTriggerMonthImpl
- All Implemented Interfaces:
DailyTimeIntervalMonthTrigger,Serializable,Cloneable,Comparable<org.quartz.Trigger>,org.quartz.impl.triggers.CoreTrigger,org.quartz.spi.MutableTrigger,org.quartz.spi.OperableTrigger,org.quartz.Trigger
- Since:
- 2024-01-15 14:28
- Author:
- xieyubin
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.quartz.Trigger
org.quartz.Trigger.CompletedExecutionInstruction, org.quartz.Trigger.TriggerState, org.quartz.Trigger.TriggerTimeComparator -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate Dateprivate org.quartz.TimeOfDayprivate Dateprivate static final intprivate static final intprivate static final longprivate Dateprivate intprivate intprivate org.quartz.DateBuilder.IntervalUnitprivate static final longprivate LocalDateTimeprivate org.quartz.TimeOfDayprivate intprivate static final intConstants.Fields inherited from interface cn.sinozg.applet.quartz.use.ext.DailyTimeIntervalMonthTrigger
MISFIRE_INSTRUCTION_DO_NOTHING, MISFIRE_INSTRUCTION_FIRE_ONCE_NOW, REPEAT_INDEFINITELYFields inherited from interface org.quartz.Trigger
DEFAULT_PRIORITY, MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY, MISFIRE_INSTRUCTION_SMART_POLICY -
Constructor Summary
ConstructorsConstructorDescriptionCreate aDailyTimeIntervalTriggerwith no settings.DailyTimeIntervalTriggerMonthImpl(String name, String group, String jobName, String jobGroup, Date startTime, Date endTime, org.quartz.TimeOfDay startTimeOfDay, org.quartz.TimeOfDay endTimeOfDay, org.quartz.DateBuilder.IntervalUnit intervalUnit, int repeatInterval) Create aDailyTimeIntervalTriggerthat will occur at the given time, fire the identifiedJoband repeat at the the given interval until the given end time.DailyTimeIntervalTriggerMonthImpl(String name, String group, Date startTime, Date endTime, org.quartz.TimeOfDay startTimeOfDay, org.quartz.TimeOfDay endTimeOfDay, org.quartz.DateBuilder.IntervalUnit intervalUnit, int repeatInterval) Create aDailyTimeIntervalTriggerthat will occur at the given time, and repeat at the the given interval until the given end time.DailyTimeIntervalTriggerMonthImpl(String name, String group, org.quartz.TimeOfDay startTimeOfDay, org.quartz.TimeOfDay endTimeOfDay, org.quartz.DateBuilder.IntervalUnit intervalUnit, int repeatInterval) Create aDailyTimeIntervalTriggerthat will occur immediately, and repeat at the the given interval.DailyTimeIntervalTriggerMonthImpl(String name, Date startTime, Date endTime, org.quartz.TimeOfDay startTimeOfDay, org.quartz.TimeOfDay endTimeOfDay, org.quartz.DateBuilder.IntervalUnit intervalUnit, int repeatInterval) Create aDailyTimeIntervalTriggerthat will occur at the given time, and repeat at the the given interval until the given end time.DailyTimeIntervalTriggerMonthImpl(String name, org.quartz.TimeOfDay startTimeOfDay, org.quartz.TimeOfDay endTimeOfDay, org.quartz.DateBuilder.IntervalUnit intervalUnit, int repeatInterval) Create aDailyTimeIntervalTriggerthat will occur immediately, and repeat at the the given interval. -
Method Summary
Modifier and TypeMethodDescriptionprivate DateadvanceToNextDayOfMonthIfNecessary(Date fireTime, boolean forceToAdvanceNextDay) Given fireTime time determine if it is on a valid day of week.computeFirstFireTime(org.quartz.Calendar calendar) Called by the scheduler at the time aTriggeris first added to the scheduler, in order to have theTriggercompute its first fire time, based on any associated calendar.private CalendarcreateCalendarTime(Date dateTime) The days of the month upon which to fire.Get the time at which theDailyTimeIntervalTriggershould quit repeating.org.quartz.TimeOfDayThe time of day to complete firing at the given interval.Returns the final time at which theDailyTimeIntervalTriggerwill fire, if there is no end time set, null will be returned.getFireTimeAfter(Date afterTime) Returns the next time at which theDailyTimeIntervalTriggerwill fire, after the given time.Returns the next time at which theTriggeris scheduled to fire.Returns the previous time at which theDailyTimeIntervalTriggerfired.intGet the the number of times for interval this trigger should repeat, after which it will be automatically deleted.intGet the the time interval that will be added to theDateIntervalTrigger's fire time (in the set repeat interval unit) in order to calculate the time of the next trigger repeat.org.quartz.DateBuilder.IntervalUnitGet the interval unit - the time unit on with the interval applies.org.quartz.ScheduleBuilder<DailyTimeIntervalMonthTrigger>Get aScheduleBuilderthat is configured to produce a schedule identical to this trigger's schedule.Get the time at which theDailyTimeIntervalTriggershould occur.org.quartz.TimeOfDayThe time of day to start firing at the given interval.intGet the number of times theDateIntervalTriggerhas already fired.booleanThis trigger has no additional properties besides what's defined in this class.private booleanbooleanDetermines whether or not theDailyTimeIntervalTriggerwill occur again.voidsetDaysOfMonth(Set<Integer> daysOfMonth) voidsetEndTime(Date endTime) Set the time at which theDailyTimeIntervalTriggershould quit repeating (and be automatically deleted).voidsetEndTimeOfDay(org.quartz.TimeOfDay endTimeOfDay) voidsetNextFireTime(Date nextFireTime) Set the next time at which theDailyTimeIntervalTriggershould fire.voidsetPreviousFireTime(Date previousFireTime) Set the previous time at which theDailyTimeIntervalTriggerfired.voidsetRepeatCount(int repeatCount) voidsetRepeatInterval(int repeatInterval) set the the time interval that will be added to theDailyTimeIntervalTrigger's fire time (in the set repeat interval unit) in order to calculate the time of the next trigger repeat.voidsetRepeatIntervalUnit(org.quartz.DateBuilder.IntervalUnit intervalUnit) Set the interval unit - the time unit on with the interval applies.voidsetStartTime(Date startTime) Set the time at which theDailyTimeIntervalTriggershould occur.voidsetStartTimeOfDay(org.quartz.TimeOfDay startTimeOfDay) voidsetTimesTriggered(int timesTriggered) Set the number of times theDailyTimeIntervalTriggerhas already fired.voidtriggered(org.quartz.Calendar calendar) Called when thehas decided to 'fire' the trigger (execute the associatedSchedulerJob), in order to give theTriggera chance to update itself for its next triggering (if any).voidupdateAfterMisfire(org.quartz.Calendar cal) Updates theDailyTimeIntervalTrigger's state based on the MISFIRE_INSTRUCTION_XXX that was selected when theDailyTimeIntervalTriggerwas created.voidupdateWithNewCalendar(org.quartz.Calendar calendar, long misfireThreshold) voidvalidate()Validates whether the properties of theJobDetailare valid for submission into aScheduler.protected booleanvalidateMisfireInstruction(int misfireInstruction) Methods inherited from class org.quartz.impl.triggers.AbstractTrigger
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, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface cn.sinozg.applet.quartz.use.ext.DailyTimeIntervalMonthTrigger
getTriggerBuilderMethods inherited from interface org.quartz.Trigger
compareTo, equals, getCalendarName, getDescription, getJobDataMap, getJobKey, getKey, getMisfireInstruction, getPriority
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
YEAR_TO_GIVEUP_SCHEDULING_AT
private static final int YEAR_TO_GIVEUP_SCHEDULING_ATConstants. -
startTime
-
endTime
-
nextFireTime
-
previousFireTime
-
repeatCount
private int repeatCount -
repeatInterval
private int repeatInterval -
repeatIntervalUnit
private org.quartz.DateBuilder.IntervalUnit repeatIntervalUnit -
daysOfMonth
-
startTimeOfDay
private org.quartz.TimeOfDay startTimeOfDay -
endTimeOfDay
private org.quartz.TimeOfDay endTimeOfDay -
timesTriggered
private int timesTriggered -
complete
private boolean complete -
NUM_60
private static final long NUM_60- See Also:
-
NUM_24
private static final int NUM_24- See Also:
-
NUM_31
private static final int NUM_31- See Also:
-
-
Constructor Details
-
DailyTimeIntervalTriggerMonthImpl
public DailyTimeIntervalTriggerMonthImpl()Create a
DailyTimeIntervalTriggerwith no settings. -
DailyTimeIntervalTriggerMonthImpl
public DailyTimeIntervalTriggerMonthImpl(String name, org.quartz.TimeOfDay startTimeOfDay, org.quartz.TimeOfDay endTimeOfDay, org.quartz.DateBuilder.IntervalUnit intervalUnit, int repeatInterval) Create a
DailyTimeIntervalTriggerthat will occur immediately, and repeat at the the given interval.- Parameters:
startTimeOfDay- TheTimeOfDaythat the repeating should begin occurring.endTimeOfDay- TheTimeOfDaythat the repeating should stop occurring.intervalUnit- The repeat interval unit. The only intervals that are valid for this type of trigger areDateBuilder.IntervalUnit.SECOND,DateBuilder.IntervalUnit.MINUTE, andDateBuilder.IntervalUnit.HOUR.- Throws:
IllegalArgumentException- if an invalid IntervalUnit is given, or the repeat interval is zero or less.
-
DailyTimeIntervalTriggerMonthImpl
public DailyTimeIntervalTriggerMonthImpl(String name, String group, org.quartz.TimeOfDay startTimeOfDay, org.quartz.TimeOfDay endTimeOfDay, org.quartz.DateBuilder.IntervalUnit intervalUnit, int repeatInterval) Create a
DailyTimeIntervalTriggerthat will occur immediately, and repeat at the the given interval.- Parameters:
startTimeOfDay- TheTimeOfDaythat the repeating should begin occurring.endTimeOfDay- TheTimeOfDaythat the repeating should stop occurring.intervalUnit- The repeat interval unit. The only intervals that are valid for this type of trigger areDateBuilder.IntervalUnit.SECOND,DateBuilder.IntervalUnit.MINUTE, andDateBuilder.IntervalUnit.HOUR.- Throws:
IllegalArgumentException- if an invalid IntervalUnit is given, or the repeat interval is zero or less.
-
DailyTimeIntervalTriggerMonthImpl
public DailyTimeIntervalTriggerMonthImpl(String name, Date startTime, Date endTime, org.quartz.TimeOfDay startTimeOfDay, org.quartz.TimeOfDay endTimeOfDay, org.quartz.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.- Parameters:
startTime- ADateset to the time for theTriggerto fire.endTime- ADateset to the time for theTriggerto quit repeat firing.startTimeOfDay- TheTimeOfDaythat the repeating should begin occurring.endTimeOfDay- TheTimeOfDaythat the repeating should stop occurring.intervalUnit- The repeat interval unit. The only intervals that are valid for this type of trigger areDateBuilder.IntervalUnit.SECOND,DateBuilder.IntervalUnit.MINUTE, andDateBuilder.IntervalUnit.HOUR.repeatInterval- The number of milliseconds to pause between the repeat firing.- Throws:
IllegalArgumentException- if an invalid IntervalUnit is given, or the repeat interval is zero or less.
-
DailyTimeIntervalTriggerMonthImpl
public DailyTimeIntervalTriggerMonthImpl(String name, String group, Date startTime, Date endTime, org.quartz.TimeOfDay startTimeOfDay, org.quartz.TimeOfDay endTimeOfDay, org.quartz.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.- Parameters:
startTime- ADateset to the time for theTriggerto fire.endTime- ADateset to the time for theTriggerto quit repeat firing.startTimeOfDay- TheTimeOfDaythat the repeating should begin occurring.endTimeOfDay- TheTimeOfDaythat the repeating should stop occurring.intervalUnit- The repeat interval unit. The only intervals that are valid for this type of trigger areDateBuilder.IntervalUnit.SECOND,DateBuilder.IntervalUnit.MINUTE, andDateBuilder.IntervalUnit.HOUR.repeatInterval- The number of milliseconds to pause between the repeat firing.- Throws:
IllegalArgumentException- if an invalid IntervalUnit is given, or the repeat interval is zero or less.
-
DailyTimeIntervalTriggerMonthImpl
public DailyTimeIntervalTriggerMonthImpl(String name, String group, String jobName, String jobGroup, Date startTime, Date endTime, org.quartz.TimeOfDay startTimeOfDay, org.quartz.TimeOfDay endTimeOfDay, org.quartz.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.- Parameters:
startTime- ADateset to the time for theTriggerto fire.endTime- ADateset to the time for theTriggerto quit repeat firing.startTimeOfDay- TheTimeOfDaythat the repeating should begin occurring.endTimeOfDay- TheTimeOfDaythat the repeating should stop occurring.intervalUnit- The repeat interval unit. The only intervals that are valid for this type of trigger areDateBuilder.IntervalUnit.SECOND,DateBuilder.IntervalUnit.MINUTE, andDateBuilder.IntervalUnit.HOUR.repeatInterval- The number of milliseconds to pause between the repeat firing.- Throws:
IllegalArgumentException- if an invalid IntervalUnit is given, or the repeat interval is zero or less.
-
-
Method Details
-
getStartTime
Get the time at which the
DailyTimeIntervalTriggershould occur. It defaults to the getStartTimeOfDay of current day.- Specified by:
getStartTimein interfaceorg.quartz.Trigger
-
setStartTime
Set the time at which the
DailyTimeIntervalTriggershould occur. if startTime isnull.- Specified by:
setStartTimein interfaceorg.quartz.spi.MutableTrigger
-
getEndTime
Get the time at which the
DailyTimeIntervalTriggershould quit repeating.- Specified by:
getEndTimein interfaceorg.quartz.Trigger- See Also:
-
setEndTime
Set the time at which the
DailyTimeIntervalTriggershould quit repeating (and be automatically deleted).- Specified by:
setEndTimein interfaceorg.quartz.spi.MutableTrigger- Throws:
IllegalArgumentException- if endTime is before start time.
-
getRepeatIntervalUnit
public org.quartz.DateBuilder.IntervalUnit getRepeatIntervalUnit()Description copied from interface:DailyTimeIntervalMonthTriggerGet 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, andDateBuilder.IntervalUnit.HOUR.- Specified by:
getRepeatIntervalUnitin interfaceDailyTimeIntervalMonthTrigger- Returns:
- DateBuilder
- See Also:
-
setRepeatIntervalUnit
public void setRepeatIntervalUnit(org.quartz.DateBuilder.IntervalUnit intervalUnit) Set the interval unit - the time unit on with the interval applies.
- Parameters:
intervalUnit- The repeat interval unit. The only intervals that are valid for this type of trigger areDateBuilder.IntervalUnit.SECOND,DateBuilder.IntervalUnit.MINUTE, andDateBuilder.IntervalUnit.HOUR.
-
getRepeatInterval
public int getRepeatInterval()Description copied from interface:DailyTimeIntervalMonthTriggerGet 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.- Specified by:
getRepeatIntervalin interfaceDailyTimeIntervalMonthTrigger- Returns:
- repeatInterval
- See Also:
-
setRepeatInterval
public 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.- Throws:
IllegalArgumentException- if repeatInterval is < 0
-
getTimesTriggered
public int getTimesTriggered()Description copied from interface:DailyTimeIntervalMonthTriggerGet the number of times the
DateIntervalTriggerhas already fired.- Specified by:
getTimesTriggeredin interfaceDailyTimeIntervalMonthTrigger- Returns:
- timesTriggered
- See Also:
-
setTimesTriggered
public void setTimesTriggered(int timesTriggered) Set the number of times the
DailyTimeIntervalTriggerhas already fired. -
validateMisfireInstruction
protected boolean validateMisfireInstruction(int misfireInstruction) - Specified by:
validateMisfireInstructionin classorg.quartz.impl.triggers.AbstractTrigger<DailyTimeIntervalMonthTrigger>
-
updateAfterMisfire
public void updateAfterMisfire(org.quartz.Calendar cal) Updates the
DailyTimeIntervalTrigger's state based on the MISFIRE_INSTRUCTION_XXX that was selected when theDailyTimeIntervalTriggerwas created.If the misfire instruction is set to MISFIRE_INSTRUCTION_SMART_POLICY, then the following scheme will be used:
- The instruction will be interpreted as
MISFIRE_INSTRUCTION_FIRE_ONCE_NOW
- Specified by:
updateAfterMisfirein interfaceorg.quartz.spi.OperableTrigger
- The instruction will be interpreted as
-
triggered
public void triggered(org.quartz.Calendar calendar) Called when the
has decided to 'fire' the trigger (execute the associatedSchedulerJob), in order to give theTriggera chance to update itself for its next triggering (if any).- Specified by:
triggeredin interfaceorg.quartz.spi.OperableTrigger- See Also:
-
AbstractTrigger.executionComplete(JobExecutionContext, JobExecutionException)
-
updateWithNewCalendar
public void updateWithNewCalendar(org.quartz.Calendar calendar, long misfireThreshold) - Specified by:
updateWithNewCalendarin interfaceorg.quartz.spi.OperableTrigger- See Also:
-
OperableTrigger.updateWithNewCalendar(org.quartz.Calendar, long)
-
computeFirstFireTime
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.After this method has been called,
getNextFireTime()should return a valid answer.- Specified by:
computeFirstFireTimein interfaceorg.quartz.spi.OperableTrigger- Returns:
- the first time at which the
Triggerwill be fired by the scheduler, which is also the same valuegetNextFireTime()will return (until after the first firing of theTrigger).
-
createCalendarTime
-
getNextFireTime
Returns the next time at which the
Triggeris scheduled to fire. If the trigger will not fire again,nullwill 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
Triggerhas been added to the scheduler.- Specified by:
getNextFireTimein interfaceorg.quartz.Trigger
-
getPreviousFireTime
Returns the previous time at which the
DailyTimeIntervalTriggerfired. If the trigger has not yet fired,nullwill be returned.- Specified by:
getPreviousFireTimein interfaceorg.quartz.Trigger
-
setNextFireTime
Set the next time at which the
DailyTimeIntervalTriggershould fire.This method should not be invoked by client code.
- Specified by:
setNextFireTimein interfaceorg.quartz.spi.OperableTrigger
-
setPreviousFireTime
Set the previous time at which the
DailyTimeIntervalTriggerfired.This method should not be invoked by client code.
- Specified by:
setPreviousFireTimein interfaceorg.quartz.spi.OperableTrigger
-
getFireTimeAfter
Returns the next time at which the
DailyTimeIntervalTriggerwill fire, after the given time. If the trigger will not fire after the given time,nullwill be returned.- Specified by:
getFireTimeAfterin interfaceorg.quartz.Trigger
-
isSameDay
-
advanceToNextDayOfMonthIfNecessary
Given fireTime time determine if it is on a valid day of week. If so, simply return it unaltered, if not, advance to the next valid week day, and set the time of day to the start time of day- Parameters:
fireTime- - given next fireTime.forceToAdvanceNextDay- - flag to whether to advance day without check existing week day. This scenario can happen when a caller determine fireTime has passed the endTimeOfDay that fireTime should move to next day anyway.- Returns:
- a next day fireTime.
-
getFinalFireTime
Returns the final time at which the
DailyTimeIntervalTriggerwill fire, if there is no end time set, null will be returned.Note that the return time may be in the past.
- Specified by:
getFinalFireTimein interfaceorg.quartz.Trigger
-
mayFireAgain
public boolean mayFireAgain()Determines whether or not the
DailyTimeIntervalTriggerwill occur again.- Specified by:
mayFireAgainin interfaceorg.quartz.Trigger
-
validate
public void validate() throws org.quartz.SchedulerExceptionValidates whether the properties of the
JobDetailare valid for submission into aScheduler.- Specified by:
validatein interfaceorg.quartz.spi.OperableTrigger- Overrides:
validatein classorg.quartz.impl.triggers.AbstractTrigger<DailyTimeIntervalMonthTrigger>- Throws:
IllegalStateException- if a required property (such as Name, Group, Class) is not set.org.quartz.SchedulerException
-
getDaysOfMonth
The days of the month upon which to fire.- Specified by:
getDaysOfMonthin interfaceDailyTimeIntervalMonthTrigger- Returns:
- 1-31
-
setDaysOfMonth
-
getStartTimeOfDay
public org.quartz.TimeOfDay getStartTimeOfDay()The time of day to start firing at the given interval.- Specified by:
getStartTimeOfDayin interfaceDailyTimeIntervalMonthTrigger- Returns:
- startTimeOfDay
-
setStartTimeOfDay
public void setStartTimeOfDay(org.quartz.TimeOfDay startTimeOfDay) -
getEndTimeOfDay
public org.quartz.TimeOfDay getEndTimeOfDay()The time of day to complete firing at the given interval.- Specified by:
getEndTimeOfDayin interfaceDailyTimeIntervalMonthTrigger- Returns:
- endTimeOfDay
-
setEndTimeOfDay
public void setEndTimeOfDay(org.quartz.TimeOfDay endTimeOfDay) -
getScheduleBuilder
Get aScheduleBuilderthat is configured to produce a schedule identical to this trigger's schedule.- Specified by:
getScheduleBuilderin interfaceorg.quartz.Trigger- Specified by:
getScheduleBuilderin classorg.quartz.impl.triggers.AbstractTrigger<DailyTimeIntervalMonthTrigger>- See Also:
-
AbstractTrigger.getTriggerBuilder()
-
hasAdditionalProperties
public boolean hasAdditionalProperties()This trigger has no additional properties besides what's defined in this class.- Specified by:
hasAdditionalPropertiesin interfaceorg.quartz.impl.triggers.CoreTrigger
-
getRepeatCount
public int getRepeatCount()Description copied from interface:DailyTimeIntervalMonthTriggerGet the the number of times for interval this trigger should repeat, after which it will be automatically deleted.
- Specified by:
getRepeatCountin interfaceDailyTimeIntervalMonthTrigger- Returns:
- int
- See Also:
-
setRepeatCount
public void setRepeatCount(int repeatCount)
-