com.flexive.shared.interfaces
Interface SequencerEngine

All Known Subinterfaces:
SequencerEngineLocal

public interface SequencerEngine

Interface for the sequencer beans.

The beans generates Id's for any data-table. It should be used instead of database spezific autoincrements or sequences.

Author:
Markus Plesser (markus.plesser@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at), Gregor Schober (gregor.schober@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)

Nested Class Summary
static class SequencerEngine.System
          System defined sequencers
 
Field Summary
static long MAX_ID
          Maximum possible id
 
Method Summary
 void createSequencer(java.lang.String name, boolean allowRollover, long startNumber)
          Create a new sequencer
 java.util.List<CustomSequencer> getCustomSequencers()
          Get a list of all known (user-created) sequencer
 long getId(SequencerEngine.System type)
          Get a new unique id for the requested type.
 long getId(java.lang.String sequencer)
          Get a new id from a registered sequencer
 void removeSequencer(java.lang.String name)
          Remove an existing sequencer
 boolean sequencerExists(java.lang.String name)
          Check existance of a sequencer
 

Field Detail

MAX_ID

static final long MAX_ID
Maximum possible id

See Also:
Constant Field Values
Method Detail

getId

long getId(SequencerEngine.System type)
           throws FxApplicationException
Get a new unique id for the requested type. Internal method!! Safe to use but of no use to 'end-users'!

Parameters:
type - the type (database table) to get an id for
Returns:
new id
Throws:
FxApplicationException - on errors

createSequencer

void createSequencer(java.lang.String name,
                     boolean allowRollover,
                     long startNumber)
                     throws FxApplicationException
Create a new sequencer

Parameters:
name - desired name
allowRollover - allow id's that reach the limit (MAX_ID) to be reset to zero?
startNumber - the number to start at
Throws:
FxApplicationException - on errors

removeSequencer

void removeSequencer(java.lang.String name)
                     throws FxApplicationException
Remove an existing sequencer

Parameters:
name - name of the sequencer
Throws:
FxApplicationException - on errors

getId

long getId(java.lang.String sequencer)
           throws FxApplicationException
Get a new id from a registered sequencer

Parameters:
sequencer - name of the sequencer to use
Returns:
new id
Throws:
FxApplicationException - on errors

sequencerExists

boolean sequencerExists(java.lang.String name)
                        throws FxApplicationException
Check existance of a sequencer

Parameters:
name - name of the sequencer to check
Returns:
if the sequencer exists
Throws:
FxApplicationException - on errors

getCustomSequencers

java.util.List<CustomSequencer> getCustomSequencers()
                                                    throws FxApplicationException
Get a list of all known (user-created) sequencer

Returns:
list of all known (user-created) sequencer
Throws:
FxApplicationException - on errors