public NodeAffiliate addOwner(JID jid) {
        NodeAffiliate nodeAffiliate = addAffiliation(jid, NodeAffiliate.Affiliation.owner);
        // Approve any pending subscription
        for (NodeSubscription subscription : getSubscriptions(jid)) {
            if (subscription.isAuthorizationPending()) {
                subscription.approved();
            }
        }
        return nodeAffiliate;
    }
Adds a new affiliation or updates an existing affiliation of the specified entity JID
to become a node owner.

@param jid the JID of the user being added as a node owner.
@return the newly created or modified affiliation to the node.
xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/Node.java