Class SmartfiCoreHealthIndicator
java.lang.Object
es.kukenan.smartfi.microservice.contracts.service.health.SmartfiCoreHealthIndicator
- All Implemented Interfaces:
org.springframework.boot.actuate.health.HealthContributor,org.springframework.boot.actuate.health.HealthIndicator
@Component
public class SmartfiCoreHealthIndicator
extends Object
implements org.springframework.boot.actuate.health.HealthIndicator
Smartfi core connectivity health indicator.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.boot.actuate.health.Healthhealth()private org.springframework.boot.actuate.health.Health.BuilderPing smartfi-core.private voidsafeClose(HttpURLConnection connection) Safely close the given connection, capturing anyExceptionthrown and ignoring it.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.boot.actuate.health.HealthIndicator
getHealth
-
Field Details
-
FIELD_DETAIL_REASON
Down reason field in health details response.- See Also:
-
smartfiCoreApiBaseUrl
Ping endpoint in smartfi-core API.
-
-
Constructor Details
-
SmartfiCoreHealthIndicator
public SmartfiCoreHealthIndicator()
-
-
Method Details
-
health
public org.springframework.boot.actuate.health.Health health()- Specified by:
healthin interfaceorg.springframework.boot.actuate.health.HealthIndicator
-
pingSmartfiCore
private org.springframework.boot.actuate.health.Health.Builder pingSmartfiCore()Ping smartfi-core.- Returns:
- true if ping was successful, false otherwise.
-
safeClose
Safely close the given connection, capturing anyExceptionthrown and ignoring it.- Parameters:
connection- the connection to close.
-