Interface HikariDataSourceConfig

All Superinterfaces:
ConnectionConfig, NamedService, Prototype.Api, ProviderConfig
All Known Implementing Classes:
HikariDataSourceConfig.BuilderBase.HikariDataSourceConfigImpl

public interface HikariDataSourceConfig extends Prototype.Api, ConnectionConfig
Hikari connection pool specific configuration for DataSource.
See Also:
  • Method Details

    • builder

      Create a new fluent API builder to customize configuration.
      Returns:
      a new builder
    • builder

      Create a new fluent API builder from an existing instance.
      Parameters:
      instance - an existing instance used as a base for the builder
      Returns:
      a builder based on an instance
    • create

      static HikariDataSourceConfig create(Config config)
      Create a new instance from configuration.
      Parameters:
      config - used to configure the new instance
      Returns:
      a new instance configured from configuration
    • create

      @Deprecated static HikariDataSourceConfig create(Config config)
      Create a new instance from configuration.
      Parameters:
      config - used to configure the new instance
      Returns:
      a new instance configured from configuration
    • create

      static HikariDataSourceConfig create()
      Create a new instance with default values.
      Returns:
      a new instance
    • name

      String name()
      Name of this provider.
      Specified by:
      name in interface NamedService
      Returns:
      the provider name
    • allowPoolSuspension

      Optional<Boolean> allowPoolSuspension()
      Set whether pool suspension is allowed. See HikariConfig.setAllowPoolSuspension(boolean) for details.
      Returns:
      the desired pool suspension allowance
    • autoCommit

      Optional<Boolean> autoCommit()
      Set the default auto-commit behavior of connections in the pool. See HikariConfig.setAutoCommit(boolean) for details.
      Returns:
      the desired auto-commit default for connections
    • catalog

      Optional<String> catalog()
      Set the default catalog name to be set on connections. See HikariConfig.setCatalog(String) for details.
      Returns:
      the default catalog name
    • connectionInitSql

      Optional<String> connectionInitSql()
      Set the SQL string that will be executed on all new connections when they are created, before they are added to the pool. See HikariConfig.setConnectionInitSql(String) for details.
      Returns:
      the SQL to execute on new connections
    • connectionTestQuery

      Optional<String> connectionTestQuery()
      Set the SQL query to be executed to test the validity of connections. See HikariConfig.setConnectionTestQuery(String) for details.
      Returns:
      a SQL query string
    • connectionTimeout

      Optional<Long> connectionTimeout()
      Set the maximum number of milliseconds that a client will wait for a connection from the pool. See HikariConfig.setConnectionTimeout(long) for details.
      Returns:
      the connection timeout in milliseconds
    • healthCheckProperties

      Map<String,String> healthCheckProperties()
      Add properties (name/value pair) that will be used to configure the connection pool health check. See HikariConfig.addHealthCheckProperty(String, String) for details.
      Returns:
      the health check properties
    • idleTimeout

      Optional<Long> idleTimeout()
      This property controls the maximum amount of time that a connection is allowed to sit idle in the pool. See HikariConfig.setIdleTimeout(long) for details.
      Returns:
      the idle timeout in milliseconds
    • initializationFailTimeout

      Optional<Long> initializationFailTimeout()
      Set the pool initialization failure timeout. See HikariConfig.setInitializationFailTimeout(long) for details.
      Returns:
      the number of milliseconds before the pool initialization fails, or 0 to validate connection setup but continue with pool start, or less than zero to skip all initialization checks and start the pool without delay
    • isolateInternalQueries

      Optional<Boolean> isolateInternalQueries()
      Configure whether internal pool queries, principally aliveness checks, will be isolated in their own transaction via Connection.rollback(). See HikariConfig.setIsolateInternalQueries(boolean) for details.
      Returns:
      true if internal pool queries should be isolated, false if not
    • keepaliveTime

      Optional<Long> keepaliveTime()
      This property controls the keepalive interval for a connection in the pool. See HikariConfig.setKeepaliveTime(long) for details.
      Returns:
      the interval in which connections will be tested for aliveness, thus keeping them alive by the act of checking. Value is in milliseconds.
    • leakDetectionThreshold

      Optional<Long> leakDetectionThreshold()
      This property controls the amount of time that a connection can be out of the pool before a message is logged indicating a possible connection leak. See HikariConfig.setLeakDetectionThreshold(long) for details.
      Returns:
      the connection leak detection threshold in milliseconds
    • maximumPoolSize

      Optional<Integer> maximumPoolSize()
      The property controls the maximum size that the pool is allowed to reach, including both idle and in-use connections. See HikariConfig.setMaximumPoolSize(int) for details.
      Returns:
      the maximum number of connections in the pool
    • maxLifetime

      Optional<Long> maxLifetime()
      This property controls the maximum lifetime of a connection in the pool. See HikariConfig.setMaxLifetime(long) for details.
      Returns:
      the maximum connection lifetime in milliseconds
    • minimumIdle

      Optional<Integer> minimumIdle()
      The property controls the minimum number of idle connections that HikariCP tries to maintain in the pool, including both idle and in-use connections. See HikariConfig.setMinimumIdle(int) for details.
      Returns:
      the minimum number of idle connections in the pool to maintain
    • poolName

      Optional<String> poolName()
      Set the name of the connection pool. See HikariConfig.setPoolName(String) for details.
      Returns:
      the name of the connection pool
    • readOnly

      Optional<Boolean> readOnly()
      Configures the Connections to be added to the pool as read-only Connections. See HikariConfig.setReadOnly(boolean) for details.
      Returns:
      true if the Connections in the pool are read-only, false if not
    • registerMbeans

      Optional<Boolean> registerMbeans()
      Configures whether HikariCP self-registers the HikariConfigMXBean and HikariPoolMXBean in JMX. See HikariConfig.setRegisterMbeans(boolean) for details.
      Returns:
      true if HikariCP should register MXBeans, false if it should not
    • schema

      Optional<String> schema()
      Set the default schema name to be set on connections. See HikariConfig.setSchema(String) for details.
      Returns:
      the name of the default schema
    • transactionIsolation

      Optional<TransactionIsolation> transactionIsolation()
      Set the default transaction isolation level. See HikariConfig.setTransactionIsolation(String) for details.
      Returns:
      the isolation level
    • validationTimeout

      Optional<Long> validationTimeout()
      Sets the maximum number of milliseconds that the pool will wait for a connection to be validated as alive. See HikariConfig.setValidationTimeout(long) for details.
      Returns:
      the validation timeout in milliseconds
    • properties

      Map<String,String> properties()
      Add properties (name/value pair) that will be used to configure the DataSource/Driver. Property values are limited to String values. See HikariConfig.addDataSourceProperty(String, Object) for details.
      Returns:
      the properties
    • type

      default String type()
      Type of this provider.
      Specified by:
      type in interface NamedService
      Returns:
      the provider type - "hikari"