Smack

org.jivesoftware.smack.packet
Class RosterPacket

java.lang.Object
  extended by org.jivesoftware.smack.packet.Packet
      extended by org.jivesoftware.smack.packet.IQ
          extended by org.jivesoftware.smack.packet.RosterPacket

public class RosterPacket
extends IQ

Represents XMPP roster packets.

Author:
Matt Tucker

Nested Class Summary
static class RosterPacket.Item
          A roster item, which consists of a JID, their name, the type of subscription, and the groups the roster item belongs to.
static class RosterPacket.ItemStatus
          The subscription status of a roster item.
static class RosterPacket.ItemType
           
 
Nested classes/interfaces inherited from class org.jivesoftware.smack.packet.IQ
IQ.Type
 
Field Summary
 
Fields inherited from class org.jivesoftware.smack.packet.Packet
DEFAULT_LANGUAGE, ID_NOT_AVAILABLE
 
Constructor Summary
RosterPacket()
           
 
Method Summary
 void addRosterItem(RosterPacket.Item item)
          Adds a roster item to the packet.
 java.lang.String getChildElementXML()
          Returns the sub-element XML section of the IQ packet, or null if there isn't one.
 int getRosterItemCount()
          Returns the number of roster items in this roster packet.
 java.util.Collection<RosterPacket.Item> getRosterItems()
          Returns an unmodifiable collection for the roster items in the packet.
 
Methods inherited from class org.jivesoftware.smack.packet.IQ
createErrorResponse, createResultIQ, getType, setType, toXML
 
Methods inherited from class org.jivesoftware.smack.packet.Packet
addExtension, addExtensions, deleteProperty, equals, getDefaultLanguage, getError, getExtension, getExtension, getExtensions, getExtensionsXML, getFrom, getPacketID, getProperty, getPropertyNames, getTo, getXmlns, hashCode, nextID, removeExtension, setDefaultXmlns, setError, setFrom, setPacketID, setProperty, setTo
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RosterPacket

public RosterPacket()
Method Detail

addRosterItem

public void addRosterItem(RosterPacket.Item item)
Adds a roster item to the packet.

Parameters:
item - a roster item.

getRosterItemCount

public int getRosterItemCount()
Returns the number of roster items in this roster packet.

Returns:
the number of roster items.

getRosterItems

public java.util.Collection<RosterPacket.Item> getRosterItems()
Returns an unmodifiable collection for the roster items in the packet.

Returns:
an unmodifiable collection for the roster items in the packet.

getChildElementXML

public java.lang.String getChildElementXML()
Description copied from class: IQ
Returns the sub-element XML section of the IQ packet, or null if there isn't one. Packet extensions must be included, if any are defined.

Extensions of this class must override this method.

Specified by:
getChildElementXML in class IQ
Returns:
the child element section of the IQ XML.

Smack

Copyright © 2003-2007 Jive Software.