public abstract class OnceJobSchedule extends Object implements JobSchedule
| Modifier and Type | Class and Description |
|---|---|
static class |
OnceJobSchedule.Builder |
JobSchedule.FallbackSchedule| Modifier and Type | Field and Description |
|---|---|
static String |
TYPE_NAME |
TYPE_FIELD| Constructor and Description |
|---|
OnceJobSchedule() |
| Modifier and Type | Method and Description |
|---|---|
static OnceJobSchedule.Builder |
builder() |
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.
|
static OnceJobSchedule |
create() |
abstract OnceJobSchedule.Builder |
toBuilder() |
Optional<Map<String,Object>> |
toDBUpdate(String fieldPrefix)
Returns a map with the schedule data.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittypepublic static final String TYPE_NAME
public 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 keypublic static OnceJobSchedule create()
public static OnceJobSchedule.Builder builder()
public abstract OnceJobSchedule.Builder toBuilder()
Copyright © 2012–2021 Graylog, Inc.. All rights reserved.