use of org.motechproject.scheduler.contract.RepeatingPeriodSchedulableJob in project motech by motech.
the class SchedulableJobValidatorTest method shouldThrowIllegalArgumentExceptionIfRepeatPeriodIsNull.
@Test(expected = IllegalArgumentException.class)
public void shouldThrowIllegalArgumentExceptionIfRepeatPeriodIsNull() {
RepeatingPeriodSchedulableJob job = new RepeatingPeriodSchedulableJob(motechEvent, DateTime.now(), null, null, false, true, true);
SchedulableJobValidator.validateRepeatingPeriodSchedulableJob(job);
}
use of org.motechproject.scheduler.contract.RepeatingPeriodSchedulableJob in project motech by motech.
the class SchedulableJobValidatorTest method shouldThrowIllegalArgumentExceptionIfMotechEventIsNullInRepeatingPeriodJob.
@Test(expected = IllegalArgumentException.class)
public void shouldThrowIllegalArgumentExceptionIfMotechEventIsNullInRepeatingPeriodJob() {
RepeatingPeriodSchedulableJob job = new RepeatingPeriodSchedulableJob(null, DateTime.now(), null, null, false, true, true);
SchedulableJobValidator.validateRepeatingPeriodSchedulableJob(job);
}
use of org.motechproject.scheduler.contract.RepeatingPeriodSchedulableJob in project motech by motech.
the class SchedulableJobBuilder method buildRepeatingPeriodSchedulableJob.
private static SchedulableJob buildRepeatingPeriodSchedulableJob(Trigger trigger, JobDataMap dataMap) {
PeriodIntervalTrigger periodTrigger = (PeriodIntervalTrigger) trigger;
RepeatingPeriodSchedulableJob job = new RepeatingPeriodSchedulableJob();
job.setEndDate(getEndDate(periodTrigger));
job.setRepeatPeriod(periodTrigger.getRepeatPeriod());
job.setIgnorePastFiresAtStart(dataMap.getBoolean(IGNORE_PAST_FIRES_AT_START));
job.setUseOriginalFireTimeAfterMisfire(dataMap.getBoolean(USE_ORIGINAL_FIRE_TIME_AFTER_MISFIRE));
return job;
}
use of org.motechproject.scheduler.contract.RepeatingPeriodSchedulableJob in project motech by motech.
the class MotechSchedulerActionProxyServiceImpl method scheduleRepeatingPeriodJob.
@Override
public void scheduleRepeatingPeriodJob(String subject, Map<Object, Object> parameters, DateTime startTime, DateTime endTime, Period repeatPeriod, Boolean ignorePastFiresAtStart, Boolean useOriginalFireTimeAfterMisfire) {
MotechEvent motechEvent = new MotechEvent(subject, createMotechEventParameters(parameters));
RepeatingPeriodSchedulableJob job = new RepeatingPeriodSchedulableJob(motechEvent, startTime, endTime, repeatPeriod, ignorePastFiresAtStart);
job.setUseOriginalFireTimeAfterMisfire(useOriginalFireTimeAfterMisfire);
scheduler.scheduleRepeatingPeriodJob(job);
}
Aggregations