public interface SequencerEngine
Modifier and Type | Method and Description |
---|---|
void |
createSequencer(java.lang.String name,
boolean allowRollover,
long startNumber)
Create a new sequencer
|
long |
getCurrentId(com.flexive.shared.FxSystemSequencer sequencer)
Read the current value of the given system internal sequencer without incrementing it
Internal method!! Safe to use but of no use to 'end-users'!
Warning: getCurrentId() is not reliable if called after the sequence has been reset or if
the database caches sequencers!
|
long |
getCurrentId(java.lang.String sequencer)
Read the current value of the given sequencer without incrementing it.
|
java.util.List<java.lang.String> |
getCustomSequencerNames()
Get the names of all known user-created sequencers.
|
java.util.List<com.flexive.shared.CustomSequencer> |
getCustomSequencers()
Get a list of all known (user-created) sequencer
|
long |
getId(com.flexive.shared.FxSystemSequencer sequencer)
Get a new unique id for the requested system sequencer.
|
long |
getId(java.lang.String sequencer)
Get a new unique id from a registered custom sequencer
|
long |
getMaxId()
Return the maximum possible id that can be created
|
void |
removeSequencer(java.lang.String name)
Remove an existing sequencer
|
boolean |
sequencerExists(java.lang.String name)
Check existance of a sequencer
|
long getMaxId() throws com.flexive.shared.exceptions.FxNotFoundException
com.flexive.shared.exceptions.FxNotFoundException
- if no sequencer engine could be foundlong getId(com.flexive.shared.FxSystemSequencer sequencer) throws com.flexive.shared.exceptions.FxApplicationException
sequencer
- the system sequencer to get an id forcom.flexive.shared.exceptions.FxApplicationException
- on errorslong getId(java.lang.String sequencer) throws com.flexive.shared.exceptions.FxApplicationException
sequencer
- name of the sequencer to usecom.flexive.shared.exceptions.FxApplicationException
- on errorslong getCurrentId(java.lang.String sequencer) throws com.flexive.shared.exceptions.FxApplicationException
sequencer
- name of the sequencer to usecom.flexive.shared.exceptions.FxApplicationException
- on errorslong getCurrentId(com.flexive.shared.FxSystemSequencer sequencer) throws com.flexive.shared.exceptions.FxApplicationException
sequencer
- the system sequencer to usecom.flexive.shared.exceptions.FxApplicationException
- on errorsvoid createSequencer(java.lang.String name, boolean allowRollover, long startNumber) throws com.flexive.shared.exceptions.FxApplicationException
name
- desired nameallowRollover
- allow id's that reach the limit (MAX_ID) to be reset to zero?startNumber
- the number to start atcom.flexive.shared.exceptions.FxApplicationException
- on errorsvoid removeSequencer(java.lang.String name) throws com.flexive.shared.exceptions.FxApplicationException
name
- name of the sequencercom.flexive.shared.exceptions.FxApplicationException
- on errorsboolean sequencerExists(java.lang.String name) throws com.flexive.shared.exceptions.FxApplicationException
name
- name of the sequencer to checkcom.flexive.shared.exceptions.FxApplicationException
- on errorsjava.util.List<com.flexive.shared.CustomSequencer> getCustomSequencers() throws com.flexive.shared.exceptions.FxApplicationException
com.flexive.shared.exceptions.FxApplicationException
- on errorsjava.util.List<java.lang.String> getCustomSequencerNames() throws com.flexive.shared.exceptions.FxApplicationException
getCustomSequencers()
when you only need the sequencer IDs, which is considerably faster on some DBs.com.flexive.shared.exceptions.FxApplicationException
- on errors