@Override
        public void entryAdded(@Nonnull final String sender, @Nullable final ConcurrentLinkedQueue<DirectedPresence> newValue, @Nonnull final NodeID nodeID) {
            if (newValue == null) {
                throw new IllegalStateException("Null value detected. This listener was probably registered using a configuration that suppresses values. This listener requires values, so it can't properly function in this configuration.");
            }

            // Check if the directed presence was sent to an entity hosted by this JVM
            final RoutingTable routingTable = XMPPServer.getInstance().getRoutingTable();
            final Set<String> handlers = newValue
                .stream()
                .filter(dp -> routingTable.isLocalRoute(dp.getHandler()))
                .flatMap(dp -> dp.getReceivers().stream())
                .collect(Collectors.toSet());

            if (!handlers.isEmpty()) {
                Map<String, Collection<String>> senders = directedPresenceAddressingByClusterNode.get(nodeID);
                if (senders == null) {
                    senders = new ConcurrentHashMap<>();
                    directedPresenceAddressingByClusterNode.put(nodeID, senders);
                }
                senders.put(sender, handlers);
            }
        }
EntryListener implementation tracks events for caches of c2s sessions.
xmppserver/src/main/java/org/jivesoftware/openfire/handler/PresenceUpdateHandler.java