Module io.helidon.dbclient.health
Package io.helidon.dbclient.health
Class DbClientHealthCheck.Builder
java.lang.Object
io.helidon.dbclient.health.DbClientHealthCheck.Builder
- All Implemented Interfaces:
Builder<DbClientHealthCheck.Builder,
,DbClientHealthCheck> Supplier<DbClientHealthCheck>
- Enclosing class:
- DbClientHealthCheck
public static final class DbClientHealthCheck.Builder
extends Object
implements Builder<DbClientHealthCheck.Builder,DbClientHealthCheck>
Fluent API builder for
DbClientHealthCheck
.
Default health check setup will call named DML statement with name ping
.
This named DML statement shall be configured in statements
section
of the DBClient configuration file.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build the instance from this builder.Set health check parameters usingConfig
node.dml()
Set health check statement type to DML.Customized name of the health check.query()
Set health check statement type to query.Set custom statement.statementName
(String name) Set custom statement name.Set custom timeout to wait for statement execution response.
-
Method Details
-
build
Description copied from interface:Builder
Build the instance from this builder.- Specified by:
build
in interfaceBuilder<DbClientHealthCheck.Builder,
DbClientHealthCheck> - Returns:
- instance of the built type
-
name
Customized name of the health check. Default usesDbClient.dbType()
.- Parameters:
name
- name of the health check- Returns:
- updated builder instance
-
config
Set health check parameters usingConfig
node.Configuration node expected content:
- name: custom health check name.
- type: statement type (default value is
query
). - statement: statement to be executed in database.
- statementName: name of statement to be executed in database. Statement
with given name must exist in statements
Config
node. - timeout: timeout value.
- timeUnit: units of timeout value (default value is
seconds
).
- Parameters:
config
-Config
instance with health check parameters- Returns:
- updated builder instance
-
query
Set health check statement type to query. Allows to override value set inConfig
node. Default health check statement type is query.- Returns:
- updated builder instance
-
dml
Set health check statement type to DML. Allows to override value set inConfig
node. Default health check statement type is query.- Returns:
- updated builder instance
-
statementName
Set custom statement name. Default statement name value isping
.- Parameters:
name
- custom statement name.- Returns:
- updated builder instance
-
statement
Set custom statement.- Parameters:
statement
- custom statement name.- Returns:
- updated builder instance
-
timeout
Set custom timeout to wait for statement execution response. Default value is10
seconds.- Parameters:
duration
- the maximum time to wait for statement execution responsetimeUnit
- the time unit of the timeout argument- Returns:
- updated builder instance
-