BEA Systems, Inc.

com.beasys.commerce.util
Interface Sequencer

All Known Implementing Classes:
JDBCSequencer

public interface Sequencer

This file contains an interface for a unique number sequencer. A sequencer can be used to generate a sequence of unique long numbers.

See Also:
JDBCSequencer

Method Summary
 long getCacheSize()
          Returns the cache size.
 long getCurrent(java.sql.Connection databaseConnection)
          Gets the current sequence number associated with this sequencer.
 long getIncrementAmount()
          Deprecated. Replaced by getCacheSize
 long getNext(java.sql.Connection databaseConnection)
          Gets the next sequence number using the supplied database connection.
 java.lang.String getSequenceName()
          Returns the name of the sequence that is managed by this sequencer.
 java.lang.String getSequencerName()
          Returns the name of this sequencer.
 long getStepSize()
          Returns the step size.
 void setCacheSize(long cacheSize)
          Sets the cache size.
 void setIncrementAmount(long incrementAmount)
          Deprecated. Replaced by setCacheSize
 void setSequenceName(java.lang.String sequenceName)
          Sets the name of the sequence that is managed by this sequencer.
 void setSequencerName(java.lang.String sequencerName)
          Sets the name of this sequencer.
 void setStepSize(long stepSize)
          Sets the step size.
 

Method Detail

getNext

public long getNext(java.sql.Connection databaseConnection)
             throws java.sql.SQLException
Gets the next sequence number using the supplied database connection.
Parameters:
databaseConnection - The database connection used to generate the next sequence number.
Throws:
SQLException - on error.

getCurrent

public long getCurrent(java.sql.Connection databaseConnection)
                throws java.sql.SQLException
Gets the current sequence number associated with this sequencer.
Parameters:
databaseConnection - The database connection used to generate the next sequence number.
Throws:
SQLException - on error.

getIncrementAmount

public long getIncrementAmount()
Deprecated. Replaced by getCacheSize

Returns the increment amount. The increment amount defines how often the sequencer will allocate a block of unique sequence numbers from the database. When the sequencer exhausts its supplied of allocated numbers, it will allocate a new sequence of numbers from the database.
Returns:
The increment amount.
See Also:
getCacheSize()

setIncrementAmount

public void setIncrementAmount(long incrementAmount)
Deprecated. Replaced by setCacheSize

Sets the increment amount. The increment amount defines how often the sequencer will allocate a block of unique sequence numbers from the database. When the sequencer exhausts its supplied of allocated numbers, it will allocate a new sequence of numbers from the database.
Parameters:
incrementAmount - The increment amount.
See Also:
setCacheSize(long)

getCacheSize

public long getCacheSize()
Returns the cache size. The cache size defines how often the sequencer will allocate a block of unique sequence numbers from the database. When the sequencer exhausts its supplied of allocated numbers, it will allocate a new sequence of numbers from the database.
Returns:
The cache size.

setCacheSize

public void setCacheSize(long cacheSize)
Sets the cache size. The cache size defines how often the sequencer will allocate a block of unique sequence numbers from the database. When the sequencer exhausts its supplied of allocated numbers, it will allocate a new sequence of numbers from the database.
Parameters:
cacheSize - The cache size.

getStepSize

public long getStepSize()
Returns the step size. The step size determines the difference between the values returned from successive calls to getNext().
Returns:
The step size.

setStepSize

public void setStepSize(long stepSize)
Sets the step size. The step size determines the difference between the values returned from successive calls to getNext().
Parameters:
stepSize - The step size.

getSequencerName

public java.lang.String getSequencerName()
Returns the name of this sequencer.
Returns:
The sequencer name.

setSequencerName

public void setSequencerName(java.lang.String sequencerName)
Sets the name of this sequencer.
Parameters:
sequencerName - The new sequencer name.

getSequenceName

public java.lang.String getSequenceName()
Returns the name of the sequence that is managed by this sequencer.
Returns:
The sequence name.

setSequenceName

public void setSequenceName(java.lang.String sequenceName)
Sets the name of the sequence that is managed by this sequencer.
Parameters:
sequenceName - The new sequence name.

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved