Package org.jivesoftware.smackx.pubsub
Class Affiliation
- java.lang.Object
-
- org.jivesoftware.smackx.pubsub.Affiliation
-
- All Implemented Interfaces:
Element
,ExtensionElement
,FullyQualifiedElement
,NamedElement
,XmlLangElement
public class Affiliation extends java.lang.Object implements ExtensionElement
Represents a affiliation between a user and a node, where theAffiliation.Type
defines the type of affiliation. Affiliations are retrieved from thePubSubManager.getAffiliations()
method, which gets affiliations for the calling user, based on the identity that is associated with theXMPPConnection
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Affiliation.AffiliationNamespace
static class
Affiliation.Type
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ELEMENT
-
Constructor Summary
Constructors Constructor Description Affiliation(java.lang.String node, Affiliation.Type affiliation)
Constructs an affiliation.Affiliation(java.lang.String node, Affiliation.Type affiliation, Affiliation.AffiliationNamespace namespace)
Constructs an affiliation.Affiliation(BareJid jid, Affiliation.Type affiliation)
Construct a affiliation modification request.Affiliation(BareJid jid, Affiliation.Type affiliation, Affiliation.AffiliationNamespace namespace)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Affiliation.Type
getAffiliation()
java.lang.String
getElementName()
Returns the root element name.BareJid
getJid()
java.lang.String
getNamespace()
Returns the root element XML namespace.java.lang.String
getNode()
java.lang.String
getNodeId()
Deprecated.usegetNode()
instead.PubSubNamespace
getPubSubNamespace()
Affiliation.Type
getType()
Deprecated.usegetAffiliation()
instead.boolean
isAffiliationModification()
Check if this is an affiliation element to modify affiliations on a node.XmlStringBuilder
toXML(XmlEnvironment enclosingNamespace)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jivesoftware.smack.packet.FullyQualifiedElement
getLanguage, getQName
-
-
-
-
Field Detail
-
ELEMENT
public static final java.lang.String ELEMENT
- See Also:
- Constant Field Values
-
-
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(BareJid jid, Affiliation.Type affiliation)
Construct a affiliation modification request.- Parameters:
jid
- TODO javadoc me pleaseaffiliation
- TODO javadoc me please
-
Affiliation
public Affiliation(BareJid jid, Affiliation.Type affiliation, Affiliation.AffiliationNamespace namespace)
-
-
Method Detail
-
getNodeId
@Deprecated public java.lang.String getNodeId()
Deprecated.usegetNode()
instead.Get the node.- Returns:
- the node.
-
getNode
public java.lang.String getNode()
-
getType
@Deprecated public Affiliation.Type getType()
Deprecated.usegetAffiliation()
instead.Get the type.- Returns:
- the type.
-
getAffiliation
public Affiliation.Type getAffiliation()
-
getElementName
public java.lang.String getElementName()
Description copied from interface:NamedElement
Returns the root element name.- Specified by:
getElementName
in interfaceNamedElement
- Returns:
- the element name.
-
getNamespace
public java.lang.String getNamespace()
Description copied from interface:FullyQualifiedElement
Returns the root element XML namespace.- Specified by:
getNamespace
in interfaceFullyQualifiedElement
- Returns:
- the namespace.
-
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 XmlStringBuilder toXML(XmlEnvironment enclosingNamespace)
-
-