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
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
Configuration property to specify the key/value store name.protected String
Fields inherited from class org.nuxeo.ecm.core.uidgen.AbstractUIDSequencer
name
Fields inherited from interface org.nuxeo.ecm.core.uidgen.UIDSequencer
SEQUENCE_DOES_NOT_EXIST
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Cleanup callbacklong
getCurrent
(String key) protected String
getKeys()
getNextBlock
(String key, int blockSize) Returns a block containingblockSize
sequences.long
getNextLong
(String key) For the given key returns the incremented UID which is also stored in the same sequence entry.protected KeyValueStore
getStore()
void
init()
Init Sequencervoid
initSequence
(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,sequence
is 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:UIDSequencer
Init Sequencer -
dispose
public void dispose()Description copied from interface:UIDSequencer
Cleanup callback -
getStore
-
getKey
-
initSequence
Description copied from interface:UIDSequencer
Initializes 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:
initSequence
in interfaceUIDSequencer
- Overrides:
initSequence
in classAbstractUIDSequencer
-
getKeys
- Returns:
- all keys known to this sequencer
-
getCurrent
- Returns:
- the current sequence value for the given key, or
UIDSequencer.SEQUENCE_DOES_NOT_EXIST
if the sequence doesn't exist
-
getNextLong
Description copied from interface:UIDSequencer
For 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:UIDSequencer
Returns a block containingblockSize
sequences.
-