Smack

org.jivesoftware.smackx.pubsub
Class Affiliation

java.lang.Object
  extended by org.jivesoftware.smackx.pubsub.Affiliation
All Implemented Interfaces:
PacketExtension

public class Affiliation
extends java.lang.Object
implements PacketExtension

Represents a affiliation between a user and a node, where the 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 Connection.

Author:
Robin Collier

Nested Class Summary
static class Affiliation.Type
           
 
Field Summary
protected  java.lang.String node
           
protected  Affiliation.Type type
           
 
Constructor Summary
Affiliation(java.lang.String nodeId, Affiliation.Type affiliation)
          Constructs an affiliation.
 
Method Summary
 java.lang.String getElementName()
          Returns the root element name.
 java.lang.String getNamespace()
          Returns the root element XML namespace.
 java.lang.String getNodeId()
           
 Affiliation.Type getType()
           
 java.lang.String toXML()
          Returns the XML representation of the PacketExtension.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

node

protected java.lang.String node

type

protected Affiliation.Type type
Constructor Detail

Affiliation

public Affiliation(java.lang.String nodeId,
                   Affiliation.Type affiliation)
Constructs an affiliation.

Parameters:
nodeId - The node the user is affiliated with.
affiliation - The type of affiliation.
Method Detail

getNodeId

public java.lang.String getNodeId()

getType

public Affiliation.Type getType()

getElementName

public java.lang.String getElementName()
Description copied from interface: PacketExtension
Returns the root element name.

Specified by:
getElementName in interface PacketExtension
Returns:
the element name.

getNamespace

public java.lang.String getNamespace()
Description copied from interface: PacketExtension
Returns the root element XML namespace.

Specified by:
getNamespace in interface PacketExtension
Returns:
the namespace.

toXML

public java.lang.String toXML()
Description copied from interface: PacketExtension
Returns the XML representation of the PacketExtension.

Specified by:
toXML in interface PacketExtension
Returns:
the packet extension as XML.

Smack

Copyright © 2003-2007 Jive Software.