Package org.nuxeo.ecm.core.uidgen
Interface UIDSequencer
-
- All Known Implementing Classes:
AbstractUIDSequencer
,ESUIDSequencer
,JPAUIDSequencerImpl
,KeyValueStoreUIDSequencer
,MongoDBUIDSequencer
,RedisUIDSequencer
public interface UIDSequencer
UID Sequencer interface defines a method to retrieve next ids based on a given key.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description void
dispose()
Cleanup callbackString
getName()
Gets the sequencer name.int
getNext(String key)
Deprecated.since 9.10 usegetNextLong(String)
instead.default List<Long>
getNextBlock(String key, int blockSize)
Returns a block containingblockSize
sequences.long
getNextLong(String key)
ExtendsgetNext(java.lang.String)
to return a long value.void
init()
Init Sequencervoid
initSequence(String key, int id)
Deprecated.since 9.10 useinitSequence(String, long)
instead.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.
-
-
-
Method Detail
-
getName
String getName()
Gets the sequencer name.- Since:
- 7.4
-
setName
void setName(String name)
Sets the sequencer name.- Since:
- 7.4
-
init
void init()
Init Sequencer- Since:
- 7.3
-
initSequence
void initSequence(String key, long id)
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.
- Since:
- 9.10
-
initSequence
@Deprecated void initSequence(String key, int id)
Deprecated.since 9.10 useinitSequence(String, long)
instead.Initializes the sequencer with the given key to at least the given id.- Since:
- 7.4
-
getNext
@Deprecated int getNext(String key)
Deprecated.since 9.10 usegetNextLong(String)
instead.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.
-
getNextLong
long getNextLong(String key)
ExtendsgetNext(java.lang.String)
to return a long value. This method is compatible with getNext in the integer range.- Since:
- 8.3
-
getNextBlock
default List<Long> getNextBlock(String key, int blockSize)
Returns a block containingblockSize
sequences.- Since:
- 10.3
-
dispose
void dispose()
Cleanup callback- Since:
- 7.3
-
-