Package de.g3s1.oss.cron.works.trigger
Class EveryMinuteCronTrigger
java.lang.Object
de.g3s1.oss.cron.works.trigger.AbstractTrigger
de.g3s1.oss.cron.works.trigger.EveryMinuteCronTrigger
- All Implemented Interfaces:
CronTrigger
Triggers every minute at the given second
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjava.time.InstantnextExecution(java.time.Instant instant) Calculates the next trigger execution.booleanshouldExecute(java.time.Instant instant) Checks if the job should be executed nowvoidwasTriggered(java.time.Instant instant) Inform the trigger of an executionMethods inherited from class de.g3s1.oss.cron.works.trigger.AbstractTrigger
roundToNextSecond
-
Constructor Details
-
EveryMinuteCronTrigger
public EveryMinuteCronTrigger(java.time.ZoneOffset zoneOffset, int second)
-
-
Method Details
-
nextExecution
public java.time.Instant nextExecution(java.time.Instant instant) Description copied from interface:CronTriggerCalculates the next trigger execution.
The time difference between the returned instant and the provided instance must be at least 1 sek (1000 ms).- Parameters:
instant- Last execution time- Returns:
- next execution time or null if the trigger will not trigger again
-
wasTriggered
public void wasTriggered(java.time.Instant instant) Description copied from interface:CronTriggerInform the trigger of an execution- Parameters:
instant- Time of execution.
-
shouldExecute
public boolean shouldExecute(java.time.Instant instant) Description copied from interface:CronTriggerChecks if the job should be executed now- Parameters:
instant- estimated time- Returns:
- true if job needs execution
-