public abstract class ScheduleConfig
extends java.lang.Object
A schedule configuration consists of two parameters:
interval
: Interval for running the periodic background job. The interval must be
larger than zero. The following suffixes are supported to define the time unit for the
interval:
s
, sec
, second
, seconds
m
, min
, minute
, minutes
h
, hr
, hour
, hours
d
, day
, days
w
, week
, weeks
(1 week
is treated as 7 days
)
mon
, month
, months
(1 month
is treated as 30
days
)
y
, year
, years
(1 year
is treated as 365
days
)
startTime
: The start time defines the first execution of the periodic background
job. If the configured interval
is shorter than startTime - now
the start
time will be preponed by the maximum integral multiple of interval
so that the
start time is still in the future. startTime
must have one of the following
formats:
<day of week> <hours>:<minutes>
<hours>:<minutes>
<day of week>
: Mon
, Tue
, Wed
, Thu
, Fri
, Sat
, Sun
<hours>
: 00
-23
<minutes>
: 00
-59
The section and the subsection from which the interval
and startTime
parameters are read can be configured.
Examples for a schedule configuration:
foo.startTime = Fri 10:30 foo.interval = 2 dayAssuming that the server is started on
Mon 7:00
then startTime - now
is
4 days 3:30 hours
. This is larger than the interval hence the start time is
preponed by the maximum integral multiple of the interval so that start time is still in
the future, i.e. preponed by 4 days. This yields a start time of Mon 10:30
, next
executions are Wed 10:30
, Fri 10:30
. etc.
foo.startTime = 06:00 foo.interval = 1 dayAssuming that the server is started on
Mon 7:00
then this yields the first run on
next Tuesday at 6:00 and a repetition interval of 1 day.
Modifier and Type | Class and Description |
---|---|
static class |
ScheduleConfig.Builder |
static class |
ScheduleConfig.Schedule |
Constructor and Description |
---|
ScheduleConfig() |
Modifier and Type | Method and Description |
---|---|
static ScheduleConfig.Builder |
builder(org.eclipse.jgit.lib.Config config,
java.lang.String section) |
static java.util.Optional<ScheduleConfig.Schedule> |
createSchedule(org.eclipse.jgit.lib.Config config,
java.lang.String section) |
java.util.Optional<ScheduleConfig.Schedule> |
schedule() |
java.lang.String |
toString() |
public static java.util.Optional<ScheduleConfig.Schedule> createSchedule(org.eclipse.jgit.lib.Config config, java.lang.String section)
public static ScheduleConfig.Builder builder(org.eclipse.jgit.lib.Config config, java.lang.String section)
@Memoized public java.util.Optional<ScheduleConfig.Schedule> schedule()
public final java.lang.String toString()
toString
in class java.lang.Object