class GlobalHealthcheckHandler {

    protected HealthCheckStatus processResponseFromSubsystem(ResponseEntity<SubsystemHealthcheckResponse> result,
            Endpoint endpoint) {
        if (result == null || result.getStatusCodeValue() != HttpStatus.SC_OK) {
            logger.error(String.format("Globalhealthcheck: checking subsystem: %s failed ! result object is: %s",
                    endpoint.getSubsystem(), result == null ? "NULL" : result));
            return HealthCheckStatus.DOWN;
        }

        SubsystemHealthcheckResponse body = result.getBody();

        String status = body.getStatus();
        if ("UP".equalsIgnoreCase(status)) {
            return HealthCheckStatus.UP;
        } else {
            logger.error("{}, query health endpoint did not return UP status!", endpoint.getSubsystem());
            return HealthCheckStatus.DOWN;
        }
    }

}