public static class JobSchedule.FallbackSchedule extends Object implements JobSchedule
JobSchedule.Builder<SELF>, JobSchedule.FallbackScheduleTYPE_FIELD| Constructor and Description |
|---|
FallbackSchedule() |
| 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() |
public String type()
type in interface JobSchedulepublic Optional<org.joda.time.DateTime> calculateNextTime(org.joda.time.DateTime lastExecutionTime, org.joda.time.DateTime lastNextTime)
JobScheduleOptional, 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)
calculateNextTime in interface JobSchedulelastExecutionTime - the last execution time of a triggerlastNextTime - the base time, chosen by the caller (mostly last nextTime)public Optional<Map<String,Object>> toDBUpdate(String fieldPrefix)
JobScheduleJacksonDBCollection#update())toDBUpdate in interface JobSchedulefieldPrefix - the field prefix to use for the map keyCopyright © 2012–2021 Graylog, Inc.. All rights reserved.