Class Affiliation

java.lang.Object
org.jivesoftware.smackx.pubsub.Affiliation
All Implemented Interfaces:
org.jivesoftware.smack.packet.Element, org.jivesoftware.smack.packet.NamedElement, org.jivesoftware.smack.packet.XmlElement, org.jivesoftware.smack.packet.XmlLangElement

public class Affiliation extends Object implements org.jivesoftware.smack.packet.XmlElement
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.
  • Field Details

  • Constructor Details

    • Affiliation

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

      public Affiliation(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
    • Affiliation

      public Affiliation(org.jxmpp.jid.BareJid jid, Affiliation.Type affiliation, Affiliation.AffiliationNamespace namespace)
  • Method Details

    • getNodeId

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

      public String getNode()
    • getType

      @Deprecated public Affiliation.Type getType()
      Deprecated.
      use getAffiliation() instead.
      Get the type.
      Returns:
      the type.
    • getAffiliation

      public Affiliation.Type getAffiliation()
    • getJid

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

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

      public String getNamespace()
      Specified by:
      getNamespace in interface org.jivesoftware.smack.packet.XmlElement
    • getPubSubNamespace

      public PubSubNamespace getPubSubNamespace()
    • 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