Interface Schedule

All Superinterfaces:
org.opensearch.common.xcontent.ToXContent, org.opensearch.common.xcontent.ToXContentObject, org.opensearch.common.io.stream.Writeable
All Known Implementing Classes:
CronSchedule, IntervalSchedule

public interface Schedule
extends org.opensearch.common.io.stream.Writeable, org.opensearch.common.xcontent.ToXContentObject
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.opensearch.common.xcontent.ToXContent

    org.opensearch.common.xcontent.ToXContent.DelegatingMapParams, org.opensearch.common.xcontent.ToXContent.MapParams, org.opensearch.common.xcontent.ToXContent.Params

    Nested classes/interfaces inherited from interface org.opensearch.common.io.stream.Writeable

    org.opensearch.common.io.stream.Writeable.Reader<V extends java.lang.Object>, org.opensearch.common.io.stream.Writeable.Writer<V extends java.lang.Object>
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static java.lang.String DELAY_FIELD  

    Fields inherited from interface org.opensearch.common.xcontent.ToXContent

    EMPTY_PARAMS
  • Method Summary

    Modifier and Type Method Description
    java.lang.Long getDelay()
    Gets the delay parameter of the schedule.
    java.time.Instant getNextExecutionTime​(java.time.Instant time)
    Gets next job execution time of given time parameter.
    org.opensearch.common.collect.Tuple<java.time.Instant,​java.time.Instant> getPeriodStartingAt​(java.time.Instant startTime)
    Gets the execution period starting at startTime.
    java.time.Duration nextTimeToExecute()
    Calculates the time duration between next execution time and now.
    java.lang.Boolean runningOnTime​(java.time.Instant lastExecutionTime)
    Returns if the job is running on time.

    Methods inherited from interface org.opensearch.common.xcontent.ToXContent

    toXContent

    Methods inherited from interface org.opensearch.common.xcontent.ToXContentObject

    isFragment

    Methods inherited from interface org.opensearch.common.io.stream.Writeable

    writeTo
  • Field Details

  • Method Details

    • getNextExecutionTime

      java.time.Instant getNextExecutionTime​(java.time.Instant time)
      Gets next job execution time of given time parameter.
      Parameters:
      time - base time point
      Returns:
      next execution time since time parameter.
    • nextTimeToExecute

      java.time.Duration nextTimeToExecute()
      Calculates the time duration between next execution time and now.
      Returns:
      time duration between next execution and now.
    • getPeriodStartingAt

      org.opensearch.common.collect.Tuple<java.time.Instant,​java.time.Instant> getPeriodStartingAt​(java.time.Instant startTime)
      Gets the execution period starting at startTime.
      Parameters:
      startTime - start time of the period.
      Returns:
      the start time and end time of the period in the tuple.
    • runningOnTime

      java.lang.Boolean runningOnTime​(java.time.Instant lastExecutionTime)
      Returns if the job is running on time.
      Parameters:
      lastExecutionTime - last execution time.
      Returns:
      true if the job executes on time, otherwise false.
    • getDelay

      java.lang.Long getDelay()
      Gets the delay parameter of the schedule.
      Returns:
      the delay parameter of the schedule as a Long.