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;
}
Aggregations