Package org.jivesoftware.smackx.pubsub
Class Affiliation
- java.lang.Object
-
- org.jivesoftware.smackx.pubsub.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 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(org.jxmpp.jid.BareJid jid, Affiliation.Type affiliation)
Construct a affiliation modification request.Affiliation(org.jxmpp.jid.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()
org.jxmpp.jid.BareJid
getJid()
java.lang.String
getNamespace()
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.org.jivesoftware.smack.util.XmlStringBuilder
toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace)
-
-
-
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(org.jxmpp.jid.BareJid jid, Affiliation.Type affiliation)
Construct a affiliation modification request.- Parameters:
jid
- TODO javadoc me pleaseaffiliation
- TODO javadoc me please
-
Affiliation
public Affiliation(org.jxmpp.jid.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()
-
getJid
public org.jxmpp.jid.BareJid getJid()
-
getElementName
public java.lang.String getElementName()
- Specified by:
getElementName
in interfaceorg.jivesoftware.smack.packet.NamedElement
-
getNamespace
public java.lang.String getNamespace()
- Specified by:
getNamespace
in interfaceorg.jivesoftware.smack.packet.FullyQualifiedElement
-
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 interfaceorg.jivesoftware.smack.packet.Element
-
-