Package org.nuxeo.ecm.core.uidgen
Class AbstractUIDSequencer
- java.lang.Object
-
- org.nuxeo.ecm.core.uidgen.AbstractUIDSequencer
-
- All Implemented Interfaces:
UIDSequencer
- Direct Known Subclasses:
ESUIDSequencer,JPAUIDSequencerImpl,KeyValueStoreUIDSequencer,MongoDBUIDSequencer,RedisUIDSequencer
public abstract class AbstractUIDSequencer extends Object implements UIDSequencer
- Since:
- 7.4
-
-
Constructor Summary
Constructors Constructor Description AbstractUIDSequencer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetName()Gets the sequencer name.intgetNext(String key)For the given key returns the incremented UID which is also stored in the same sequence entry.voidinitSequence(String key, int id)Initializes the sequencer with the given key to at least the given id.voidinitSequence(String key, long id)Initializes the sequencer with the given key to at least the given long id.voidsetName(String name)Sets the sequencer name.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.ecm.core.uidgen.UIDSequencer
dispose, getNextBlock, getNextLong, init
-
-
-
-
Field Detail
-
name
protected String name
-
-
Method Detail
-
getNext
public int getNext(String key)
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.- Specified by:
getNextin interfaceUIDSequencer
-
getName
public String getName()
Description copied from interface:UIDSequencerGets the sequencer name.- Specified by:
getNamein interfaceUIDSequencer
-
setName
public void setName(String name)
Description copied from interface:UIDSequencerSets the sequencer name.- Specified by:
setNamein interfaceUIDSequencer
-
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
-
initSequence
public void initSequence(String key, int id)
Description copied from interface:UIDSequencerInitializes the sequencer with the given key to at least the given id.- Specified by:
initSequencein interfaceUIDSequencer
-
-