|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.quartz.ScheduleBuilder<DailyTimeIntervalTrigger> org.quartz.DailyTimeIntervalScheduleBuilder
public class DailyTimeIntervalScheduleBuilder
A ScheduleBuilder
implementation that build schedule for DailyTimeIntervalTrigger.
This builder provide an extra convenient method for you to set the trigger's endTimeOfDay. You may use either endingDailyAt() or endingDailyAfterCount() to set the value. The later will auto calculate your endTimeOfDay by using the interval, intervalUnit and startTimeOfDay to perform the calculation.
When using endingDailyAfterCount(), you should note that it is used to calculating endTimeOfDay. So if your startTime on the first day is already pass by a time that would not add up to the count you expected, until the next day comes. Remember that DailyTimeIntervalTrigger will use startTimeOfDay and endTimeOfDay as fresh per each day!
Quartz provides a builder-style API for constructing scheduling-related
entities via a Domain-Specific Language (DSL). The DSL can best be
utilized through the usage of static imports of the methods on the classes
TriggerBuilder
, JobBuilder
,
DateBuilder
, JobKey
, TriggerKey
and the various ScheduleBuilder
implementations.
Client code can then use the DSL to write code such as this:
JobDetail job = newJob(MyJob.class) .withIdentity("myJob") .build(); Trigger trigger = newTrigger() .withIdentity(triggerKey("myTrigger", "myTriggerGroup")) .withSchedule(onDaysOfTheWeek(MONDAY, THURSDAY)) .startAt(futureDate(10, MINUTES)) .build(); scheduler.scheduleJob(job, trigger);
Field Summary | |
---|---|
static Set<Integer> |
ALL_DAYS_OF_THE_WEEK
A set of all days of the week. |
static Set<Integer> |
MONDAY_THROUGH_FRIDAY
A set of the business days of the week (for locales similar to the USA). |
static Set<Integer> |
SATURDAY_AND_SUNDAY
A set of the weekend days of the week (for locales similar to the USA). |
Constructor Summary | |
---|---|
protected |
DailyTimeIntervalScheduleBuilder()
|
Method Summary | |
---|---|
MutableTrigger |
build()
Build the actual Trigger -- NOT intended to be invoked by end users, but will rather be invoked by a TriggerBuilder which this ScheduleBuilder is given to. |
static DailyTimeIntervalScheduleBuilder |
dailyTimeIntervalSchedule()
Create a DailyTimeIntervalScheduleBuilder. |
DailyTimeIntervalScheduleBuilder |
endingDailyAfterCount(int count)
Calculate and set the endTimeOfDay using count, interval and starTimeOfDay. |
DailyTimeIntervalScheduleBuilder |
endingDailyAt(TimeOfDay timeOfDay)
Set the startTimeOfDay for this trigger to end firing each day at the given time. |
DailyTimeIntervalScheduleBuilder |
onDaysOfTheWeek(Integer... onDaysOfWeek)
Set the trigger to fire on the given days of the week. |
DailyTimeIntervalScheduleBuilder |
onDaysOfTheWeek(Set<Integer> onDaysOfWeek)
Set the trigger to fire on the given days of the week. |
DailyTimeIntervalScheduleBuilder |
onEveryDay()
Set the trigger to fire on all days of the week. |
DailyTimeIntervalScheduleBuilder |
onMondayThroughFriday()
Set the trigger to fire on the days from Monday through Friday. |
DailyTimeIntervalScheduleBuilder |
onSaturdayAndSunday()
Set the trigger to fire on the days Saturday and Sunday. |
DailyTimeIntervalScheduleBuilder |
startingDailyAt(TimeOfDay timeOfDay)
Set the trigger to begin firing each day at the given time. |
DailyTimeIntervalScheduleBuilder |
withInterval(int timeInterval,
DateBuilder.IntervalUnit unit)
Specify the time unit and interval for the Trigger to be produced. |
DailyTimeIntervalScheduleBuilder |
withIntervalInHours(int intervalInHours)
Specify an interval in the IntervalUnit.HOUR that the produced Trigger will repeat at. |
DailyTimeIntervalScheduleBuilder |
withIntervalInMinutes(int intervalInMinutes)
Specify an interval in the IntervalUnit.MINUTE that the produced Trigger will repeat at. |
DailyTimeIntervalScheduleBuilder |
withIntervalInSeconds(int intervalInSeconds)
Specify an interval in the IntervalUnit.SECOND that the produced Trigger will repeat at. |
DailyTimeIntervalScheduleBuilder |
withMisfireHandlingInstructionDoNothing()
If the Trigger misfires, use the DailyTimeIntervalTrigger.MISFIRE_INSTRUCTION_DO_NOTHING instruction. |
DailyTimeIntervalScheduleBuilder |
withMisfireHandlingInstructionFireAndProceed()
If the Trigger misfires, use the DailyTimeIntervalTrigger.MISFIRE_INSTRUCTION_FIRE_ONCE_NOW instruction. |
DailyTimeIntervalScheduleBuilder |
withMisfireHandlingInstructionIgnoreMisfires()
If the Trigger misfires, use the Trigger.MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY instruction. |
DailyTimeIntervalScheduleBuilder |
withRepeatCount(int repeatCount)
Set number of times for interval to repeat. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Set<Integer> ALL_DAYS_OF_THE_WEEK
Calendar.SUNDAY
and Calendar.SATURDAY
(the integers from 1 through 7).
public static final Set<Integer> MONDAY_THROUGH_FRIDAY
Calendar.MONDAY
and Calendar.FRIDAY
(the integers from 2 through 6).
public static final Set<Integer> SATURDAY_AND_SUNDAY
Calendar.SATURDAY
and Calendar.SUNDAY
Constructor Detail |
---|
protected DailyTimeIntervalScheduleBuilder()
Method Detail |
---|
public static DailyTimeIntervalScheduleBuilder dailyTimeIntervalSchedule()
public MutableTrigger build()
build
in class ScheduleBuilder<DailyTimeIntervalTrigger>
TriggerBuilder.withSchedule(ScheduleBuilder)
public DailyTimeIntervalScheduleBuilder withInterval(int timeInterval, DateBuilder.IntervalUnit unit)
timeInterval
- the interval at which the trigger should repeat.unit
- the time unit (IntervalUnit) of the interval. The only intervals that are valid for this type of
trigger are DateBuilder.IntervalUnit.SECOND
, DateBuilder.IntervalUnit.MINUTE
, and DateBuilder.IntervalUnit.HOUR
.
DailyTimeIntervalTrigger.getRepeatInterval()
,
DailyTimeIntervalTrigger.getRepeatIntervalUnit()
public DailyTimeIntervalScheduleBuilder withIntervalInSeconds(int intervalInSeconds)
intervalInSeconds
- the number of seconds at which the trigger should repeat.
DailyTimeIntervalTrigger.getRepeatInterval()
,
DailyTimeIntervalTrigger.getRepeatIntervalUnit()
public DailyTimeIntervalScheduleBuilder withIntervalInMinutes(int intervalInMinutes)
intervalInMinutes
- the number of minutes at which the trigger should repeat.
DailyTimeIntervalTrigger.getRepeatInterval()
,
DailyTimeIntervalTrigger.getRepeatIntervalUnit()
public DailyTimeIntervalScheduleBuilder withIntervalInHours(int intervalInHours)
intervalInHours
- the number of hours at which the trigger should repeat.
DailyTimeIntervalTrigger.getRepeatInterval()
,
DailyTimeIntervalTrigger.getRepeatIntervalUnit()
public DailyTimeIntervalScheduleBuilder onDaysOfTheWeek(Set<Integer> onDaysOfWeek)
onDaysOfWeek
- a Set containing the integers representing the days of the week, per the values 1-7 as defined by
Calendar.SUNDAY
- Calendar.SATURDAY
.
public DailyTimeIntervalScheduleBuilder onDaysOfTheWeek(Integer... onDaysOfWeek)
onDaysOfWeek
- a variable length list of Integers representing the days of the week, per the values 1-7 as
defined by Calendar.SUNDAY
- Calendar.SATURDAY
.
public DailyTimeIntervalScheduleBuilder onMondayThroughFriday()
public DailyTimeIntervalScheduleBuilder onSaturdayAndSunday()
public DailyTimeIntervalScheduleBuilder onEveryDay()
public DailyTimeIntervalScheduleBuilder startingDailyAt(TimeOfDay timeOfDay)
public DailyTimeIntervalScheduleBuilder endingDailyAt(TimeOfDay timeOfDay)
public DailyTimeIntervalScheduleBuilder endingDailyAfterCount(int count)
public DailyTimeIntervalScheduleBuilder withMisfireHandlingInstructionIgnoreMisfires()
Trigger.MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY
instruction.
Trigger.MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY
public DailyTimeIntervalScheduleBuilder withMisfireHandlingInstructionDoNothing()
DailyTimeIntervalTrigger.MISFIRE_INSTRUCTION_DO_NOTHING
instruction.
DailyTimeIntervalTrigger.MISFIRE_INSTRUCTION_DO_NOTHING
public DailyTimeIntervalScheduleBuilder withMisfireHandlingInstructionFireAndProceed()
DailyTimeIntervalTrigger.MISFIRE_INSTRUCTION_FIRE_ONCE_NOW
instruction.
DailyTimeIntervalTrigger.MISFIRE_INSTRUCTION_FIRE_ONCE_NOW
public DailyTimeIntervalScheduleBuilder withRepeatCount(int repeatCount)
Note: if you want total count = 1 (at start time) + repeatCount
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |