public class MongoDBUIDSequencer extends AbstractUIDSequencer
UIDSequencer
.
We use MongoDB upsert feature to provide a sequencer.
Modifier and Type | Field and Description |
---|---|
static String |
COLLECTION_NAME_PROPERTY |
static String |
DEFAULT_COLLECTION_NAME |
static Long |
ONE |
static String |
SEQUENCE_DATABASE_ID |
static String |
SEQUENCE_VALUE_FIELD |
name
Constructor and Description |
---|
MongoDBUIDSequencer() |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Cleanup callback
|
int |
getNext(String key)
For the given key returns the incremented UID which is also stored in the same sequence entry.
|
long |
getNextLong(String key)
Extends
UIDSequencer.getNext(java.lang.String) to return a long value. |
void |
init()
Init Sequencer
|
getName, initSequence, setName
public static final String SEQUENCE_DATABASE_ID
public static final String COLLECTION_NAME_PROPERTY
public static final String DEFAULT_COLLECTION_NAME
public static final String SEQUENCE_VALUE_FIELD
public MongoDBUIDSequencer()
public void init()
UIDSequencer
init
in interface UIDSequencer
init
in class AbstractUIDSequencer
public int getNext(String key)
UIDSequencer
getNext
in interface UIDSequencer
getNext
in class AbstractUIDSequencer
public long getNextLong(String key)
UIDSequencer
UIDSequencer.getNext(java.lang.String)
to return a long value. This method is compatible
with getNext in the integer range.getNextLong
in interface UIDSequencer
getNextLong
in class AbstractUIDSequencer
public void dispose()
UIDSequencer
dispose
in interface UIDSequencer
dispose
in class AbstractUIDSequencer
Copyright © 2017 Nuxeo. All rights reserved.