public class DefaultClockSequenceStrategy extends AbstractSequence implements ClockSequenceStrategy
| Modifier and Type | Class and Description |
|---|---|
protected static class |
DefaultClockSequenceStrategy.DefaultClockSequenceShutdownHook
Thread that is run when the program exits or is terminated.
|
| Modifier and Type | Field and Description |
|---|---|
protected static int |
SEQUENCE_MAX |
protected static int |
SEQUENCE_MIN |
protected AbstractUuidState |
state |
maxValue, minValue, value| Constructor and Description |
|---|
DefaultClockSequenceStrategy() |
DefaultClockSequenceStrategy(long timestamp,
long nodeIdentifier) |
DefaultClockSequenceStrategy(long timestamp,
long nodeIdentifier,
AbstractUuidState state)
This constructor uses a state stored previously.
### RFC-4122 - 4.1.5.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getClockSequence(long timestamp,
long nodeIdentifier)
Get the next value for a timestamp.
### RFC-4122 - 4.1.5.
|
void |
reset() |
protected void |
storeState()
Stores the state in a file on the file system.
|
protected AbstractUuidState state
protected static final int SEQUENCE_MIN
protected static final int SEQUENCE_MAX
public DefaultClockSequenceStrategy(long timestamp,
long nodeIdentifier,
AbstractUuidState state)
timestamp - the current timestampnodeIdentifier - the current node identifierstate - the previous state savedpublic DefaultClockSequenceStrategy(long timestamp,
long nodeIdentifier)
public DefaultClockSequenceStrategy()
public int getClockSequence(long timestamp,
long nodeIdentifier)
getClockSequence in interface ClockSequenceStrategytimestamp - a timestampnodeIdentifier - a node identifier (ignored in this subclass)UuidCreatorException - an overrun exceptionpublic void reset()
reset in interface Sequencereset in class AbstractSequenceprotected void storeState()
Copyright © 2019. All rights reserved.