@Override
        public void entryUpdated(@Nonnull final String sender, @Nullable final ConcurrentLinkedQueue<DirectedPresence> oldValue, @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());

            Map<String, Collection<String>> senders = directedPresenceAddressingByClusterNode.get(nodeID);
            if (senders == null) {
                senders = new ConcurrentHashMap<>();
                directedPresenceAddressingByClusterNode.put(nodeID, senders);
            }
            if (!handlers.isEmpty()) {
                senders.put(sender, handlers);
            } else {
                // Remove any traces of the sender since no directed presence was sent to this JVM
                senders.remove(sender);
            }
        }
EntryListener implementation tracks events for caches of c2s sessions.
xmppserver/src/main/java/org/jivesoftware/openfire/handler/PresenceUpdateHandler.java