Class DatabaseConnectionConfig

  • All Implemented Interfaces:
    Serializable

    public final class DatabaseConnectionConfig
    extends Object
    implements Serializable
    Configuration for database connection.
    Since:
    8.5.0
    Author:
    Norman Lorenz
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      DatabaseConnectionConfig​(String jdbcUrl, String username, char[] password, int maxConnections, int minimumIdleConnections, long idleTimeoutMs, long connectionMonitoringTimeoutMs, long connectionTimeoutMs, long validationTimeoutMs, long leakDetectionThresholdMs, long maxLifetimeMs)
      Creates a new DatabaseConnectionConfig instance.
    • Constructor Detail

      • DatabaseConnectionConfig

        public DatabaseConnectionConfig​(String jdbcUrl,
                                        String username,
                                        char[] password,
                                        int maxConnections,
                                        int minimumIdleConnections,
                                        long idleTimeoutMs,
                                        long connectionMonitoringTimeoutMs,
                                        long connectionTimeoutMs,
                                        long validationTimeoutMs,
                                        long leakDetectionThresholdMs,
                                        long maxLifetimeMs)
        Creates a new DatabaseConnectionConfig instance.
        Parameters:
        jdbcUrl - The JDBC URL for database connection.
        username - The username for database authentication.
        password - The password for database authentication.
        maxConnections - The maximum number of connections that the connection pool will maintain at any given time.
        minimumIdleConnections - The minimum number of idle connections that the connection pool tries to maintain.
        idleTimeoutMs - The maximum amount of time (in milliseconds) that a connection is allowed to sit idle in the connection pool.
        connectionMonitoringTimeoutMs - The maximum amount of time (in milliseconds) that a connection check in the database monitor is allowed to take before timing out and the system database is marked as unhealthy.
        connectionTimeoutMs - The maximum amount of time (in milliseconds) that a client will wait for a connection from the pool.
        validationTimeoutMs - The maximum amount of time (in milliseconds) that a connection will be tested for aliveness when it is retrieved from the pool.
        leakDetectionThresholdMs - The amount of time that a connection can be out of the pool before it will be logged as a potential leak.
        maxLifetimeMs - The maximum lifetime of a connection in the pool.
    • Method Detail

      • getJdbcUrl

        public String getJdbcUrl()
        The JDBC URL for database connection.
      • getUsername

        public String getUsername()
        The username for database authentication.
      • getPassword

        public char[] getPassword()
        The password for database authentication.
      • getMaxConnections

        public int getMaxConnections()
        The maximum number of connections that the connection pool will maintain at any given time.
      • getMinimumIdleConnections

        public int getMinimumIdleConnections()
        The minimum number of idle connections that the connection pool tries to maintain.
      • getIdleTimeoutMs

        public long getIdleTimeoutMs()
        The maximum amount of time (in milliseconds) that a connection is allowed to sit idle in the connection pool.
      • getConnectionMonitoringTimeoutMs

        public long getConnectionMonitoringTimeoutMs()
        The maximum amount of time (in milliseconds) that a connection check in the database monitor is allowed to take before timing out and the system database is marked as unhealthy.
      • getConnectionTimeoutMs

        public long getConnectionTimeoutMs()
        The maximum amount of time (in milliseconds) that a client will wait for a connection from the pool.
      • getValidationTimeoutMs

        public long getValidationTimeoutMs()
        The maximum amount of time (in milliseconds) that a connection will be tested for aliveness when it is retrieved from the pool.
      • getLeakDetectionThresholdMs

        public long getLeakDetectionThresholdMs()
        The amount of time that a connection can be out of the pool before it will be logged as a potential leak.
      • getMaxLifetimeMs

        public long getMaxLifetimeMs()
        The maximum lifetime of a connection in the pool.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object