use of org.n52.iceland.statistics.impl.resolvers.OutgoingResponseEventResolver in project arctic-sea by 52North.
the class AbstractStatisticsServiceEventListener method addEventToResolver.
private void addEventToResolver(BatchResolver resolver, Event event) {
StatisticsServiceEventResolver<?> evtResolver = null;
if (event instanceof ExceptionEvent) {
ExceptionEventResolver sosExceptionEventResolver = resolverFactory.getExceptionEventResolver();
sosExceptionEventResolver.setEvent((ExceptionEvent) event);
evtResolver = sosExceptionEventResolver;
} else if (event instanceof OutgoingResponseEvent) {
OutgoingResponseEventResolver outgoingResponseEventResolver = resolverFactory.getOutgoingResponseEventResolver();
outgoingResponseEventResolver.setEvent((OutgoingResponseEvent) event);
evtResolver = outgoingResponseEventResolver;
} else if (event instanceof CountingOutputStreamEvent) {
CountingOutputStreamEventResolver countingOutputstreamEventResolver = resolverFactory.getCountingOutputstreamEventResolver();
countingOutputstreamEventResolver.setEvent((CountingOutputStreamEvent) event);
evtResolver = countingOutputstreamEventResolver;
} else {
evtResolver = findResolver(event);
}
// Default fallback event resolver
if (evtResolver == null) {
DefaultServiceEventResolver defaultServiceEventResolver = resolverFactory.getDefaultServiceEventResolver();
defaultServiceEventResolver.setEvent(event);
evtResolver = defaultServiceEventResolver;
}
resolver.addEventResolver(evtResolver);
}
Aggregations