private void getSubscriptions(PubSubService service, IQ iq, Element childElement) {
        // TODO Assuming that owner is the bare JID (as defined in the JEP). This can be replaced with an explicit owner specified in the packet
        JID owner = iq.getFrom().asBareJID();
        Element subscriptionsElement = childElement.element("subscriptions");
        
        String nodeID = subscriptionsElement.attributeValue("node");
        Collection<NodeSubscription> subscriptions = new ArrayList<>();
        
        if (nodeID == null)
        {
            // Collect subscriptions of owner for all nodes at the service
            for (Node node : service.getNodes()) {
                subscriptions.addAll(node.getSubscriptions(owner));
            }
        }
        else
        {
            subscriptions.addAll(service.getNode(nodeID).getSubscriptions(owner));
        }
        // Create reply to send
        IQ reply = IQ.createResultIQ(iq);
        Element replyChildElement = childElement.createCopy();
        reply.setChildElement(replyChildElement);
        Element affiliationsElement = replyChildElement.element("subscriptions");
        // Add information about subscriptions including existing affiliations
        for (NodeSubscription subscription : subscriptions) {
            Element subElement = affiliationsElement.addElement("subscription");
            Node node = subscription.getNode();
            NodeAffiliate nodeAffiliate = subscription.getAffiliate();
            // Do not include the node id when node is the root collection node
            // or the results are for a specific node
            if (!node.isRootCollectionNode() && (nodeID == null)) {
                subElement.addAttribute("node", node.getUniqueIdentifier().getNodeId());
            }
            subElement.addAttribute("jid", subscription.getJID().toString());
            subElement.addAttribute("subscription", subscription.getState().name());
            if (node.isMultipleSubscriptionsEnabled()) {
                subElement.addAttribute("subid", subscription.getID());
            }
        }
        // Send reply
        router.route(reply);
    }
Checks of the configuration of the node meets the preconditions, as supplied in the dataform.

This method returns true only if the configuration of the node at least contains each of the fields
defined in the preconditions (with matching values).

@param node The node (cannot be null)
@param preconditions The preconditions (can be null, in which case 'true' is returned).
@return True if all preconditions are met, otherwise false.
xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/PubSubEngine.java