Package org.graylog.scheduler
Class JobScheduleStrategies
java.lang.Object
org.graylog.scheduler.JobScheduleStrategies
Provides a few standard schedule strategies for triggers.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionOptional<org.joda.time.DateTime>
nextFutureTime
(JobTriggerDto trigger) Calculates the next time in the future.Optional<org.joda.time.DateTime>
nextTime
(JobTriggerDto trigger) Calculates the next execution time.
-
Constructor Details
-
JobScheduleStrategies
-
-
Method Details
-
nextTime
Calculates the next execution time. This uses the previousJobTriggerDto.nextTime()
to calculate the next one based on the trigger schedule.If this returns an empty
Optional
, the trigger should not be executed anymore.- Parameters:
trigger
- the trigger to use for the calculation- Returns:
- the next time this trigger should fire, empty optional if the trigger should not fire anymore
-
nextFutureTime
Calculates the next time in the future. This uses the previousJobTriggerDto.nextTime()
to calculate the next one based on the trigger schedule. It recalculates the next time until it is in the future.If this returns an empty
Optional
, the trigger should not be executed anymore.- Parameters:
trigger
- the trigger to use for the calculation- Returns:
- the next time this trigger should fire, empty optional if the trigger should not fire anymore
-