Collection<JID> getPresenceBasedSubscribers() {
        Collection<JID> affiliatesJID = new ArrayList<>();
        if (presenceBasedDelivery) {
            // Add JID of all affiliates that are susbcribed to the node
            for (NodeAffiliate affiliate : affiliates) {
                if (!affiliate.getSubscriptions().isEmpty()) {
                    affiliatesJID.add(affiliate.getJID());
                }
            }
        }
        else {
            // Add JID of those affiliates that have a subscription that only wants to be
            // notified based on the subscriber presence
            for (NodeAffiliate affiliate : affiliates) {
                Collection<NodeSubscription> subscriptions = affiliate.getSubscriptions();
                for (NodeSubscription subscription : subscriptions) {
                    if (!subscription.getPresenceStates().isEmpty()) {
                        affiliatesJID.add(affiliate.getJID());
                        break;
                    }
                }
            }
        }
        getLogger().trace("Node has {} affiliate(s) that are receiving notifications based on their presence status.", affiliatesJID.size());
        return affiliatesJID;
    }
Returns the JID of the affiliates that are receiving notifications based on their
presence status.

@return the JID of the affiliates that are receiving notifications based on their
        presence status.
xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/Node.java