@ComponentProfile(summary="Create a sequence number using a database, the sequence number is associated with a metadata key", tag="service,metadata,jdbc,sequence") public class MetadataIdentitySequenceNumberService extends AbstractJdbcSequenceNumberService
The default database schema is assumed to be
CREATE TABLE SEQUENCES (ID VARCHAR(255) NOT NULL, SEQ_NUMBER INT)
The default SQL statements reflect this; and provided that a table called 'SEQUENCES' contains at least those two columns
then it should work without any changes to the SQL statements. Be aware that all statements default to upper-case which will have
an impact if your database is case-sensitive (such as MySQL on Linux).
In the adapter configuration file this class is aliased as jdbc-metadata-sequence-number-service which is the preferred alternative to the fully qualified classname when building your configuration.
AbstractJdbcSequenceNumberService.OverflowBehaviour
DEFAULT_INSERT_STATEMENT, DEFAULT_RESET_STATEMENT, DEFAULT_SELECT_STATEMENT, DEFAULT_UPDATE_STATEMENT
log
CONFIRMATION_ID_KEY
Constructor and Description |
---|
MetadataIdentitySequenceNumberService() |
Modifier and Type | Method and Description |
---|---|
void |
doService(AdaptrisMessage msg)
Apply the service to the message.
|
java.lang.String |
getIdentity(AdaptrisMessage msg)
Get the appropriate identity from the msg.
|
java.lang.String |
getIdentityMetadataKey() |
void |
setIdentityMetadataKey(java.lang.String identityMetadataKey)
Set the metadata key that contains the identity.
|
closeJdbcService, exceedsMaxSequence, getAlwaysReplaceMetadata, getCreateDatabase, getInsertStatement, getMaximumSequenceNumber, getMetadataKey, getNumberFormat, getOverflowBehaviour, getResetStatement, getSelectStatement, getUpdateStatement, hasOverflowed, initJdbcService, prepareService, setAlwaysReplaceMetadata, setCreateDatabase, setInsertStatement, setMaximumSequenceNumber, setMetadataKey, setNumberFormat, setOverflowBehaviour, setResetStatement, setSelectStatement, setUpdateStatement, startService, stopService
applyTimeout, closeService, commit, createStatement, getConnection, getConnection, getStatementTimeout, initService, prepare, prepareStatement, prepareStatement, rollback, setConnection, setStatementTimeout, start, stop
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getLookupName, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setLookupName, setUniqueId
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
continueOnFailure, isBranching, setUniqueId
createName, createQualifier, isTrackingEndpoint
changeState, requestClose, requestInit, requestStart, requestStop, retrieveComponentState
getUniqueId
close, init
getLookupName
public MetadataIdentitySequenceNumberService()
public void doService(AdaptrisMessage msg) throws ServiceException
Service
Apply the service to the message.
doService
in interface Service
doService
in class AbstractJdbcSequenceNumberService
msg
- the AdaptrisMessage
to processServiceException
- wrapping any underlying Exception
sService.doService(com.adaptris.core.AdaptrisMessage)
public java.lang.String getIdentity(AdaptrisMessage msg) throws ServiceException
AbstractJdbcSequenceNumberService
For sequence numbers, the identity returned here will be used as a substitution for an SQL statement.
getIdentity
in class AbstractJdbcSequenceNumberService
msg
- the message currently being processedServiceException
- wrapping any exception.public java.lang.String getIdentityMetadataKey()
public void setIdentityMetadataKey(java.lang.String identityMetadataKey)
identityMetadataKey
- the metadata key, default metadata key is 'identity'