use of com.predic8.membrane.core.exchange.AbstractExchange 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.exchange.AbstractExchange in project service-proxy by membrane.
the class MemoryExchangeStore method removeAllExchanges.
public void removeAllExchanges(Rule rule) {
AbstractExchange[] exchanges = getExchanges(rule.getKey());
exchangesMap.remove(rule.getKey());
totals.removeAll(Arrays.asList(exchanges));
for (IExchangesStoreListener listener : exchangesStoreListeners) {
listener.removeExchanges(rule, exchanges);
}
}
use of com.predic8.membrane.core.exchange.AbstractExchange in project service-proxy by membrane.
the class AbortExchangeTest method assertExchangeStoreHas.
private void assertExchangeStoreHas(ExchangeStore exchangeStore, int numberOfExchanges, int responsePresent) {
List<AbstractExchange> list = exchangeStore.getAllExchangesAsList();
Assert.assertEquals(numberOfExchanges, list.size());
for (AbstractExchange e : list) {
Assert.assertEquals("Exchange has " + (responsePresent == 1 ? "no " : "") + "response", responsePresent, e.getResponse() != null ? 1 : 0);
}
}
Aggregations