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 String
getName()
Gets the sequencer name.int
getNext(String key)
For the given key returns the incremented UID which is also stored in the same sequence entry.void
initSequence(String key, int id)
Initializes the sequencer with the given key to at least the given id.void
initSequence(String key, long id)
Initializes the sequencer with the given key to at least the given long id.void
setName(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: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.- Specified by:
getNext
in interfaceUIDSequencer
-
getName
public String getName()
Description copied from interface:UIDSequencer
Gets the sequencer name.- Specified by:
getName
in interfaceUIDSequencer
-
setName
public void setName(String name)
Description copied from interface:UIDSequencer
Sets the sequencer name.- Specified by:
setName
in interfaceUIDSequencer
-
initSequence
public void initSequence(String key, long id)
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
-
initSequence
public void initSequence(String key, int id)
Description copied from interface:UIDSequencer
Initializes the sequencer with the given key to at least the given id.- Specified by:
initSequence
in interfaceUIDSequencer
-
-