@Override public void setEndTime(Date endTime) { Date sTime = getStartTime(); if (sTime != null && endTime != null && sTime.after(endTime)) { throw new IllegalArgumentException("End time cannot be before start time"); } this.endTime = endTime; }
@Override public void setEndTime(Date endTime) { Date sTime = getStartTime(); if (sTime != null && endTime != null && sTime.after(endTime)) { throw new IllegalArgumentException("End time cannot be before start time"); } this.endTime = endTime; }
@Override public void setEndTime(Date endTime) { Date sTime = getStartTime(); if (sTime != null && endTime != null && sTime.after(endTime)) { throw new IllegalArgumentException("End time cannot be before start time"); } this.endTime = endTime; }
/** * <p> * NOT YET IMPLEMENTED: Returns the final time at which the <code>CronTrigger</code> will fire. * </p> * <p> * Note that the return time *may* be in the past. and the date returned is not validated against org.quartz.calendar * </p> */ @Override public Date getFinalFireTime() { Date resultTime; if (getEndTime() != null) { resultTime = getTimeBefore(new Date(getEndTime().getTime() + 1000l)); } else { resultTime = (cronEx == null) ? null : cronEx.getFinalFireTime(); } if ((resultTime != null) && (getStartTime() != null) && (resultTime.before(getStartTime()))) { return null; } return resultTime; }
/** * NOT YET IMPLEMENTED: Returns the final time at which the <code>CronTrigger</code> will fire. * * <p>Note that the return time *may* be in the past. and the date returned is not validated * against org.quartz.calendar */ @Override public Date getFinalFireTime() { Date resultTime; if (getEndTime() != null) { resultTime = getTimeBefore(new Date(getEndTime().getTime() + 1000l)); } else { resultTime = (cronEx == null) ? null : cronEx.getFinalFireTime(); } if ((resultTime != null) && (getStartTime() != null) && (resultTime.before(getStartTime()))) { return null; } return resultTime; }
/** * <p> * NOT YET IMPLEMENTED: Returns the final time at which the <code>CronTrigger</code> will fire. * </p> * <p> * Note that the return time *may* be in the past. and the date returned is not validated against org.quartz.calendar * </p> */ @Override public Date getFinalFireTime() { Date resultTime; if (getEndTime() != null) { resultTime = getTimeBefore(new Date(getEndTime().getTime() + 1000l)); } else { resultTime = (cronEx == null) ? null : cronEx.getFinalFireTime(); } if ((resultTime != null) && (getStartTime() != null) && (resultTime.before(getStartTime()))) { return null; } return resultTime; }
/** * <p> * Called by the scheduler at the time a <code>Trigger</code> is first added to the scheduler, in order to have the <code>Trigger</code> compute its * first fire time, based on any associated calendar. * </p> * <p> * After this method has been called, <code>getNextFireTime()</code> should return a valid answer. * </p> * * @return the first time at which the <code>Trigger</code> will be fired by the scheduler, which is also the same value * <code>getNextFireTime()</code> will return (until after the first firing of the <code>Trigger</code>). </p> */ @Override public Date computeFirstFireTime(org.quartz.core.Calendar calendar) { nextFireTime = getFireTimeAfter(new Date(getStartTime().getTime() - 1000l)); while (nextFireTime != null && calendar != null && !calendar.isTimeIncluded(nextFireTime.getTime())) { nextFireTime = getFireTimeAfter(nextFireTime); } return nextFireTime; }
/** * Returns the next time at which the <code>CronTrigger</code> will fire, after the given time. If * the trigger will not fire after the given time, <code>null</code> will be returned. * * <p>Note that the date returned is NOT validated against the related org.quartz.Calendar (if * any) */ @Override public Date getFireTimeAfter(Date afterTime) { if (afterTime == null) { afterTime = new Date(); } if (getStartTime().after(afterTime)) { afterTime = new Date(getStartTime().getTime() - 1000l); } if (getEndTime() != null && (afterTime.compareTo(getEndTime()) >= 0)) { return null; } Date pot = getTimeAfter(afterTime); if (getEndTime() != null && pot != null && pot.after(getEndTime())) { return null; } return pot; }
/** * Called by the scheduler at the time a <code>Trigger</code> is first added to the scheduler, in * order to have the <code>Trigger</code> compute its first fire time, based on any associated * calendar. * * <p>After this method has been called, <code>getNextFireTime()</code> should return a valid * answer. * * @return the first time at which the <code>Trigger</code> will be fired by the scheduler, which * is also the same value <code>getNextFireTime()</code> will return (until after the first * firing of the <code>Trigger</code>). */ @Override public Date computeFirstFireTime(org.quartz.core.Calendar calendar) { nextFireTime = getFireTimeAfter(new Date(getStartTime().getTime() - 1000l)); while (nextFireTime != null && calendar != null && !calendar.isTimeIncluded(nextFireTime.getTime())) { nextFireTime = getFireTimeAfter(nextFireTime); } return nextFireTime; }
/** * <p> * Called by the scheduler at the time a <code>Trigger</code> is first added to the scheduler, in order to have the <code>Trigger</code> compute its * first fire time, based on any associated calendar. * </p> * <p> * After this method has been called, <code>getNextFireTime()</code> should return a valid answer. * </p> * * @return the first time at which the <code>Trigger</code> will be fired by the scheduler, which is also the same value * <code>getNextFireTime()</code> will return (until after the first firing of the <code>Trigger</code>). * </p> */ @Override public Date computeFirstFireTime(org.quartz.core.Calendar calendar) { nextFireTime = getFireTimeAfter(new Date(getStartTime().getTime() - 1000l)); while (nextFireTime != null && calendar != null && !calendar.isTimeIncluded(nextFireTime.getTime())) { nextFireTime = getFireTimeAfter(nextFireTime); } return nextFireTime; }
/** * <p> * Returns the next time at which the <code>CronTrigger</code> will fire, after the given time. If the trigger will not fire after the given time, * <code>null</code> will be returned. * </p> * <p> * Note that the date returned is NOT validated against the related org.quartz.Calendar (if any) * </p> */ @Override public Date getFireTimeAfter(Date afterTime) { if (afterTime == null) { afterTime = new Date(); } if (getStartTime().after(afterTime)) { afterTime = new Date(getStartTime().getTime() - 1000l); } if (getEndTime() != null && (afterTime.compareTo(getEndTime()) >= 0)) { return null; } Date pot = getTimeAfter(afterTime); if (getEndTime() != null && pot != null && pot.after(getEndTime())) { return null; } return pot; }
/** * <p> * Returns the next time at which the <code>CronTrigger</code> will fire, after the given time. If the trigger will not fire after the given time, * <code>null</code> will be returned. * </p> * <p> * Note that the date returned is NOT validated against the related org.quartz.Calendar (if any) * </p> */ @Override public Date getFireTimeAfter(Date afterTime) { if (afterTime == null) { afterTime = new Date(); } if (getStartTime().after(afterTime)) { afterTime = new Date(getStartTime().getTime() - 1000l); } if (getEndTime() != null && (afterTime.compareTo(getEndTime()) >= 0)) { return null; } Date pot = getTimeAfter(afterTime); if (getEndTime() != null && pot != null && pot.after(getEndTime())) { return null; } return pot; }