private void handleSignal(final Signal<?> signal) {
LogUtil.enhanceLogWithCorrelationId(logger, signal);
final DittoHeaders dittoHeaders = signal.getDittoHeaders();
if (connectionCorrelationId.equals(dittoHeaders.getOrigin().orElse(null))) {
logger.debug("Got Signal <{}> in <{}> session, " +
"but this was issued by this connection itself, not telling "
+ "eventAndResponsePublisher about it", signal.getType(), type);
} else {
if (authorizationSubjects != null &&
!Collections.disjoint(dittoHeaders.getReadSubjects(), authorizationSubjects)) {
if (matchesNamespaces(signal)) {
if (matchesFilter(signal)) {
logger.debug("Got Signal <{}> in <{}> session, " +
"telling eventAndResponsePublisher about it: {}",
signal.getType(), type, signal);
eventAndResponsePublisher.tell(signal, getSelf());
} else {
logger.debug("Signal does not match filter");
}
} else {
logger.debug("Signal does not match namespaces");
}
}
}
}