Class StaticIdentitySequenceNumberService

  • All Implemented Interfaces:
    AdaptrisComponent, ComponentLifecycle, ComponentLifecycleExtension, ConnectedService, MessageEventGenerator, Service, StateManagedComponent

    @ComponentProfile(summary="Create a sequence number using a database, the sequence number is associated with a static value",
                      tag="service,metadata,jdbc,sequence")
    public class StaticIdentitySequenceNumberService
    extends AbstractJdbcSequenceNumberService
    Implementation of AbstractJdbcSequenceNumberService where the identity is statically configured.

    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-sequence-number-service which is the preferred alternative to the fully qualified classname when building your configuration.

    • Constructor Detail

      • StaticIdentitySequenceNumberService

        public StaticIdentitySequenceNumberService()
    • Method Detail

      • getIdentity

        public java.lang.String getIdentity()
      • setIdentity

        public void setIdentity​(java.lang.String id)
        Set the identity that will be used as part of the standard SQL statements.
        Parameters:
        id - the identiy, the default is null which means that SQL statements are assumed to not require parameters.
      • getIdentity

        protected java.lang.String getIdentity​(AdaptrisMessage msg)
        Description copied from class: AbstractJdbcSequenceNumberService
        Get the appropriate identity from the msg.

        For sequence numbers, the identity returned here will be used as a substitution for an SQL statement.

        Specified by:
        getIdentity in class AbstractJdbcSequenceNumberService
        Parameters:
        msg - the message currently being processed
        Returns:
        the identity to be used as a parameter in the SQL statements, or null if no identity is required.