Package com.google.gerrit.server.config
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 Summary
Constructors Constructor Description Schedule()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static Optional<ScheduleConfig.Schedule>
create(long interval, String startTime)
Creates a schedule.static ScheduleConfig.Schedule
createOrFail(long interval, String startTime)
Creates a schedule.abstract long
initialDelay()
Milliseconds between constructor invocation and first event time.abstract long
interval()
Number of milliseconds between events.
-
-
-
Method Detail
-
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 theinterval
andstartTime
parameters.- Parameters:
interval
- the interval in millisecondsstartTime
- 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 theinterval
andstartTime
parameters.- Parameters:
interval
- the interval in millisecondsstartTime
- 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
-
-