public final class CSNGenerator extends Object
Modifier and Type | Method and Description |
---|---|
void |
adjust(CSN number)
Adjust the lastTime of this
CSNGenerator with a CSN that we have received from another server. |
void |
adjust(ServerState state)
Adjust utility method that takes ServerState as a parameter.
|
CSN |
newCSN()
Generate a new
CSN . |
static CSNGenerator |
newCSNGenerator(int serverId,
long timestamp)
Create a new
CSNGenerator . |
static CSNGenerator |
newCSNGenerator(int serverId,
ServerState state)
Create a new
CSNGenerator . |
public static CSNGenerator newCSNGenerator(int serverId, long timestamp)
CSNGenerator
.serverId
- id to use when creating CSN
s.timestamp
- time to start with.CSNGenerator
public static CSNGenerator newCSNGenerator(int serverId, ServerState state)
CSNGenerator
.serverId
- serverId to use when creating CSN
s.state
- This generator will be created in a way that makes sure that all CSN
s generated will be larger
than all the CSN
s currently in state.CSNGenerator
public void adjust(CSN number)
CSNGenerator
with a CSN
that we have received from another server.
This is necessary because we need that the CSN
generated after processing an update received from other
hosts to be larger than the received CSN
number
- the CSN
to adjust withpublic void adjust(ServerState state)
state
- the ServerState to adjust withCopyright 2010-2018 ForgeRock AS.