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
public class KeyValueStoreUIDSequencer extends AbstractUIDSequencer
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
Fields Modifier and Type Field Description static StringDEFAULT_STORE_NAMEstatic StringSEPstatic StringSTORE_NAME_PROPERTYConfiguration property to specify the key/value store name.protected StringstoreName-
Fields inherited from class org.nuxeo.ecm.core.uidgen.AbstractUIDSequencer
name
-
-
Constructor Summary
Constructors Constructor Description KeyValueStoreUIDSequencer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()Cleanup callbackprotected StringgetKey(String key)List<Long>getNextBlock(String key, int blockSize)Returns a block containingblockSizesequences.longgetNextLong(String key)ExtendsUIDSequencer.getNext(java.lang.String)to return a long value.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, getNext, initSequence, setName
-
-
-
-
Field Detail
-
STORE_NAME_PROPERTY
public static final String STORE_NAME_PROPERTY
Configuration property to specify the key/value store name. If none is specified,sequenceis used.- See Also:
- Constant Field Values
-
DEFAULT_STORE_NAME
public static final String DEFAULT_STORE_NAME
- See Also:
- Constant Field Values
-
SEP
public static final String SEP
- See Also:
- Constant Field Values
-
storeName
protected String storeName
-
-
Method Detail
-
init
public void init()
Description copied from interface:UIDSequencerInit Sequencer
-
dispose
public void dispose()
Description copied from interface:UIDSequencerCleanup callback
-
getStore
protected KeyValueStore getStore()
-
initSequence
public void initSequence(String key, long id)
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
-
getNextLong
public long getNextLong(String key)
Description copied from interface:UIDSequencerExtendsUIDSequencer.getNext(java.lang.String)to return a long value. This method is compatible with getNext in the integer range.
-
getNextBlock
public List<Long> getNextBlock(String key, int blockSize)
Description copied from interface:UIDSequencerReturns a block containingblockSizesequences.
-
-