Package com.helixframework.api.health
Class JdbcHealthIndicator
java.lang.Object
com.helixframework.api.health.AsyncHealthIndicator
com.helixframework.api.health.JdbcHealthIndicator
- All Implemented Interfaces:
org.springframework.boot.actuate.health.HealthContributor,org.springframework.boot.actuate.health.HealthIndicator
The JdbcHealthIndicator class is a concrete implementation of the AsyncHealthIndicator interface
that provides asynchronous health checks for a JDBC data source.
The class executes a SQL statement against the data source and applies a health check function
to the result set to determine the health status. If the statement executes successfully and
the health check function returns a health status of UP, the health status is set to UP.
Otherwise, the health status is set to DOWN.
The class extends the AsyncHealthIndicator abstract class, which provides the functionality to
manage a periodic update task for retrieving and updating the health status.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThe Builder class is a utility class used to create instances of JdbcHealthIndicator. -
Method Summary
Modifier and TypeMethodDescriptionstatic JdbcHealthIndicator.Builderbuilder()Returns a new instance of the Builder.protected org.springframework.boot.actuate.health.HealthRetrieves the current health status.Methods inherited from class com.helixframework.api.health.AsyncHealthIndicator
getHealth, health
-
Method Details
-
builder
Returns a new instance of the Builder.- Returns:
- a new instance of the Builder
-
healthInternal
protected org.springframework.boot.actuate.health.Health healthInternal()Description copied from class:AsyncHealthIndicatorRetrieves the current health status. This method is called periodically by the AsyncHealthIndicator class to update the health status. It should be implemented by subclasses to provide the actual health check logic.- Specified by:
healthInternalin classAsyncHealthIndicator- Returns:
- the current Health status
-