Package org.quartz

Class DailyTimeIntervalScheduleBuilder


  • public class DailyTimeIntervalScheduleBuilder
    extends ScheduleBuilder<DailyTimeIntervalTrigger>
    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);
     
    Since:
    2.1.0
    Author:
    James House, Zemian Deng <[email protected]>