public class DefaultClockSequenceStrategy extends AbstractSequence implements ClockSequenceStrategy
| Modifier and Type | Class and Description |
|---|---|
protected static class |
DefaultClockSequenceStrategy.Balancer
This
DefaultClockSequenceStrategy.Balancer helps to avoid more than one instance of UUID
generator with the same clock sequence. |
protected static class |
DefaultClockSequenceStrategy.DefaultClockSequenceShutdownHook |
| Modifier and Type | Field and Description |
|---|---|
protected static int |
SEQUENCE_MAX |
protected static int |
SEQUENCE_MIN |
protected AbstractUuidState |
state |
MAX_VALUE, MIN_VALUE, 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 and a node identifier.
### RFC-4122 - 4.1.5.
|
void |
reset() |
protected void |
storeState() |
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 identifierOverrunException - an overrun exceptionpublic void reset()
reset in interface Sequencereset in class AbstractSequenceprotected void storeState()
Copyright © 2019. All rights reserved.