public class KeyValueStoreUIDSequencer extends AbstractUIDSequencer
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_STORE_NAME |
static String |
SEP |
static String |
STORE_NAME_PROPERTY
Configuration property to specify the key/value store name.
|
protected String |
storeName |
name| Constructor and Description |
|---|
KeyValueStoreUIDSequencer() |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Cleanup callback
|
protected String |
getKey(String key) |
List<Long> |
getNextBlock(String key,
int blockSize)
Returns a block containing
blockSize sequences. |
long |
getNextLong(String key)
Extends
UIDSequencer.getNext(java.lang.String) to return a long value. |
protected KeyValueStore |
getStore() |
void |
init()
Init Sequencer
|
void |
initSequence(String key,
long id)
Initializes the sequencer with the given key to at least the given long id.
|
getName, getNext, initSequence, setNamepublic static final String STORE_NAME_PROPERTY
sequence is used.public static final String DEFAULT_STORE_NAME
public static final String SEP
public KeyValueStoreUIDSequencer()
public void init()
UIDSequencerpublic void dispose()
UIDSequencerprotected KeyValueStore getStore()
public void initSequence(String key, long id)
UIDSequencerA 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.
initSequence in interface UIDSequencerinitSequence in class AbstractUIDSequencerpublic long getNextLong(String key)
UIDSequencerUIDSequencer.getNext(java.lang.String) to return a long value. This method is compatible
with getNext in the integer range.public List<Long> getNextBlock(String key, int blockSize)
UIDSequencerblockSize sequences.Copyright © 2019 Nuxeo. All rights reserved.