Package org.graylog.scheduler
Class JobScheduleStrategies
java.lang.Object
org.graylog.scheduler.JobScheduleStrategies
Provides a few standard schedule strategies for triggers.
-
Constructor Summary
Constructors -
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.Optional<org.joda.time.DateTime>nextTime(JobTriggerDto trigger, org.joda.time.DateTime date) Calculates the next execution time for a trigger after a given date.
-
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
-
nextTime
public Optional<org.joda.time.DateTime> nextTime(JobTriggerDto trigger, org.joda.time.DateTime date) Calculates the next execution time for a trigger after a given date.If this returns an empty
Optional, the trigger should not be executed anymore.- Parameters:
trigger- the trigger to use for the calculationdate- the date to use when calculating the next time the trigger should fire- 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
-