public interface JobSchedule
| Modifier and Type | Interface and Description |
|---|---|
static interface |
JobSchedule.Builder<SELF> |
static class |
JobSchedule.FallbackSchedule |
| Modifier and Type | Field and Description |
|---|---|
static String |
TYPE_FIELD |
| Modifier and Type | Method and Description |
|---|---|
Optional<org.joda.time.DateTime> |
calculateNextTime(org.joda.time.DateTime lastExecutionTime,
org.joda.time.DateTime lastNextTime)
Calculates the next time a job should be executed based on the schedule implementation.
|
Optional<Map<String,Object>> |
toDBUpdate(String fieldPrefix)
Returns a map with the schedule data.
|
String |
type() |
static final String TYPE_FIELD
String type()
Optional<org.joda.time.DateTime> calculateNextTime(org.joda.time.DateTime lastExecutionTime, org.joda.time.DateTime lastNextTime)
Optional, there will be no next execution time. (e.g. for one-off jobs)
The lastExecutionTime parameter is the last execution time of the trigger. This can be used to detect
if the trigger has been executed way later than the lastNextTime.
The lastNextTime parameter is the last nextTime of the job trigger. This can be used to
calculate the new next time. Using the previous nextTime as base for the new one is more accurate than
using the current time. (e.g. because of delayed execution and job duration)
lastExecutionTime - the last execution time of a triggerlastNextTime - the base time, chosen by the caller (mostly last nextTime)Optional<Map<String,Object>> toDBUpdate(String fieldPrefix)
JacksonDBCollection#update())fieldPrefix - the field prefix to use for the map keyCopyright © 2012–2021 Graylog, Inc.. All rights reserved.