Search in sources :

Example 1 with CronExpressionUtil

use of org.motechproject.scheduler.util.CronExpressionUtil in project motech by motech.

the class SchedulableJobBuilder method buildDayOfWeekSchedulableJob.

private static SchedulableJob buildDayOfWeekSchedulableJob(Trigger trigger, JobDataMap dataMap) {
    CronTrigger cronTrigger = (CronTrigger) trigger;
    DayOfWeekSchedulableJob job = new DayOfWeekSchedulableJob();
    job.setEndDate(getEndDate(trigger));
    job.setIgnorePastFiresAtStart(dataMap.getBoolean(IGNORE_PAST_FIRES_AT_START));
    CronExpressionUtil cronExpressionUtil = new CronExpressionUtil(cronTrigger.getCronExpression());
    job.setTime(cronExpressionUtil.getTime());
    job.setDays(cronExpressionUtil.getDaysOfWeek());
    return job;
}
Also used : CronExpressionUtil(org.motechproject.scheduler.util.CronExpressionUtil) CronTrigger(org.quartz.CronTrigger) DayOfWeekSchedulableJob(org.motechproject.scheduler.contract.DayOfWeekSchedulableJob)

Aggregations

DayOfWeekSchedulableJob (org.motechproject.scheduler.contract.DayOfWeekSchedulableJob)1 CronExpressionUtil (org.motechproject.scheduler.util.CronExpressionUtil)1 CronTrigger (org.quartz.CronTrigger)1