@Component(value="cuba_UniqueNumbers") public class UniqueNumbers extends java.lang.Object implements UniqueNumbersAPI
Modifier and Type | Field and Description |
---|---|
static java.util.regex.Pattern |
SEQ_PATTERN |
NAME
Constructor and Description |
---|
UniqueNumbers() |
Modifier and Type | Method and Description |
---|---|
void |
deleteSequence(java.lang.String domain)
Removes sequence with specified identifier
|
long |
getCurrentNumber(java.lang.String domain)
Returns the current value of the sequence.
|
long |
getNextNumber(java.lang.String domain)
Returns the next sequence value.
|
void |
init() |
void |
setCurrentNumber(java.lang.String domain,
long value)
Set current value for the sequence.
|
@PostConstruct public void init()
public long getNextNumber(java.lang.String domain)
UniqueNumbersAPI
getNextNumber
in interface UniqueNumbersAPI
domain
- sequence identifierpublic long getCurrentNumber(java.lang.String domain)
UniqueNumbersAPI
UniqueNumbersAPI.getNextNumber(String)
must be called at least once beforehand.getCurrentNumber
in interface UniqueNumbersAPI
domain
- sequence identifierpublic void setCurrentNumber(java.lang.String domain, long value)
UniqueNumbersAPI
UniqueNumbersAPI.getCurrentNumber(String)
invocation will return value
Next UniqueNumbersAPI.getNextNumber(String)
invocation will return value + increment
setCurrentNumber
in interface UniqueNumbersAPI
domain
- sequence identifiervalue
- valuepublic void deleteSequence(java.lang.String domain)
UniqueNumbersAPI
deleteSequence
in interface UniqueNumbersAPI
domain
- sequence identifier