public class SequenceManager extends Object
A special table in the database doles out blocks of unique ID's to each virtual machine that interacts with Jive. This has the following consequences:
Constructor and Description |
---|
SequenceManager(int seqType,
int size)
Creates a new DbSequenceManager.
|
Modifier and Type | Method and Description |
---|---|
static long |
nextID(int type)
Returns the next ID of the specified type.
|
static long |
nextID(Object o)
Returns the next id for an object that has defined the annotation
JiveID . |
long |
nextUniqueID()
Returns the next available unique ID.
|
static void |
setBlockSize(int type,
int blockSize)
Used to set the blocksize of a given SequenceManager.
|
public SequenceManager(int seqType, int size)
seqType
- the type of sequence.size
- the number of id's to "checkout" at a time.public static long nextID(int type)
type
- the type of unique ID.public static long nextID(Object o)
JiveID
.
The JiveID annotation value is the synonymous for the type integer.The annotation JiveID should contain the id type for the object (the same number you would use to call nextID(int type)). Example class definition:
\@JiveID(10)
public class MyClass {
}
o
- object that has annotation JiveID.IllegalArgumentException
- If the object passed in does not defined JiveID
public static void setBlockSize(int type, int blockSize)
type
- the type of unique id.blockSize
- how many blocks of ids we should.public long nextUniqueID()
Copyright © 2003–2020 Ignite Realtime. All rights reserved.