use of com.predic8.membrane.core.rules.RuleKey in project service-proxy by membrane.
the class LimitedMemoryExchangeStore method getStatistics.
public synchronized StatisticCollector getStatistics(RuleKey key) {
StatisticCollector statistics = new StatisticCollector(false);
List<AbstractExchange> exchangesList = getExchangeList(key);
if (exchangesList == null || exchangesList.isEmpty())
return statistics;
for (int i = 0; i < exchangesList.size(); i++) statistics.collectFrom(exchangesList.get(i));
return statistics;
}
use of com.predic8.membrane.core.rules.RuleKey in project service-proxy by membrane.
the class MemoryExchangeStore method getStatistics.
public StatisticCollector getStatistics(RuleKey key) {
StatisticCollector statistics = new StatisticCollector(false);
List<AbstractExchange> exchangesList = exchangesMap.get(key);
if (exchangesList == null || exchangesList.isEmpty())
return statistics;
for (int i = 0; i < exchangesList.size(); i++) statistics.collectFrom(exchangesList.get(i));
return statistics;
}
use of com.predic8.membrane.core.rules.RuleKey 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