Package com.github.jpmsilva.jsystemd
Class SystemdActuatorHealthProvider
java.lang.Object
com.github.jpmsilva.jsystemd.SystemdActuatorHealthProvider
- All Implemented Interfaces:
HealthProvider
,SystemdStatusProvider
@Order(2000)
public class SystemdActuatorHealthProvider
extends Object
implements SystemdStatusProvider, 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
ConstructorsConstructorDescriptionSystemdActuatorHealthProvider
(@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
-
Constructor Details
-
SystemdActuatorHealthProvider
public SystemdActuatorHealthProvider(@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:
- representation of the application
HealthProvider.Health
state
-
status
Description copied from interface:SystemdStatusProvider
Exposes status information to send to systemd.- Specified by:
status
in interfaceSystemdStatusProvider
- Returns:
- the string message to add to the service status
-