|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Store for sequence support. A sequence is an entity that provides unique numbers.
A store supports sequences when it implements this interface and the method
isSupported
returns true
.
Field Summary |
Fields inherited from interface javax.transaction.xa.XAResource |
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY |
Method Summary | |
boolean |
createSequence(java.lang.String sequenceName)
Creates a sequence if it does not already exist. |
boolean |
isSequenceSupported()
Checks if this store instance actually supports sequences. |
long |
nextSequenceValue(java.lang.String sequenceName)
Gets the next value of the sequence. |
boolean |
sequenceExists(java.lang.String sequenceName)
Checks if the sequence already exists. |
Methods inherited from interface org.apache.slide.common.Service |
cacheResults, connect, connect, connectIfNeeded, connectIfNeeded, disconnect, getLogger, initialize, isConnected, reset, setNamespace, setParameters, setScope |
Methods inherited from interface javax.transaction.xa.XAResource |
commit, end, forget, getTransactionTimeout, isSameRM, prepare, recover, rollback, setTransactionTimeout, start |
Method Detail |
public boolean isSequenceSupported()
true
if the store supports sequences, false
otherwisepublic boolean sequenceExists(java.lang.String sequenceName) throws ServiceAccessException
sequenceName
- the name of the sequence you want to check
true
if the sequence already exists, false
otherwise
ServiceAccessException
- if anything goes wrong while accessing the sequencepublic boolean createSequence(java.lang.String sequenceName) throws ServiceAccessException
sequenceName
- the name of the sequence you want to create
true
if the sequence has been created, false
if it already existed
ServiceAccessException
- if anything goes wrong while accessing the sequencepublic long nextSequenceValue(java.lang.String sequenceName) throws ServiceAccessException
1,2,3,4,5,..., but it might just as well be
10,787875845,1,2,434,.... However, it may not be
1,2,1,3,.... as a sequence must never return the same value twice or more times.
ServiceAccessException
- if anything goes wrong while accessing the sequence
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |