public static OperableTrigger newTrigger(CompositeData cData) throws ParseException { SimpleTriggerImpl result = new SimpleTriggerImpl(); result.setRepeatCount(((Integer) cData.get("repeatCount")).intValue()); result.setRepeatInterval(((Long) cData.get("repeatInterval")).longValue()); result.setTimesTriggered(((Integer) cData.get("timesTriggered")).intValue()); TriggerSupport.initializeTrigger(result, cData); return result; }
public static OperableTrigger newTrigger(Map<String, Object> attrMap) throws ParseException { SimpleTriggerImpl result = new SimpleTriggerImpl(); if(attrMap.containsKey("repeatCount")) { result.setRepeatCount(((Integer) attrMap.get("repeatCount")).intValue()); } if(attrMap.containsKey("repeatInterval")) { result.setRepeatInterval(((Long) attrMap.get("repeatInterval")).longValue()); } if(attrMap.containsKey("timesTriggered")) { result.setTimesTriggered(((Integer) attrMap.get("timesTriggered")).intValue()); } TriggerSupport.initializeTrigger(result, attrMap); return result; } }
/** * Build the actual Trigger -- NOT intended to be invoked by end users, * but will rather be invoked by a TriggerBuilder which this * ScheduleBuilder is given to. * * @see TriggerBuilder#withSchedule(ScheduleBuilder) */ @Override public MutableTrigger build() { SimpleTriggerImpl st = new SimpleTriggerImpl(); st.setRepeatInterval(interval); st.setRepeatCount(repeatCount); st.setMisfireInstruction(misfireInstruction); return st; }
/** * Build the actual Trigger -- NOT intended to be invoked by end users, * but will rather be invoked by a TriggerBuilder which this * ScheduleBuilder is given to. * * @see TriggerBuilder#withSchedule(ScheduleBuilder) */ @Override public MutableTrigger build() { SimpleTriggerImpl st = new SimpleTriggerImpl(); st.setRepeatInterval(interval); st.setRepeatCount(repeatCount); st.setMisfireInstruction(misfireInstruction); return st; }
@Override public void afterPropertiesSet() { if (this.name == null) { this.name = this.beanName; } if (this.group == null) { this.group = Scheduler.DEFAULT_GROUP; } if (this.jobDetail != null) { this.jobDataMap.put("jobDetail", this.jobDetail); } if (this.startDelay > 0 || this.startTime == null) { this.startTime = new Date(System.currentTimeMillis() + this.startDelay); } SimpleTriggerImpl sti = new SimpleTriggerImpl(); sti.setName(this.name != null ? this.name : toString()); sti.setGroup(this.group); if (this.jobDetail != null) { sti.setJobKey(this.jobDetail.getKey()); } sti.setJobDataMap(this.jobDataMap); sti.setStartTime(this.startTime); sti.setRepeatInterval(this.repeatInterval); sti.setRepeatCount(this.repeatCount); sti.setPriority(this.priority); sti.setMisfireInstruction(this.misfireInstruction); sti.setDescription(this.description); this.simpleTrigger = sti; }
setEndTime(endTime); setRepeatCount(repeatCount); setRepeatInterval(repeatInterval);
/** * <p> * Create a <code>SimpleTrigger</code> that will occur at the given time, * and repeat at the the given interval the given number of times, or until * the given end time. * </p> * * @param startTime * A <code>Date</code> set to the time for the <code>Trigger</code> * to fire. * @param endTime * A <code>Date</code> set to the time for the <code>Trigger</code> * to quit repeat firing. * @param repeatCount * The number of times for the <code>Trigger</code> to repeat * firing, use {@link #REPEAT_INDEFINITELY} for unlimited times. * @param repeatInterval * The number of milliseconds to pause between the repeat firing. * * @deprecated use a TriggerBuilder instead */ @Deprecated public SimpleTriggerImpl(String name, String group, Date startTime, Date endTime, int repeatCount, long repeatInterval) { super(name, group); setStartTime(startTime); setEndTime(endTime); setRepeatCount(repeatCount); setRepeatInterval(repeatInterval); }
/** * <p> * Create a <code>SimpleTrigger</code> that will occur at the given time, * and repeat at the the given interval the given number of times, or until * the given end time. * </p> * * @param startTime * A <code>Date</code> set to the time for the <code>Trigger</code> * to fire. * @param endTime * A <code>Date</code> set to the time for the <code>Trigger</code> * to quit repeat firing. * @param repeatCount * The number of times for the <code>Trigger</code> to repeat * firing, use {@link #REPEAT_INDEFINITELY} for unlimited times. * @param repeatInterval * The number of milliseconds to pause between the repeat firing. * * @deprecated use a TriggerBuilder instead */ @Deprecated public SimpleTriggerImpl(String name, String group, Date startTime, Date endTime, int repeatCount, long repeatInterval) { super(name, group); setStartTime(startTime); setEndTime(endTime); setRepeatCount(repeatCount); setRepeatInterval(repeatInterval); }
setEndTime(endTime); setRepeatCount(repeatCount); setRepeatInterval(repeatInterval);
@Override public void afterPropertiesSet() { if (this.name == null) { this.name = this.beanName; } if (this.group == null) { this.group = Scheduler.DEFAULT_GROUP; } if (this.jobDetail != null) { this.jobDataMap.put("jobDetail", this.jobDetail); } if (this.startDelay > 0 || this.startTime == null) { this.startTime = new Date(System.currentTimeMillis() + this.startDelay); } SimpleTriggerImpl sti = new SimpleTriggerImpl(); sti.setName(this.name != null ? this.name : toString()); sti.setGroup(this.group); if (this.jobDetail != null) { sti.setJobKey(this.jobDetail.getKey()); } sti.setJobDataMap(this.jobDataMap); sti.setStartTime(this.startTime); sti.setRepeatInterval(this.repeatInterval); sti.setRepeatCount(this.repeatCount); sti.setPriority(this.priority); sti.setMisfireInstruction(this.misfireInstruction); sti.setDescription(this.description); this.simpleTrigger = sti; }
@JsonProperty("repeat_interval") public void setRepeatInterval(long repeatInterval) { getTrigger().setRepeatInterval(repeatInterval); }
public static OperableTrigger newTrigger(CompositeData cData) throws ParseException { SimpleTriggerImpl result = new SimpleTriggerImpl(); result.setRepeatCount(((Integer) cData.get("repeatCount")).intValue()); result.setRepeatInterval(((Long) cData.get("repeatInterval")).longValue()); result.setTimesTriggered(((Integer) cData.get("timesTriggered")).intValue()); TriggerSupport.initializeTrigger(result, cData); return result; }
public static OperableTrigger newTrigger(Map<String, Object> attrMap) throws ParseException { SimpleTriggerImpl result = new SimpleTriggerImpl(); if(attrMap.containsKey("repeatCount")) { result.setRepeatCount(((Integer) attrMap.get("repeatCount")).intValue()); } if(attrMap.containsKey("repeatInterval")) { result.setRepeatInterval(((Long) attrMap.get("repeatInterval")).longValue()); } if(attrMap.containsKey("timesTriggered")) { result.setTimesTriggered(((Integer) attrMap.get("timesTriggered")).intValue()); } TriggerSupport.initializeTrigger(result, attrMap); return result; } }
private OperableTrigger toOperableTrigger(TriggerKey triggerKey, Map<String, String> trigger) { if (TRIGGER_TYPE_SIMPLE.equals(trigger.get(TRIGGER_TYPE))) { SimpleTriggerImpl simpleTrigger = new SimpleTriggerImpl(); setOperableTriggerFields(triggerKey, trigger, simpleTrigger); if (trigger.get(REPEAT_COUNT) != null && !trigger.get(REPEAT_COUNT).isEmpty()) simpleTrigger.setRepeatCount(Integer.parseInt(trigger.get(REPEAT_COUNT))); if (trigger.get(REPEAT_INTERVAL) != null && !trigger.get(REPEAT_INTERVAL).isEmpty()) simpleTrigger.setRepeatInterval(Long.parseLong(trigger.get(REPEAT_INTERVAL))); if (trigger.get(TIMES_TRIGGERED) != null && !trigger.get(TIMES_TRIGGERED).isEmpty()) simpleTrigger.setTimesTriggered(Integer.parseInt(trigger.get(TIMES_TRIGGERED))); return simpleTrigger; } else if (TRIGGER_TYPE_CRON.equals(trigger.get(TRIGGER_TYPE))) { CronTriggerImpl cronTrigger = new CronTriggerImpl(); setOperableTriggerFields(triggerKey, trigger, cronTrigger); if (trigger.get(TIME_ZONE_ID) != null && !trigger.get(TIME_ZONE_ID).isEmpty()) cronTrigger.getTimeZone().setID(trigger.get(TIME_ZONE_ID).isEmpty() ? null : trigger.get(TIME_ZONE_ID)); try { if (trigger.get(CRON_EXPRESSION) != null && !trigger.get(CRON_EXPRESSION).isEmpty()) cronTrigger.setCronExpression(trigger.get(CRON_EXPRESSION).isEmpty() ? null : trigger.get(CRON_EXPRESSION)); } catch (ParseException ex) { log.warn("could not parse cron_expression: " + trigger.get(CRON_EXPRESSION) + " for trigger: " + createTriggerHashKey(triggerKey.getGroup(), triggerKey.getName())); } return cronTrigger; } else { // other trigger types are not supported throw new UnsupportedOperationException(); } }
simpleTrigger.setRepeatInterval(repeatInterval);
@Override public void afterPropertiesSet() { if (this.name == null) { this.name = this.beanName; } if (this.group == null) { this.group = Scheduler.DEFAULT_GROUP; } if (this.jobDetail != null) { this.jobDataMap.put("jobDetail", this.jobDetail); } if (this.startDelay > 0 || this.startTime == null) { this.startTime = new Date(System.currentTimeMillis() + this.startDelay); } SimpleTriggerImpl sti = new SimpleTriggerImpl(); sti.setName(this.name); sti.setGroup(this.group); if (this.jobDetail != null) { sti.setJobKey(this.jobDetail.getKey()); } sti.setJobDataMap(this.jobDataMap); sti.setStartTime(this.startTime); sti.setRepeatInterval(this.repeatInterval); sti.setRepeatCount(this.repeatCount); sti.setPriority(this.priority); sti.setMisfireInstruction(this.misfireInstruction); sti.setDescription(this.description); this.simpleTrigger = sti; }
trigger.setRepeatInterval(Long.valueOf(event.getPeriod()));
simple.setRepeatInterval((Long)repeatInterval);