Package org.graylog.scheduler.clock
Interface JobSchedulerClock
- All Known Implementing Classes:
JobSchedulerSystemClock
public interface JobSchedulerClock
A clock that provides access to the current
DateTime
.-
Method Summary
Modifier and TypeMethodDescriptionReturns the current java.time.Instant.Returns the current time for the give time zone.org.joda.time.DateTime
now
(org.joda.time.DateTimeZone zone) Returns the current time for the give time zone.org.joda.time.DateTime
nowUTC()
Returns the current UTC time.void
Causes the current execution thread to sleep for the given duration.void
sleepUninterruptibly
(long duration, TimeUnit unit) Causes the current execution thread to sleep uninterruptibly for the given duration.
-
Method Details
-
nowUTC
org.joda.time.DateTime nowUTC()Returns the current UTC time.- Returns:
- current time
-
instantNow
Instant instantNow()Returns the current java.time.Instant.- Returns:
- current time as
Instant
-
now
org.joda.time.DateTime now(org.joda.time.DateTimeZone zone) Returns the current time for the give time zone.- Returns:
- current time
-
now
Returns the current time for the give time zone.- Returns:
- current time
-
sleep
Causes the current execution thread to sleep for the given duration.- Parameters:
duration
- duration valueunit
- duration unit- Throws:
InterruptedException
-
sleepUninterruptibly
Causes the current execution thread to sleep uninterruptibly for the given duration.- Parameters:
duration
- duration valueunit
- duration unit
-