Class EveryMinuteCronTrigger

java.lang.Object
de.g3s1.oss.cron.works.trigger.AbstractTrigger
de.g3s1.oss.cron.works.trigger.EveryMinuteCronTrigger
All Implemented Interfaces:
CronTrigger

public class EveryMinuteCronTrigger extends AbstractTrigger
Triggers every minute at the given second
  • 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: CronTrigger
      Calculates 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: CronTrigger
      Inform the trigger of an execution
      Parameters:
      instant - Time of execution.
    • shouldExecute

      public boolean shouldExecute(java.time.Instant instant)
      Description copied from interface: CronTrigger
      Checks if the job should be executed now
      Parameters:
      instant - estimated time
      Returns:
      true if job needs execution