|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.id.uuid.state.InMemoryStateImpl
public class InMemoryStateImpl
The InMemoryStateImpl
is an implementation of the
State
interface.
This implementation is the worst-case scenario and provides the least guarantee of no UUID duplication. This implementation is provided for systems that truly have no other means of writing to or reading from stable storage.
Field Summary |
---|
Fields inherited from interface org.apache.commons.id.uuid.state.State |
---|
DEFAULT_STATE_IMPL |
Constructor Summary | |
---|---|
InMemoryStateImpl()
|
Method Summary | |
---|---|
java.util.Set |
getNodes()
Returns the collection of Nodes for this uuid state
information. |
long |
getSynchInterval()
Returns the number of milliseconds to wait between writing to stable storage. |
void |
load()
Method loads the Systems node identifier information usually from some stateful storage area. |
void |
store(java.util.Set nodesCollection)
Stores the state information. |
void |
store(java.util.Set nodesCollection,
long timestamp)
Stores the state information using a predetermined timestamp. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InMemoryStateImpl()
Method Detail |
---|
public void load()
State
Method loads the Systems node identifier information usually from some stateful storage area.
Note each JVM instance should have a separate configuration since a system wide Mutex is not feasible, then in a system with multiple concurrent jvm instances running - each instance should utilize a different configuration with distinct node identifiers.
load
in interface State
State.load()
public java.util.Set getNodes()
State
Returns the collection of Nodes
for this uuid state
information.
getNodes
in interface State
Nodes
for this uuid state.State.getNodes()
public void store(java.util.Set nodesCollection)
State
Stores the state information.
To increase the quality of the UUID uniqueness, a system that may write to stable storage SHOULD perist the state of the UUIDGenerator in order to reduce the likelihood of duplicate identifiers and increase the quality of the identifiers generated.
store
in interface State
nodesCollection
- a Collection of Node
s to store.State.store(Set)
public void store(java.util.Set nodesCollection, long timestamp)
State
Stores the state information using a predetermined timestamp. This timestamp should be a time in the future but a shorter period than what the java virtual machine can restart within. This is normally linked to the sychInterval.
Using a point in time in the near future reduces unnecessary I/O, while allowing for the persistent state to be stored periodically, in an efficient manner.
store
in interface State
nodesCollection
- a Collection of Node
s to store.timestamp
- the timestamp to write all Node
s last timestamp as.State.store(Set, long)
public long getSynchInterval()
State
Returns the number of milliseconds to wait between writing to stable storage.
getSynchInterval
in interface State
State.getSynchInterval()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |