((SimpleScheduleBuilder)sched).withMisfireHandlingInstructionFireNow(); else if(triggerMisfireInstructionConst.equals("MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_EXISTING_COUNT")) ((SimpleScheduleBuilder)sched).withMisfireHandlingInstructionNextWithExistingCount(); else if(triggerMisfireInstructionConst.equals("MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT")) ((SimpleScheduleBuilder)sched).withMisfireHandlingInstructionNextWithRemainingCount();
((SimpleScheduleBuilder)sched).withMisfireHandlingInstructionFireNow(); else if(triggerMisfireInstructionConst.equals("MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_EXISTING_COUNT")) ((SimpleScheduleBuilder)sched).withMisfireHandlingInstructionNextWithExistingCount(); else if(triggerMisfireInstructionConst.equals("MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT")) ((SimpleScheduleBuilder)sched).withMisfireHandlingInstructionNextWithRemainingCount();
/** * 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; }
.withIdentity(buildName(), group) .withSchedule(simpleSchedule() .withMisfireHandlingInstructionNextWithExistingCount()) .startAt(Date.from(fireTime.atZone(systemDefault()).toInstant())) .usingJobData(jobDataMap)
scheduleBuilder.withMisfireHandlingInstructionNowWithRemainingCount(); else if (misfirePolicy == Every.MisfirePolicy.NEXT_WITH_EXISTING_COUNT) scheduleBuilder.withMisfireHandlingInstructionNextWithExistingCount(); else if (misfirePolicy == Every.MisfirePolicy.NEXT_WITH_REMAINING_COUNT) scheduleBuilder.withMisfireHandlingInstructionNextWithRemainingCount();
simpleScheduleBuilder.withMisfireHandlingInstructionNextWithExistingCount();
simpleScheduleBuilder.withMisfireHandlingInstructionNextWithExistingCount();