Class FailoverJdbcConnection

  • All Implemented Interfaces:
    AdaptrisComponent, AdaptrisConnection, ComponentLifecycle, ComponentLifecycleExtension, StateManagedComponent

    @ComponentProfile(summary="Connect using a database using a JDBC driver supporting database failover in a vendor neutral fashion",
                      tag="connections,jdbc")
    public class FailoverJdbcConnection
    extends DatabaseConnection

    An AdaptrisConnection implementation for a failover database connection.

    This class simply proxies com.adaptris.jdbc.connection.FailoverConnection with the required AdaptrisConnection methods.

    See Also:
    FailoverConnection

    In the adapter configuration file this class is aliased as failover-jdbc-connection which is the preferred alternative to the fully qualified classname when building your configuration.

    • Constructor Detail

      • FailoverJdbcConnection

        public FailoverJdbcConnection()

        Creates a new instance.

          alwaysValidateConnection is true, changing that to false has no meaning as it would be impossible to failover to another connection
    • Method Detail

      • makeConnection

        protected java.sql.Connection makeConnection()
                                              throws java.sql.SQLException
        Description copied from class: DatabaseConnection

        Make the connection.

        This abstract method should be implemented by concrete sub-classes to make or check the current connection to the Jdbc source.

        Specified by:
        makeConnection in class DatabaseConnection
        Returns:
        a java.sql.Connection
        Throws:
        java.sql.SQLException - if the connection could not be made.
        See Also:
        DatabaseConnection.makeConnection()
      • stopDatabaseConnection

        protected void stopDatabaseConnection()
        Description copied from class: DatabaseConnection

        Initialise the underlying database connection.

        This abstract method should be implemented by concrete sub-classes to stop any components other than the DriverManager.

        Specified by:
        stopDatabaseConnection in class DatabaseConnection
      • addConnectUrl

        public void addConnectUrl​(java.lang.String s)
        Add a Connection URL to the configured list.
        Parameters:
        s - a connection url
      • getConnectUrls

        public java.util.List<java.lang.String> getConnectUrls()
        Get the configured list of URLs.
        Returns:
        the list of urls
      • setConnectUrls

        public void setConnectUrls​(java.util.List<java.lang.String> l)
        Set the configured list of URLs.
        Parameters:
        l - the list of urls
      • equals

        public boolean equals​(java.lang.Object o)
        Description copied from class: DatabaseConnection

        Force implementations to over-ride equals with a semantic implementation.

        Specified by:
        equals in class DatabaseConnection
        See Also:
        Object.equals(java.lang.Object)