Search in sources :

Example 16 with Parameters

use of io.helidon.common.http.Parameters in project metro-jax-ws by eclipse-ee4j.

the class HelidonConnectionImpl method getHaInfo.

@Property(Packet.HA_INFO)
public HaInfo getHaInfo() {
    if (haInfo == null) {
        Parameters cookies = req.headers().cookies();
        String replicaInstance = cookies.first("JREPLICA").orElse(null);
        String key = cookies.first("METRO_KEY").orElse(null);
        String jrouteId = cookies.first("JROUTE").orElse(null);
        if (replicaInstance != null && key != null) {
            String proxyJroute = getRequestHeader("proxy-jroute");
            boolean failOver = jrouteId != null && proxyJroute != null && !jrouteId.equals(proxyJroute);
            haInfo = new HaInfo(key, replicaInstance, failOver);
        }
    }
    return haInfo;
}
Also used : HaInfo(com.sun.xml.ws.api.ha.HaInfo) Parameters(io.helidon.common.http.Parameters)

Aggregations

Parameters (io.helidon.common.http.Parameters)16 Test (org.junit.jupiter.api.Test)11 HashParameters (io.helidon.common.http.HashParameters)3 HaInfo (com.sun.xml.ws.api.ha.HaInfo)1 DataChunk (io.helidon.common.http.DataChunk)1 Http (io.helidon.common.http.Http)1 MediaType (io.helidon.common.http.MediaType)1 ReadOnlyParameters (io.helidon.common.http.ReadOnlyParameters)1 MediaContext (io.helidon.media.common.MediaContext)1 MessageBodyReader (io.helidon.media.common.MessageBodyReader)1 JsonpSupport (io.helidon.media.jsonp.JsonpSupport)1 SecurityContext (io.helidon.security.SecurityContext)1 SecurityEnvironment (io.helidon.security.SecurityEnvironment)1 Handler (io.helidon.webserver.Handler)1 HttpException (io.helidon.webserver.HttpException)1 RequestPredicate (io.helidon.webserver.RequestPredicate)1 Routing (io.helidon.webserver.Routing)1 ServerRequest (io.helidon.webserver.ServerRequest)1 WebServer (io.helidon.webserver.WebServer)1 JerseySupport (io.helidon.webserver.jersey.JerseySupport)1