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 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  String node
           
protected  Affiliation.Type type
           
 
Constructor Summary
Affiliation(String nodeId, Affiliation.Type affiliation)
          Constructs an affiliation.
 
Method Summary
 String getElementName()
          Returns the root element name.
 String getNamespace()
          Returns the root element XML namespace.
 String getNodeId()
           
 Affiliation.Type getType()
           
 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 String node

type

protected Affiliation.Type type
Constructor Detail

Affiliation

public Affiliation(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 String getNodeId()

getType

public Affiliation.Type getType()

getElementName

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

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

getNamespace

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

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

toXML

public 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.