Package com.helixframework.api.health
Class JdbcHealthIndicator.Builder
java.lang.Object
com.helixframework.api.health.JdbcHealthIndicator.Builder
- Enclosing class:
- JdbcHealthIndicator
The Builder class is a utility class used to create instances of JdbcHealthIndicator.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a new instance of JdbcHealthIndicator.dataSource(DataSource dataSource) Sets the data source for the JdbcHealthIndicator.Optional.healthCheck(Function<ResultSet, org.springframework.boot.actuate.health.Health> healthCheck) Optional.maxFailures(int maxFailures) Optional.Optional.Sets the statement for the JdbcHealthIndicator.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
dataSource
Sets the data source for the JdbcHealthIndicator.- Parameters:
dataSource- the data source to be set- Returns:
- the Builder object
-
statement
Sets the statement for the JdbcHealthIndicator.- Parameters:
statement- the SQL statement to be executed- Returns:
- the Builder object
-
healthCheck
public JdbcHealthIndicator.Builder healthCheck(Function<ResultSet, org.springframework.boot.actuate.health.Health> healthCheck) Optional. Sets the health check function for the JdbcHealthIndicator.- Parameters:
healthCheck- the health check function to be set- Returns:
- the Builder object
-
maxFailures
Optional. Sets the maximum number of failures allowed before marking the health status as DOWN.- Parameters:
maxFailures- the maximum number of failures- Returns:
- the Builder object
-
delay
Optional. Sets the delay for the JdbcHealthIndicator periodic update task.- Parameters:
delay- the delay to be set- Returns:
- the Builder object
-
period
Optional. Sets the period for the JdbcHealthIndicator periodic update task.- Parameters:
period- the period to be set- Returns:
- the Builder object
-
build
Builds a new instance of JdbcHealthIndicator.- Returns:
- a new instance of JdbcHealthIndicator
-