Interface IntervalTrigger

All Superinterfaces:
HasTriggerType, Trigger, TriggerRepresentation

public interface IntervalTrigger extends Trigger
Represents for inspecting settings specific to a IntervalTrigger.

An interval trigger is a schedule that repeats at a fixed interval of time starting from a given point in time, for example, hourly, daily, every five minutes, every 30 seconds and so on.

Since:
1.0.0
  • Field Details

    • TRIGGER_TYPE

      static final String TRIGGER_TYPE
      See Also:
    • REPEAT_INDEFINITELY

      static final long REPEAT_INDEFINITELY
      Used to indicate the 'repeat count' of the trigger is indefinite. Or in other words, the trigger should repeat continually until the trigger's ending timestamp.
      See Also:
  • Method Details

    • builder

      static IntervalTriggerBuilder builder()
    • type

      @NotNull default @NotNull String type()
      Description copied from interface: HasTriggerType
      Declares the trigger type
      Specified by:
      type in interface HasTriggerType
      Returns:
      the trigger type in string
    • getRepeat

      long getRepeat()
      Get the number of times the IntervalTrigger should repeat, after which it will be automatically deleted.
      See Also:
    • initialDelay

      @NotNull @NotNull Duration initialDelay()
      Returns:
      the initial delay time before emitting trigger in the first time.
      Since:
      2.0.0
    • interval

      @NotNull @NotNull Duration interval()
      Returns:
      the time interval at which the IntervalTrigger should repeat.
      Since:
      2.0.0
    • getInitialDelay

      @Deprecated default long getInitialDelay()
      Deprecated.
      Get the initial delay time (in getInitialDelayTimeUnit()) before emitting trigger in the first time.
      API Note:
      Default is 0
    • getInitialDelayTimeUnit

      @Deprecated @NotNull default @NotNull TimeUnit getInitialDelayTimeUnit()
      Deprecated.
      Delay time unit
      API Note:
      Default is SECONDS
    • getInterval

      @Deprecated default long getInterval()
      Deprecated.
      Get the time interval (in getIntervalTimeUnit()) at which the IntervalTrigger should repeat.
    • getIntervalTimeUnit

      @Deprecated @NotNull default @NotNull TimeUnit getIntervalTimeUnit()
      Deprecated.
      Interval time unit
      API Note:
      Default is SECONDS
    • validate

      @NotNull @NotNull IntervalTrigger validate()
      Description copied from interface: Trigger
      Do validate trigger in runtime.
      Specified by:
      validate in interface Trigger
      Returns:
      this for fluent API
    • toJson

      default io.vertx.core.json.JsonObject toJson()
      Description copied from interface: Trigger
      Serialize this trigger to json object that helps to persist in external system
      Specified by:
      toJson in interface Trigger
      Returns:
      trigger in json
    • create

      static IntervalTrigger create(Map<String,Object> properties)
    • nextTriggerTime

      @NotNull @NotNull Instant nextTriggerTime(@NotNull @NotNull Instant time)
      Calculates the next valid trigger time from a given time and the trigger configuration
      Parameters:
      time - the given time
      Returns:
      the next trigger time