org.jasig.portal.utils
Class RDBMCounterStore
java.lang.Object
org.jasig.portal.utils.RDBMCounterStore
- All Implemented Interfaces:
- ICounterStore
public class RDBMCounterStore
- extends java.lang.Object
- implements ICounterStore
A reference implementation for the counter store
- Version:
- $Revision: 1.14 $
- Author:
- George Lindholm, george.lindholm@ubc.ca, Peter Kharchenko, Eric Dalquist edalquist@unicon.net
Field Summary |
private static org.apache.commons.logging.Log |
log
|
Method Summary |
void |
createCounter(java.lang.String counterName)
Creates a new counter with an initial value of 0. |
int |
getIncrementIntegerId(java.lang.String counterName)
Gets the next number in the sequence. |
void |
setCounter(java.lang.String counterName,
int value)
Sets the counter to the specified value. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
private static final org.apache.commons.logging.Log log
RDBMCounterStore
public RDBMCounterStore()
createCounter
public void createCounter(java.lang.String counterName)
throws java.lang.Exception
- Creates a new counter with an initial value of 0. Does not check to
see if the counter already exists.
- Specified by:
createCounter
in interface ICounterStore
- Parameters:
counterName
- a name for the new counter
- Throws:
java.lang.Exception
- if an error occurs- See Also:
ICounterStore.createCounter(java.lang.String)
setCounter
public void setCounter(java.lang.String counterName,
int value)
throws java.lang.Exception
- Sets the counter to the specified value. Does not check to make
sure the counter already exists.
- Specified by:
setCounter
in interface ICounterStore
- Parameters:
counterName
- a counter namevalue
- a new counter value
- Throws:
java.lang.Exception
- if an error occurs- See Also:
ICounterStore.setCounter(java.lang.String, int)
getIncrementIntegerId
public int getIncrementIntegerId(java.lang.String counterName)
throws java.lang.Exception
- Gets the next number in the sequence. If the counter does not exist
it is first created.
- Specified by:
getIncrementIntegerId
in interface ICounterStore
- Parameters:
counterName
- a String
value
- Returns:
- an
int
value
- Throws:
java.lang.Exception
- if an error occurs- See Also:
ICounterStore.getIncrementIntegerId(java.lang.String)