Class DbClientHealthCheck.Builder

    • Method Detail

      • config

        public DbClientHealthCheck.Builder config​(Config config)
        Set health check parameters using Config 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).
        Only one of statement and statementName parameters is allowed.
        Parameters:
        config - Config instance 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 in Config node. 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 in Config node. 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 is ping.
        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 is 10 seconds.
        Parameters:
        duration - the maximum time to wait for statement execution response
        timeUnit - the time unit of the timeout argument
        Returns:
        updated builder instance