use of com.predic8.membrane.core.exchange.snapshots.DynamicAbstractExchangeSnapshot in project service-proxy by membrane.
the class ElasticSearchExchangeStore method snap.
@Override
public void snap(AbstractExchange exc, Interceptor.Flow flow) {
AbstractExchangeSnapshot excCopy = null;
try {
if (flow == Interceptor.Flow.REQUEST) {
excCopy = new DynamicAbstractExchangeSnapshot(exc, this::addForElasticSearch);
addForElasticSearch(excCopy);
} else {
excCopy = getExchangeDtoById((int) exc.getId());
DynamicAbstractExchangeSnapshot.addObservers(exc, excCopy, this::addForElasticSearch);
excCopy = excCopy.updateFrom(exc);
addForElasticSearch(excCopy);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
Aggregations