Class HikariDataSourceConfig.BuilderBase<BUILDER extends HikariDataSourceConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends HikariDataSourceConfig>
java.lang.Object
io.helidon.data.sql.common.ConnectionConfig.BuilderBase<BUILDER,PROTOTYPE>
io.helidon.data.sql.datasource.hikari.HikariDataSourceConfig.BuilderBase<BUILDER,PROTOTYPE>
- Type Parameters:
BUILDER
- type of the builder extending this abstract builderPROTOTYPE
- type of the prototype interface that would be built byPrototype.Builder.buildPrototype()
- All Implemented Interfaces:
Prototype.Builder<BUILDER,
,PROTOTYPE> ConfigBuilderSupport.ConfiguredBuilder<BUILDER,
,PROTOTYPE> ConfigBuilderSupport.ConfiguredBuilder<BUILDER,
PROTOTYPE>
- Direct Known Subclasses:
HikariDataSourceConfig.Builder
- Enclosing interface:
HikariDataSourceConfig
public abstract static class HikariDataSourceConfig.BuilderBase<BUILDER extends HikariDataSourceConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends HikariDataSourceConfig>
extends ConnectionConfig.BuilderBase<BUILDER,PROTOTYPE>
implements ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for
HikariDataSourceConfig
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
Generated implementation of the prototype, can be extended by descendant prototype implementations.Nested classes/interfaces inherited from class io.helidon.data.sql.common.ConnectionConfig.BuilderBase
ConnectionConfig.BuilderBase.ConnectionConfigImpl
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddHealthCheckProperties
(Map<String, String> healthCheckProperties) Add properties (name/value pair) that will be used to configure the connection pool health check.addProperties
(Map<String, String> properties) Add properties (name/value pair) that will be used to configure the DataSource/Driver.Set whether pool suspension is allowed.allowPoolSuspension
(boolean allowPoolSuspension) Set whether pool suspension is allowed.Set the default auto-commit behavior of connections in the pool.autoCommit
(boolean autoCommit) Set the default auto-commit behavior of connections in the pool.catalog()
Set the default catalog name to be set on connections.Set the default catalog name to be set on connections.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.config()
If this instance was configured, this would be the config instance used.Deprecated.Update builder from configuration (node of this type).Set the SQL string that will be executed on all new connections when they are created, before they are added to the pool.connectionInitSql
(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.Set the SQL query to be executed to test the validity of connections.connectionTestQuery
(String connectionTestQuery) Set the SQL query to be executed to test the validity of connections.Set the maximum number of milliseconds that a client will wait for a connection from the pool.connectionTimeout
(long connectionTimeout) Set the maximum number of milliseconds that a client will wait for a connection from the pool.from
(HikariDataSourceConfig prototype) Update this builder from an existing prototype instance.from
(HikariDataSourceConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.Add properties (name/value pair) that will be used to configure the connection pool health check.healthCheckProperties
(Map<String, String> healthCheckProperties) Add properties (name/value pair) that will be used to configure the connection pool health check.This property controls the maximum amount of time that a connection is allowed to sit idle in the pool.idleTimeout
(long idleTimeout) This property controls the maximum amount of time that a connection is allowed to sit idle in the pool.Set the pool initialization failure timeout.initializationFailTimeout
(long initializationFailTimeout) Set the pool initialization failure timeout.Configure whether internal pool queries, principally aliveness checks, will be isolated in their own transaction viaConnection.rollback()
.isolateInternalQueries
(boolean isolateInternalQueries) Configure whether internal pool queries, principally aliveness checks, will be isolated in their own transaction viaConnection.rollback()
.This property controls the keepalive interval for a connection in the pool.keepaliveTime
(long keepaliveTime) This property controls the keepalive interval for a connection in the pool.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.leakDetectionThreshold
(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.The property controls the maximum size that the pool is allowed to reach, including both idle and in-use connections.maximumPoolSize
(int maximumPoolSize) The property controls the maximum size that the pool is allowed to reach, including both idle and in-use connections.This property controls the maximum lifetime of a connection in the pool.maxLifetime
(long maxLifetime) This property controls the maximum lifetime of a connection in the pool.The property controls the minimum number of idle connections that HikariCP tries to maintain in the pool, including both idle and in-use connections.minimumIdle
(int 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.name()
Name of this provider.Name of this provider.poolName()
Set the name of the connection pool.Set the name of the connection pool.protected void
Handles providers and decorators.Add properties (name/value pair) that will be used to configure the DataSource/Driver.properties
(Map<String, String> properties) Add properties (name/value pair) that will be used to configure the DataSource/Driver.putHealthCheckProperty
(String key, String healthCheckProperty) Add properties (name/value pair) that will be used to configure the connection pool health check.putProperty
(String key, String property) Add properties (name/value pair) that will be used to configure the DataSource/Driver.readOnly()
Configures the Connections to be added to the pool as read-only Connections.readOnly
(boolean readOnly) Configures the Connections to be added to the pool as read-only Connections.Configures whether HikariCP self-registers theHikariConfigMXBean
andHikariPoolMXBean
in JMX.registerMbeans
(boolean registerMbeans) Configures whether HikariCP self-registers theHikariConfigMXBean
andHikariPoolMXBean
in JMX.schema()
Set the default schema name to be set on connections.Set the default schema name to be set on connections.toString()
Set the default transaction isolation level.transactionIsolation
(TransactionIsolation transactionIsolation) Set the default transaction isolation level.protected void
Validates required properties.Sets the maximum number of milliseconds that the pool will wait for a connection to be validated as alive.validationTimeout
(long validationTimeout) Sets the maximum number of milliseconds that the pool will wait for a connection to be validated as alive.Methods inherited from class io.helidon.data.sql.common.ConnectionConfig.BuilderBase
clearJdbcDriverClassName, clearPassword, clearUsername, from, from, jdbcDriverClassName, jdbcDriverClassName, password, password, password, url, url, username, username
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.helidon.builder.api.Prototype.Builder
buildPrototype, self
-
Constructor Details
-
BuilderBase
protected BuilderBase()Protected to support extensibility.
-
-
Method Details
-
from
Update this builder from an existing prototype instance. This method disables automatic service discovery.- Parameters:
prototype
- existing prototype to update this builder from- Returns:
- updated builder instance
-
from
Update this builder from an existing prototype builder instance.- Parameters:
builder
- existing builder prototype to update this builder from- Returns:
- updated builder instance
-
config
Deprecated.Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
config
in interfaceConfigBuilderSupport.ConfiguredBuilder<BUILDER extends HikariDataSourceConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends HikariDataSourceConfig> - Overrides:
config
in classConnectionConfig.BuilderBase<BUILDER extends HikariDataSourceConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends HikariDataSourceConfig> - Parameters:
config
- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
config
Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
config
in interfaceConfigBuilderSupport.ConfiguredBuilder<BUILDER extends HikariDataSourceConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends HikariDataSourceConfig> - Overrides:
config
in classConnectionConfig.BuilderBase<BUILDER extends HikariDataSourceConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends HikariDataSourceConfig> - Parameters:
config
- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
name
Name of this provider.- Parameters:
name
- the provider name- Returns:
- updated builder instance
- See Also:
-
clearAllowPoolSuspension
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
allowPoolSuspension
Set whether pool suspension is allowed. SeeHikariConfig.setAllowPoolSuspension(boolean)
for details.- Parameters:
allowPoolSuspension
- the desired pool suspension allowance- Returns:
- updated builder instance
- See Also:
-
clearAutoCommit
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
autoCommit
Set the default auto-commit behavior of connections in the pool. SeeHikariConfig.setAutoCommit(boolean)
for details.- Parameters:
autoCommit
- the desired auto-commit default for connections- Returns:
- updated builder instance
- See Also:
-
clearCatalog
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
catalog
Set the default catalog name to be set on connections. SeeHikariConfig.setCatalog(String)
for details.- Parameters:
catalog
- the default catalog name- Returns:
- updated builder instance
- See Also:
-
clearConnectionInitSql
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
connectionInitSql
Set the SQL string that will be executed on all new connections when they are created, before they are added to the pool. SeeHikariConfig.setConnectionInitSql(String)
for details.- Parameters:
connectionInitSql
- the SQL to execute on new connections- Returns:
- updated builder instance
- See Also:
-
clearConnectionTestQuery
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
connectionTestQuery
Set the SQL query to be executed to test the validity of connections. SeeHikariConfig.setConnectionTestQuery(String)
for details.- Parameters:
connectionTestQuery
- a SQL query string- Returns:
- updated builder instance
- See Also:
-
clearConnectionTimeout
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
connectionTimeout
Set the maximum number of milliseconds that a client will wait for a connection from the pool. SeeHikariConfig.setConnectionTimeout(long)
for details.- Parameters:
connectionTimeout
- the connection timeout in milliseconds- Returns:
- updated builder instance
- See Also:
-
healthCheckProperties
Add properties (name/value pair) that will be used to configure the connection pool health check. SeeHikariConfig.addHealthCheckProperty(String, String)
for details. This method replaces all values with the new ones.- Parameters:
healthCheckProperties
- the health check properties- Returns:
- updated builder instance
- See Also:
-
addHealthCheckProperties
Add properties (name/value pair) that will be used to configure the connection pool health check. SeeHikariConfig.addHealthCheckProperty(String, String)
for details. This method keeps existing values, then puts all new values into the map.- Parameters:
healthCheckProperties
- the health check properties- Returns:
- updated builder instance
- See Also:
-
putHealthCheckProperty
Add properties (name/value pair) that will be used to configure the connection pool health check. SeeHikariConfig.addHealthCheckProperty(String, String)
for details. This method adds a new value to the map, or replaces it if the key already exists.- Parameters:
key
- key to add or replacehealthCheckProperty
- new value for the key- Returns:
- updated builder instance
- See Also:
-
clearIdleTimeout
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
idleTimeout
This property controls the maximum amount of time that a connection is allowed to sit idle in the pool. SeeHikariConfig.setIdleTimeout(long)
for details.- Parameters:
idleTimeout
- the idle timeout in milliseconds- Returns:
- updated builder instance
- See Also:
-
clearInitializationFailTimeout
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
initializationFailTimeout
Set the pool initialization failure timeout. SeeHikariConfig.setInitializationFailTimeout(long)
for details.- Parameters:
initializationFailTimeout
- the number of milliseconds before the pool initialization fails, or0
to validate connection setup but continue with pool start, or less than zero to skip all initialization checks and start the pool without delay- Returns:
- updated builder instance
- See Also:
-
clearIsolateInternalQueries
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
isolateInternalQueries
Configure whether internal pool queries, principally aliveness checks, will be isolated in their own transaction viaConnection.rollback()
. SeeHikariConfig.setIsolateInternalQueries(boolean)
for details.- Parameters:
isolateInternalQueries
-true
if internal pool queries should be isolated,false
if not- Returns:
- updated builder instance
- See Also:
-
clearKeepaliveTime
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
keepaliveTime
This property controls the keepalive interval for a connection in the pool. SeeHikariConfig.setKeepaliveTime(long)
for details.- Parameters:
keepaliveTime
- the interval in which connections will be tested for aliveness, thus keeping them alive by the act of checking. Value is in milliseconds.- Returns:
- updated builder instance
- See Also:
-
clearLeakDetectionThreshold
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
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. SeeHikariConfig.setLeakDetectionThreshold(long)
for details.- Parameters:
leakDetectionThreshold
- the connection leak detection threshold in milliseconds- Returns:
- updated builder instance
- See Also:
-
clearMaximumPoolSize
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
maximumPoolSize
The property controls the maximum size that the pool is allowed to reach, including both idle and in-use connections. SeeHikariConfig.setMaximumPoolSize(int)
for details.- Parameters:
maximumPoolSize
- the maximum number of connections in the pool- Returns:
- updated builder instance
- See Also:
-
clearMaxLifetime
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
maxLifetime
This property controls the maximum lifetime of a connection in the pool. SeeHikariConfig.setMaxLifetime(long)
for details.- Parameters:
maxLifetime
- the maximum connection lifetime in milliseconds- Returns:
- updated builder instance
- See Also:
-
clearMinimumIdle
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
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. SeeHikariConfig.setMinimumIdle(int)
for details.- Parameters:
minimumIdle
- the minimum number of idle connections in the pool to maintain- Returns:
- updated builder instance
- See Also:
-
clearPoolName
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
poolName
Set the name of the connection pool. SeeHikariConfig.setPoolName(String)
for details.- Parameters:
poolName
- the name of the connection pool- Returns:
- updated builder instance
- See Also:
-
clearReadOnly
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
readOnly
Configures the Connections to be added to the pool as read-only Connections. SeeHikariConfig.setReadOnly(boolean)
for details.- Parameters:
readOnly
-true
if the Connections in the pool are read-only,false
if not- Returns:
- updated builder instance
- See Also:
-
clearRegisterMbeans
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
registerMbeans
Configures whether HikariCP self-registers theHikariConfigMXBean
andHikariPoolMXBean
in JMX. SeeHikariConfig.setRegisterMbeans(boolean)
for details.- Parameters:
registerMbeans
-true
if HikariCP should register MXBeans,false
if it should not- Returns:
- updated builder instance
- See Also:
-
clearSchema
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
schema
Set the default schema name to be set on connections. SeeHikariConfig.setSchema(String)
for details.- Parameters:
schema
- the name of the default schema- Returns:
- updated builder instance
- See Also:
-
clearTransactionIsolation
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
transactionIsolation
Set the default transaction isolation level. SeeHikariConfig.setTransactionIsolation(String)
for details.- Parameters:
transactionIsolation
- the isolation level- Returns:
- updated builder instance
- See Also:
-
clearValidationTimeout
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
validationTimeout
Sets the maximum number of milliseconds that the pool will wait for a connection to be validated as alive. SeeHikariConfig.setValidationTimeout(long)
for details.- Parameters:
validationTimeout
- the validation timeout in milliseconds- Returns:
- updated builder instance
- See Also:
-
properties
Add properties (name/value pair) that will be used to configure the DataSource/Driver. Property values are limited toString
values. SeeHikariConfig.addDataSourceProperty(String, Object)
for details. This method replaces all values with the new ones.- Parameters:
properties
- the properties- Returns:
- updated builder instance
- See Also:
-
addProperties
Add properties (name/value pair) that will be used to configure the DataSource/Driver. Property values are limited toString
values. SeeHikariConfig.addDataSourceProperty(String, Object)
for details. This method keeps existing values, then puts all new values into the map.- Parameters:
properties
- the properties- Returns:
- updated builder instance
- See Also:
-
putProperty
Add properties (name/value pair) that will be used to configure the DataSource/Driver. Property values are limited toString
values. SeeHikariConfig.addDataSourceProperty(String, Object)
for details. This method adds a new value to the map, or replaces it if the key already exists.- Parameters:
key
- key to add or replaceproperty
- new value for the key- Returns:
- updated builder instance
- See Also:
-
name
Name of this provider.- Returns:
- the name
-
allowPoolSuspension
Set whether pool suspension is allowed. SeeHikariConfig.setAllowPoolSuspension(boolean)
for details.- Returns:
- the allow pool suspension
-
autoCommit
Set the default auto-commit behavior of connections in the pool. SeeHikariConfig.setAutoCommit(boolean)
for details.- Returns:
- the auto commit
-
catalog
Set the default catalog name to be set on connections. SeeHikariConfig.setCatalog(String)
for details.- Returns:
- the catalog
-
connectionInitSql
Set the SQL string that will be executed on all new connections when they are created, before they are added to the pool. SeeHikariConfig.setConnectionInitSql(String)
for details.- Returns:
- the connection init sql
-
connectionTestQuery
Set the SQL query to be executed to test the validity of connections. SeeHikariConfig.setConnectionTestQuery(String)
for details.- Returns:
- the connection test query
-
connectionTimeout
Set the maximum number of milliseconds that a client will wait for a connection from the pool. SeeHikariConfig.setConnectionTimeout(long)
for details.- Returns:
- the connection timeout
-
healthCheckProperties
Add properties (name/value pair) that will be used to configure the connection pool health check. SeeHikariConfig.addHealthCheckProperty(String, String)
for details.- Returns:
- the health check properties
-
idleTimeout
This property controls the maximum amount of time that a connection is allowed to sit idle in the pool. SeeHikariConfig.setIdleTimeout(long)
for details.- Returns:
- the idle timeout
-
initializationFailTimeout
Set the pool initialization failure timeout. SeeHikariConfig.setInitializationFailTimeout(long)
for details.- Returns:
- the initialization fail timeout
-
isolateInternalQueries
Configure whether internal pool queries, principally aliveness checks, will be isolated in their own transaction viaConnection.rollback()
. SeeHikariConfig.setIsolateInternalQueries(boolean)
for details.- Returns:
- the isolate internal queries
-
keepaliveTime
This property controls the keepalive interval for a connection in the pool. SeeHikariConfig.setKeepaliveTime(long)
for details.- Returns:
- the keepalive time
-
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. SeeHikariConfig.setLeakDetectionThreshold(long)
for details.- Returns:
- the leak detection threshold
-
maximumPoolSize
The property controls the maximum size that the pool is allowed to reach, including both idle and in-use connections. SeeHikariConfig.setMaximumPoolSize(int)
for details.- Returns:
- the maximum pool size
-
maxLifetime
This property controls the maximum lifetime of a connection in the pool. SeeHikariConfig.setMaxLifetime(long)
for details.- Returns:
- the max lifetime
-
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. SeeHikariConfig.setMinimumIdle(int)
for details.- Returns:
- the minimum idle
-
poolName
Set the name of the connection pool. SeeHikariConfig.setPoolName(String)
for details.- Returns:
- the pool name
-
readOnly
Configures the Connections to be added to the pool as read-only Connections. SeeHikariConfig.setReadOnly(boolean)
for details.- Returns:
- the read only
-
registerMbeans
Configures whether HikariCP self-registers theHikariConfigMXBean
andHikariPoolMXBean
in JMX. SeeHikariConfig.setRegisterMbeans(boolean)
for details.- Returns:
- the register mbeans
-
schema
Set the default schema name to be set on connections. SeeHikariConfig.setSchema(String)
for details.- Returns:
- the schema
-
transactionIsolation
Set the default transaction isolation level. SeeHikariConfig.setTransactionIsolation(String)
for details.- Returns:
- the transaction isolation
-
validationTimeout
Sets the maximum number of milliseconds that the pool will wait for a connection to be validated as alive. SeeHikariConfig.setValidationTimeout(long)
for details.- Returns:
- the validation timeout
-
properties
Add properties (name/value pair) that will be used to configure the DataSource/Driver. Property values are limited toString
values. SeeHikariConfig.addDataSourceProperty(String, Object)
for details.- Returns:
- the properties
-
config
If this instance was configured, this would be the config instance used.- Overrides:
config
in classConnectionConfig.BuilderBase<BUILDER extends HikariDataSourceConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends HikariDataSourceConfig> - Returns:
- config node used to configure this builder, or empty if not configured
-
toString
- Overrides:
toString
in classConnectionConfig.BuilderBase<BUILDER extends HikariDataSourceConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends HikariDataSourceConfig>
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators.- Overrides:
preBuildPrototype
in classConnectionConfig.BuilderBase<BUILDER extends HikariDataSourceConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends HikariDataSourceConfig>
-
validatePrototype
protected void validatePrototype()Validates required properties.- Overrides:
validatePrototype
in classConnectionConfig.BuilderBase<BUILDER extends HikariDataSourceConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends HikariDataSourceConfig>
-
config(io.helidon.config.Config)