@NotThreadSafe public class Roster extends IQ
| Modifier and Type | Class and Description |
|---|---|
static class |
Roster.Ask
Type-safe enumeration for the roster ask type.
|
static class |
Roster.Item
Item in a roster, which represents an individual contact.
|
static class |
Roster.Subscription
Type-safe enumeration for the roster subscription type.
|
docFactory, element, fromJID, toJID| Constructor and Description |
|---|
Roster()
Constructs a new Roster with an automatically generated ID and a type
of
IQ.Type.get. |
Roster(org.dom4j.Element element)
Constructs a new Roster using an existing Element.
|
Roster(IQ.Type type)
Constructs a new Roster using the specified type.
|
Roster(IQ.Type type,
String ID)
Constructs a new Roster using the specified type and ID.
|
| Modifier and Type | Method and Description |
|---|---|
Roster.Item |
addItem(JID jid,
Roster.Subscription subscription)
Adds a new item to the roster.
|
Roster.Item |
addItem(JID jid,
String name,
Roster.Ask ask,
Roster.Subscription subscription,
Collection<String> groups)
Adds a new item to the roster.
|
Roster.Item |
addItem(String jid,
Roster.Subscription subscription)
Adds a new item to the roster.
|
Roster |
createCopy()
Returns a deep copy of this Roster.
|
Collection<Roster.Item> |
getItems()
Returns an unmodifiable copy of the
Items in the roster packet. |
void |
removeItem(JID jid)
Removes an item from this roster.
|
addExtension, createResultIQ, deleteExtension, getChildElement, getExtension, getType, isRequest, isResponse, setChildElement, setChildElement, setTypepublic Roster()
IQ.Type.get.public Roster(IQ.Type type)
type - the IQ type.public Roster(IQ.Type type, String ID)
type - the IQ type.ID - the packet ID of the IQ.public Roster(org.dom4j.Element element)
element - the Roster Element.public Roster.Item addItem(String jid, Roster.Subscription subscription)
The XMPP specification recommends that if the roster item is associated with another
instant messaging user (human), that the JID be in bare form (e.g. user@domain).
Use the toBareJID() method for a bare JID.
jid - the JID.subscription - the subscription type.public Roster.Item addItem(JID jid, Roster.Subscription subscription)
The XMPP specification recommends that if the roster item is associated with another
instant messaging user (human), that the JID be in bare form (e.g. user@domain).
Use the toBareJID() method for a bare JID.
jid - the JID.subscription - the subscription type.public Roster.Item addItem(JID jid, String name, Roster.Ask ask, Roster.Subscription subscription, Collection<String> groups)
The XMPP specification recommends that if the roster item is associated with another
instant messaging user (human), that the JID be in bare form (e.g. user@domain).
Use the toBareJID() method for a bare JID.
jid - the JID.name - the nickname.ask - the ask type.subscription - the subscription type.groups - a Collection of groups.public void removeItem(JID jid)
jid - the JID of the item to remove.public Collection<Roster.Item> getItems()
Items in the roster packet.Items in the roster packet.public Roster createCopy()
createCopy in class IQCopyright © 2009–2017 Ignite Realtime. All rights reserved.