Class JobSchedulerSystemClock

java.lang.Object
org.graylog.scheduler.clock.JobSchedulerSystemClock
All Implemented Interfaces:
JobSchedulerClock

public class JobSchedulerSystemClock extends Object implements JobSchedulerClock
  • Field Details

  • Constructor Details

    • JobSchedulerSystemClock

      public JobSchedulerSystemClock()
  • Method Details

    • nowUTC

      public org.joda.time.DateTime nowUTC()
      Returns the current UTC time.
      Specified by:
      nowUTC in interface JobSchedulerClock
      Returns:
      current time
    • instantNow

      public Instant instantNow()
      Returns the current java.time.Instant.
      Specified by:
      instantNow in interface JobSchedulerClock
      Returns:
      current time as Instant
    • now

      public org.joda.time.DateTime now(org.joda.time.DateTimeZone zone)
      Returns the current time for the give time zone.
      Specified by:
      now in interface JobSchedulerClock
      Returns:
      current time
    • now

      public ZonedDateTime now(ZoneId zone)
      Returns the current time for the give time zone.
      Specified by:
      now in interface JobSchedulerClock
      Returns:
      current time
    • sleep

      public void sleep(long duration, TimeUnit unit) throws InterruptedException
      Causes the current execution thread to sleep for the given duration.
      Specified by:
      sleep in interface JobSchedulerClock
      Parameters:
      duration - duration value
      unit - duration unit
      Throws:
      InterruptedException
    • sleepUninterruptibly

      public void sleepUninterruptibly(long duration, TimeUnit unit)
      Description copied from interface: JobSchedulerClock
      Causes the current execution thread to sleep uninterruptibly for the given duration.
      Specified by:
      sleepUninterruptibly in interface JobSchedulerClock
      Parameters:
      duration - duration value
      unit - duration unit