All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.octopusden.employee.actuator.OneCHealthIndicator.kt Maven / Gradle / Ivy

The newest version!
package org.octopusden.employee.actuator

import org.octopusden.employee.service.onec.client.OneCClient
import org.springframework.boot.actuate.health.Health
import org.springframework.boot.actuate.health.HealthIndicator
import org.springframework.stereotype.Component

/**
 * The component to check integration wit oneC
 */
@Component
class OneCHealthIndicator(
    private val oneCClient: OneCClient
): HealthIndicator {

    override fun health(): Health {
        return try {
            oneCClient.getHealth()
            Health.up().build()
        } catch (e: Exception) {
            Health.down(e).build()
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy