Package com.exasol.bucketfs.monitor
Class TimestampState
- java.lang.Object
-
- com.exasol.bucketfs.monitor.TimestampState
-
- All Implemented Interfaces:
BucketFsMonitor.State
public class TimestampState extends Object implements BucketFsMonitor.State
Rejects other states with earlier time.
-
-
Constructor Summary
Constructors Constructor Description TimestampState(Instant time)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaccepts(BucketFsMonitor.State other)InstantgetTime()static TimestampStatelowResolution(Instant time)Create a new instance ofTimestampStatestatic TimestampStateof(LocalDateTime time, TimeZone timeZone)Create a new instance ofTimestampStateStringtoString()
-
-
-
Constructor Detail
-
TimestampState
public TimestampState(Instant time)
- Parameters:
time- earliest point in time to accept other states
-
-
Method Detail
-
lowResolution
public static TimestampState lowResolution(Instant time)
Create a new instance ofTimestampState- Parameters:
time- current instant in time before the operation waiting for synchronization.- Returns:
- state representing time truncated to low resolution by discarding the micro seconds.
-
of
public static TimestampState of(LocalDateTime time, TimeZone timeZone)
Create a new instance ofTimestampState- Parameters:
time- current instant in time represented asLocalDateTimetimeZone- time zone- Returns:
- time stamp state representing this time
-
accepts
public boolean accepts(BucketFsMonitor.State other)
- Specified by:
acceptsin interfaceBucketFsMonitor.State- Parameters:
other- other state to be inspected- Returns:
- true if current
BucketFsMonitor.StateacceptsBucketFsMonitor.Stateother.
-
getTime
public Instant getTime()
- Returns:
- instant of time defining the current state.
-
-