Search in sources :

Example 6 with HttpEndpoint

use of io.gravitee.definition.model.endpoint.HttpEndpoint in project gravitee-gateway by gravitee-io.

the class EndpointHealthcheckResolver method resolve.

public EndpointRule resolve(Api api, Endpoint endpoint) {
    if (endpoint.getType() == EndpointType.HTTP) {
        HttpEndpoint httpEndpoint = (HttpEndpoint) endpoint;
        HealthCheckService rootHealthCheck = api.getServices().get(HealthCheckService.class);
        return new DefaultEndpointRule(api.getId(), endpoint, (httpEndpoint.getHealthCheck() == null || httpEndpoint.getHealthCheck().isInherit()) ? rootHealthCheck : httpEndpoint.getHealthCheck());
    }
    return null;
}
Also used : DefaultEndpointRule(io.gravitee.gateway.services.healthcheck.rule.DefaultEndpointRule) HealthCheckService(io.gravitee.definition.model.services.healthcheck.HealthCheckService) HttpEndpoint(io.gravitee.definition.model.endpoint.HttpEndpoint)

Aggregations

HttpEndpoint (io.gravitee.definition.model.endpoint.HttpEndpoint)6 Endpoint (io.gravitee.definition.model.Endpoint)2 Proxy (io.gravitee.definition.model.Proxy)2 HealthCheckService (io.gravitee.definition.model.services.healthcheck.HealthCheckService)2 Api (io.gravitee.gateway.handlers.api.definition.Api)2 DefaultEndpointRule (io.gravitee.gateway.services.healthcheck.rule.DefaultEndpointRule)2 Collectors (java.util.stream.Collectors)2 Autowired (org.springframework.beans.factory.annotation.Autowired)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 DeserializationFeature (com.fasterxml.jackson.databind.DeserializationFeature)1 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)1 Lifecycle (io.gravitee.common.component.Lifecycle)1 HttpHeaders (io.gravitee.common.http.HttpHeaders)1 HttpStatusCode (io.gravitee.common.http.HttpStatusCode)1 UUID (io.gravitee.common.utils.UUID)1 GraviteeMapper (io.gravitee.definition.jackson.datatype.GraviteeMapper)1 Api (io.gravitee.definition.model.Api)1 EndpointType (io.gravitee.definition.model.EndpointType)1