Package org.nuxeo.ecm.core.uidgen
Class KeyValueStoreUIDSequencer
java.lang.Object
org.nuxeo.ecm.core.uidgen.AbstractUIDSequencer
org.nuxeo.ecm.core.uidgen.KeyValueStoreUIDSequencer
- All Implemented Interfaces:
UIDSequencer
UID Sequencer based on a key/value store. The store is the same for all sequencers, but they are using different
keys, prefixed by the sequencer name.
- Since:
- 10.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final StringConfiguration property to specify the key/value store name.protected StringFields inherited from class org.nuxeo.ecm.core.uidgen.AbstractUIDSequencer
nameFields inherited from interface org.nuxeo.ecm.core.uidgen.UIDSequencer
SEQUENCE_DOES_NOT_EXIST -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Cleanup callbacklonggetCurrent(String key) protected StringgetKeys()getNextBlock(String key, int blockSize) Returns a block containingblockSizesequences.longgetNextLong(String key) For the given key returns the incremented UID which is also stored in the same sequence entry.protected KeyValueStoregetStore()voidinit()Init SequencervoidinitSequence(String key, long id) Initializes the sequencer with the given key to at least the given long id.Methods inherited from class org.nuxeo.ecm.core.uidgen.AbstractUIDSequencer
getName, setName
-
Field Details
-
STORE_NAME_PROPERTY
Configuration property to specify the key/value store name. If none is specified,sequenceis used.- See Also:
-
DEFAULT_STORE_NAME
- See Also:
-
SEP
- See Also:
-
storeName
-
-
Constructor Details
-
KeyValueStoreUIDSequencer
public KeyValueStoreUIDSequencer()
-
-
Method Details
-
init
public void init()Description copied from interface:UIDSequencerInit Sequencer -
dispose
public void dispose()Description copied from interface:UIDSequencerCleanup callback -
getStore
-
getKey
-
initSequence
Description copied from interface:UIDSequencerInitializes the sequencer with the given key to at least the given long id.A sequence can only be incremented, so if its current id is greater than the given id the sequence won't be decremented to reach the given id.
- Specified by:
initSequencein interfaceUIDSequencer- Overrides:
initSequencein classAbstractUIDSequencer
-
getKeys
- Returns:
- all keys known to this sequencer
-
getCurrent
- Returns:
- the current sequence value for the given key, or
UIDSequencer.SEQUENCE_DOES_NOT_EXISTif the sequence doesn't exist
-
getNextLong
Description copied from interface:UIDSequencerFor the given key returns the incremented UID which is also stored in the same sequence entry. This is a "one time use" function for a document. -
getNextBlock
Description copied from interface:UIDSequencerReturns a block containingblockSizesequences.
-