use of com.predic8.membrane.core.transport.http.AbstractHttpHandler in project service-proxy by membrane.
the class RuleMatchingInterceptor method getRule.
private Rule getRule(Exchange exc) {
Request request = exc.getRequest();
AbstractHttpHandler handler = exc.getHandler();
// retrieve value to match
String hostHeader = request.getHeader().getHost();
String method = request.getMethod();
String uri = request.getUri();
String version = request.getVersion();
int port = handler.isMatchLocalPort() ? handler.getLocalPort() : -1;
String localIP = handler.getLocalAddress().getHostAddress();
// match it
Rule rule = router.getRuleManager().getMatchingRule(hostHeader, method, uri, version, port, localIP);
if (rule != null) {
if (log.isDebugEnabled())
log.debug("Matching Rule found for RuleKey " + hostHeader + " " + method + " " + uri + " " + port + " " + localIP);
return rule;
}
return findProxyRule(exc);
}
Aggregations