((SimpleScheduleBuilder)sched).withMisfireHandlingInstructionNextWithExistingCount(); else if(triggerMisfireInstructionConst.equals("MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT")) ((SimpleScheduleBuilder)sched).withMisfireHandlingInstructionNextWithRemainingCount(); else if(triggerMisfireInstructionConst.equals("MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT")) ((SimpleScheduleBuilder)sched).withMisfireHandlingInstructionNowWithExistingCount();
((SimpleScheduleBuilder)sched).withMisfireHandlingInstructionNextWithExistingCount(); else if(triggerMisfireInstructionConst.equals("MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT")) ((SimpleScheduleBuilder)sched).withMisfireHandlingInstructionNextWithRemainingCount(); else if(triggerMisfireInstructionConst.equals("MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT")) ((SimpleScheduleBuilder)sched).withMisfireHandlingInstructionNowWithExistingCount();
/** * Get a {@link ScheduleBuilder} that is configured to produce a * schedule identical to this trigger's schedule. * * @see #getTriggerBuilder() */ @Override public ScheduleBuilder<SimpleTrigger> getScheduleBuilder() { SimpleScheduleBuilder sb = SimpleScheduleBuilder.simpleSchedule() .withIntervalInMilliseconds(getRepeatInterval()) .withRepeatCount(getRepeatCount()); switch(getMisfireInstruction()) { case MISFIRE_INSTRUCTION_FIRE_NOW : sb.withMisfireHandlingInstructionFireNow(); break; case MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_EXISTING_COUNT : sb.withMisfireHandlingInstructionNextWithExistingCount(); break; case MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT : sb.withMisfireHandlingInstructionNextWithRemainingCount(); break; case MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT : sb.withMisfireHandlingInstructionNowWithExistingCount(); break; case MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_REMAINING_REPEAT_COUNT : sb.withMisfireHandlingInstructionNowWithRemainingCount(); break; } return sb; }
/** * Get a {@link ScheduleBuilder} that is configured to produce a * schedule identical to this trigger's schedule. * * @see #getTriggerBuilder() */ @Override public ScheduleBuilder<SimpleTrigger> getScheduleBuilder() { SimpleScheduleBuilder sb = SimpleScheduleBuilder.simpleSchedule() .withIntervalInMilliseconds(getRepeatInterval()) .withRepeatCount(getRepeatCount()); switch(getMisfireInstruction()) { case MISFIRE_INSTRUCTION_FIRE_NOW : sb.withMisfireHandlingInstructionFireNow(); break; case MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_EXISTING_COUNT : sb.withMisfireHandlingInstructionNextWithExistingCount(); break; case MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT : sb.withMisfireHandlingInstructionNextWithRemainingCount(); break; case MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT : sb.withMisfireHandlingInstructionNowWithExistingCount(); break; case MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_REMAINING_REPEAT_COUNT : sb.withMisfireHandlingInstructionNowWithRemainingCount(); break; } return sb; }
private SimpleScheduleBuilder setMisfirePolicyForSimpleTrigger(SimpleScheduleBuilder simpleSchedule, String motechMisfireProperty) { Integer misfirePolicy = simpleTriggerMisfirePolicies.get(motechMisfireProperty); if (misfirePolicy == null) { misfirePolicy = SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT; } if (misfirePolicy.equals(SimpleTrigger.MISFIRE_INSTRUCTION_SMART_POLICY)) { return simpleSchedule; } if (misfirePolicy.equals(SimpleTrigger.MISFIRE_INSTRUCTION_FIRE_NOW)) { return simpleSchedule.withMisfireHandlingInstructionFireNow(); } if (misfirePolicy.equals(SimpleTrigger.MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY)) { return simpleSchedule.withMisfireHandlingInstructionIgnoreMisfires(); } if (misfirePolicy.equals(SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_EXISTING_COUNT)) { return simpleSchedule.withMisfireHandlingInstructionNextWithExistingCount(); } if (misfirePolicy.equals(SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT)) { return simpleSchedule.withMisfireHandlingInstructionNextWithRemainingCount(); } if (misfirePolicy.equals(SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT)) { return simpleSchedule.withMisfireHandlingInstructionNowWithExistingCount(); } if (misfirePolicy.equals(SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_REMAINING_REPEAT_COUNT)) { return simpleSchedule.withMisfireHandlingInstructionNowWithRemainingCount(); } return simpleSchedule; }
withSchedule( SimpleScheduleBuilder.repeatSecondlyForever((int) deleteIntervalInSecs). withMisfireHandlingInstructionNextWithRemainingCount() ). startAt(new Date(System.currentTimeMillis() + (deleteIntervalInSecs * 1000))).
scheduleBuilder.withMisfireHandlingInstructionNextWithExistingCount(); else if (misfirePolicy == Every.MisfirePolicy.NEXT_WITH_REMAINING_COUNT) scheduleBuilder.withMisfireHandlingInstructionNextWithRemainingCount();
simpleScheduleBuilder.withMisfireHandlingInstructionNextWithRemainingCount();
switch (repeatTrigger.getMisfireHandlingPolicy()) { case NONE: scheduleBuilder.withMisfireHandlingInstructionNextWithRemainingCount(); break; case ALL:
simpleScheduleBuilder.withMisfireHandlingInstructionNextWithRemainingCount();
switch (repeatTrigger.getMisfireHandlingPolicy()) { case NONE: scheduleBuilder.withMisfireHandlingInstructionNextWithRemainingCount(); break; case ALL:
sb = ssb.withMisfireHandlingInstructionFireNow(); } else if (sch.getMisfireAction() == MisfireActionType.RESCHEDULE) { sb = ssb.withMisfireHandlingInstructionNextWithRemainingCount(); } else { throw new SystemException("Invalid value of misfireAction: " + sch.getMisfireAction() + " for task " + task);