Package com.github.jpmsilva.jsystemd
Class SystemdNotifyActuatorHealthProvider
java.lang.Object
com.github.jpmsilva.jsystemd.SystemdNotifyActuatorHealthProvider
- All Implemented Interfaces:
HealthProvider
,SystemdNotifyStatusProvider
public class SystemdNotifyActuatorHealthProvider extends Object implements SystemdNotifyStatusProvider, HealthProvider
Implementation of
HealthProvider
that provides application health based on Spring Boot Actuator Health Indicators.- Author:
- Christian Lorenz
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.github.jpmsilva.jsystemd.HealthProvider
HealthProvider.Health
-
Constructor Summary
Constructors Constructor Description SystemdNotifyActuatorHealthProvider(@NotNull List<org.springframework.boot.actuate.health.HealthIndicator> healthIndicators, @NotNull Set<org.springframework.boot.actuate.health.Status> unhealthyStatusCodes)
Creates a new instance using the providedHealthIndicator
andStatus
. -
Method Summary
Modifier and Type Method Description HealthProvider.Health
health()
Determines if an application is healthy.@NotNull String
status()
Exposes status information to send to systemd.
-
Constructor Details
-
SystemdNotifyActuatorHealthProvider
public SystemdNotifyActuatorHealthProvider(@NotNull @NotNull List<org.springframework.boot.actuate.health.HealthIndicator> healthIndicators, @NotNull @NotNull Set<org.springframework.boot.actuate.health.Status> unhealthyStatusCodes)Creates a new instance using the providedHealthIndicator
andStatus
.HealthIndicator
are used to determine the health of the application, whereasStatus
indicate which status should be considered as unhealthy.- Parameters:
healthIndicators
- Spring Boot Actuator Health IndicatorsunhealthyStatusCodes
- list of status codes considered as unhealthy
-
-
Method Details
-
health
Description copied from interface:HealthProvider
Determines if an application is healthy.- Specified by:
health
in interfaceHealthProvider
- Returns:
- true if application is healthy, otherwise false
-
status
Description copied from interface:SystemdNotifyStatusProvider
Exposes status information to send to systemd.- Specified by:
status
in interfaceSystemdNotifyStatusProvider
- Returns:
- the string message to add to the service status
-