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 Details

    • FIELD_DETAIL_REASON

      private static final String FIELD_DETAIL_REASON
      Down reason field in health details response.
      See Also:
    • smartfiCoreApiBaseUrl

      @Value("${core.baseUrl}/ping") private String 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:
      health in interface org.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

      private void safeClose(HttpURLConnection connection)
      Safely close the given connection, capturing any Exception thrown and ignoring it.
      Parameters:
      connection - the connection to close.