DEPRECATED Use `com.bea.p13n.util.jdbc.Sequencer``` and `com.bea.p13n.util.jdbc.SequencerFactory```

# com.beasys.commerce.util
Sequencer Interface

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.

Related Topics

``Sequencer``
``SequencerFactory``

All Known Implementing Classes
  `com.beasys.commerce.util.JDBCSequencer`

## Method Summary

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

## Method Detail

### getCacheSize() Method

    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.

### getCurrent(Connection) Method

    public long getCurrent(Connection databaseConnection)
         throws SQLException

Gets the current sequence number associated with this sequencer.

#### Parameters

databaseConnection
  The database connection used to generate the next sequence number.

#### Exceptions

``SQLException``

### getIncrementAmount() Method

DEPRECATED Replaced by getCacheSize

    public long getIncrementAmount()

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.

Related Topics

``Sequencer.getCacheSize()``

### getNext(Connection) Method

    public long getNext(Connection databaseConnection)
         throws SQLException

Gets the next sequence number using the supplied database connection.

#### Parameters

databaseConnection
  The database connection used to generate the next sequence number.

#### Exceptions

``SQLException``

### getSequenceName() Method

    public String getSequenceName()

Returns the name of the sequence that is managed by this sequencer.

#### Returns

The sequence name.

### getSequencerName() Method

    public String getSequencerName()

Returns the name of this sequencer.

#### Returns

The sequencer name.

### getStepSize() Method

    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.

### setCacheSize(long) Method

    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.

### setIncrementAmount(long) Method

DEPRECATED Replaced by setCacheSize

    public void setIncrementAmount(long incrementAmount)

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.

Related Topics

``Sequencer.setCacheSize(long)``

### setSequenceName(String) Method

    public void setSequenceName(String sequenceName)

Sets the name of the sequence that is managed by this sequencer.

#### Parameters

sequenceName
  The new sequence name.

### setSequencerName(String) Method

    public void setSequencerName(String sequencerName)

Sets the name of this sequencer.

#### Parameters

sequencerName
  The new sequencer name.

### setStepSize(long) Method

    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.