Class TimeValueSchedule

java.lang.Object
org.elasticsearch.common.scheduler.TimeValueSchedule
All Implemented Interfaces:
SchedulerEngine.Schedule

public class TimeValueSchedule extends Object implements SchedulerEngine.Schedule
SchedulerEngine.Schedule implementation wrapping a TimeValue interval that'll compute the next scheduled execution time according to the configured interval.
  • Constructor Details

    • TimeValueSchedule

      public TimeValueSchedule(TimeValue interval)
  • Method Details

    • getInterval

      public TimeValue getInterval()
    • nextScheduledTimeAfter

      public long nextScheduledTimeAfter(long startTime, long time)
      Description copied from interface: SchedulerEngine.Schedule
      Returns the next scheduled time after the given time, according to this schedule. If the given schedule cannot resolve the next scheduled time, then -1 is returned. It really depends on the type of schedule to determine when -1 is returned. Some schedules (e.g. IntervalSchedule) will never return -1 as they can always compute the next scheduled time. Cron based schedules are good example of schedules that may return -1, for example, when the schedule only points to times that are all before the given time (in which case, there is no next scheduled time for the given time). Example: cron 0 0 0 * 1 ? 2013 (only points to days in January 2013) time 2015-01-01 12:00:00 (this time is in 2015)
      Specified by:
      nextScheduledTimeAfter in interface SchedulerEngine.Schedule
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object