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>,Supplier<DbClientHealthCheck>
- Enclosing class:
- DbClientHealthCheck
public static final class DbClientHealthCheck.Builder extends Object implements Builder<DbClientHealthCheck>
Fluent API builder forDbClientHealthCheck. Default health check setup will call named DML statement with nameping. This named DML statement shall be configured instatementssection of the DBClient configuration file.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DbClientHealthCheckbuild()Build the instance from this builder.DbClientHealthCheck.Builderconfig(Config config)Set health check parameters usingConfignode.DbClientHealthCheck.Builderdml()Set health check statement type to DML.DbClientHealthCheck.Buildername(String name)Customized name of the health check.DbClientHealthCheck.Builderquery()Set health check statement type to query.DbClientHealthCheck.Builderstatement(String statement)Set custom statement.DbClientHealthCheck.BuilderstatementName(String name)Set custom statement name.DbClientHealthCheck.Buildertimeout(long duration, TimeUnit timeUnit)Set custom timeout to wait for statement execution response.
-
-
-
Method Detail
-
build
public DbClientHealthCheck build()
Description copied from interface:BuilderBuild the instance from this builder.- Specified by:
buildin interfaceBuilder<DbClientHealthCheck>- Returns:
- instance of the built type
-
name
public DbClientHealthCheck.Builder name(String name)
Customized name of the health check. Default usesDbClient.dbType().- Parameters:
name- name of the health check- Returns:
- updated builder instance
-
config
public DbClientHealthCheck.Builder config(Config config)
Set health check parameters usingConfignode.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
Confignode. - timeout: timeout value.
- timeUnit: units of timeout value (default value is
seconds).
- Parameters:
config-Configinstance with health check parameters- Returns:
- updated builder instance
-
query
public DbClientHealthCheck.Builder query()
Set health check statement type to query. Allows to override value set inConfignode. Default health check statement type is query.- Returns:
- updated builder instance
-
dml
public DbClientHealthCheck.Builder dml()
Set health check statement type to DML. Allows to override value set inConfignode. Default health check statement type is query.- Returns:
- updated builder instance
-
statementName
public DbClientHealthCheck.Builder statementName(String name)
Set custom statement name. Default statement name value isping.- Parameters:
name- custom statement name.- Returns:
- updated builder instance
-
statement
public DbClientHealthCheck.Builder statement(String statement)
Set custom statement.- Parameters:
statement- custom statement name.- Returns:
- updated builder instance
-
timeout
public DbClientHealthCheck.Builder timeout(long duration, TimeUnit timeUnit)
Set custom timeout to wait for statement execution response. Default value is10seconds.- Parameters:
duration- the maximum time to wait for statement execution responsetimeUnit- the time unit of the timeout argument- Returns:
- updated builder instance
-
-