Class ScheduleConfig.Schedule

java.lang.Object
com.google.gerrit.server.config.ScheduleConfig.Schedule
Enclosing class:
ScheduleConfig

public abstract static class ScheduleConfig.Schedule extends Object
  • Constructor Details

    • Schedule

      public Schedule()
  • Method Details

    • interval

      public abstract long interval()
      Number of milliseconds between events.
    • initialDelay

      public abstract long initialDelay()
      Milliseconds between constructor invocation and first event time.

      If there is any lag between the constructor invocation and queuing the object into an executor the event will run later, as there is no method to adjust for the scheduling delay.

    • createOrFail

      public static ScheduleConfig.Schedule createOrFail(long interval, String startTime)
      Creates a schedule.

      ScheduleConfig defines details about which values are valid for the interval and startTime parameters.

      Parameters:
      interval - the interval in milliseconds
      startTime - the start time as "<day of week> <hours>:<minutes>" or " <hours>:<minutes>"
      Returns:
      the schedule
      Throws:
      IllegalArgumentException - if any of the parameters is invalid
    • create

      public static Optional<ScheduleConfig.Schedule> create(long interval, String startTime)
      Creates a schedule.

      ScheduleConfig defines details about which values are valid for the interval and startTime parameters.

      Parameters:
      interval - the interval in milliseconds
      startTime - the start time as "<day of week> <hours>:<minutes>" or " <hours>:<minutes>"
      Returns:
      the schedule or Optional.empty() if any of the parameters is invalid