Class Affiliation

  • All Implemented Interfaces:
    org.jivesoftware.smack.packet.Element, org.jivesoftware.smack.packet.ExtensionElement, org.jivesoftware.smack.packet.FullyQualifiedElement, org.jivesoftware.smack.packet.NamedElement, org.jivesoftware.smack.packet.XmlLangElement

    public class Affiliation
    extends java.lang.Object
    implements org.jivesoftware.smack.packet.ExtensionElement
    Represents a affiliation between a user and a node, where the Affiliation.Type defines the type of affiliation. Affiliations are retrieved from the PubSubManager.getAffiliations() method, which gets affiliations for the calling user, based on the identity that is associated with the XMPPConnection.
    • Constructor Detail

      • Affiliation

        public Affiliation​(java.lang.String node,
                           Affiliation.Type affiliation)
        Constructs an affiliation.
        Parameters:
        node - The node the user is affiliated with.
        affiliation - the optional affiliation.
      • Affiliation

        public Affiliation​(java.lang.String node,
                           Affiliation.Type affiliation,
                           Affiliation.AffiliationNamespace namespace)
        Constructs an affiliation.
        Parameters:
        node - The node the user is affiliated with.
        affiliation - the optional affiliation.
        namespace - the affiliation's namespace.
      • Affiliation

        public Affiliation​(org.jxmpp.jid.BareJid jid,
                           Affiliation.Type affiliation)
        Construct a affiliation modification request.
        Parameters:
        jid - TODO javadoc me please
        affiliation - TODO javadoc me please
    • Method Detail

      • getNodeId

        @Deprecated
        public java.lang.String getNodeId()
        Deprecated.
        use getNode() instead.
        Get the node.
        Returns:
        the node.
      • getNode

        public java.lang.String getNode()
      • getJid

        public org.jxmpp.jid.BareJid getJid()
      • getElementName

        public java.lang.String getElementName()
        Specified by:
        getElementName in interface org.jivesoftware.smack.packet.NamedElement
      • getNamespace

        public java.lang.String getNamespace()
        Specified by:
        getNamespace in interface org.jivesoftware.smack.packet.FullyQualifiedElement
      • isAffiliationModification

        public boolean isAffiliationModification()
        Check if this is an affiliation element to modify affiliations on a node.
        Returns:
        true if this is an affiliation element to modify affiliations on a node, false otherwise.
        Since:
        4.2
      • toXML

        public org.jivesoftware.smack.util.XmlStringBuilder toXML​(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace)
        Specified by:
        toXML in interface org.jivesoftware.smack.packet.Element