class GlobalHealthcheckHandler {

    protected HealthCheckSubsystem querySubsystemHealth(Endpoint subsystem) {
        HealthCheckStatus status = HealthCheckStatus.DOWN;
        URI uri = subsystem.getUri();
        try {
            // get port number for the subsystem
            // build final endpoint url
            uri = UriBuilder.fromUri(subsystem.getUri()).path(actuatorContextPath).path(HEALTH).build();
            logger.info("Calculated URL: {}", uri);

            ResponseEntity<SubsystemHealthcheckResponse> result = restTemplate.exchange(uri, HttpMethod.GET,
                    buildHttpEntityForRequest(), SubsystemHealthcheckResponse.class);

            status = processResponseFromSubsystem(result, subsystem);


        } catch (Exception ex) {
            logger.error("Exception occured in GlobalHealthcheckHandler.querySubsystemHealth() ", ex);
        }

        return new HealthCheckSubsystem(subsystem.getSubsystem(), uri, status);
    }

}