|
Smack | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jivesoftware.smack.Roster
Represents a user's roster, which is the collection of users a person receives presence updates for. Roster items are categorized into groups for easier management.
Others users may attempt to subscribe to this user using a subscription request. Three modes are supported for handling these requests:
XMPPConnection.getRoster()
Field Summary | |
static int |
SUBCRIPTION_ACCEPT_ALL
Automatically accept all subscription requests. |
static int |
SUBCRIPTION_REJECT_ALL
Automatically reject all subscription requests. |
static int |
SUBSCRIPTION_MANUAL
Subscription requests are ignored, which means they must be manually processed by registering a listener for presence packets and then looking for any presence requests that have the type Presence.Type.SUBSCRIBE. |
Method Summary | |
void |
addRosterListener(RosterListener rosterListener)
Adds a listener to this roster. |
void |
createEntry(String user,
String name,
String[] groups)
Cretaes a new roster entry and prsence subscription. |
RosterGroup |
createGroup(String name)
Creates a new group. |
Iterator |
getEntries()
Returns all entries in the roster, including entries that don't belong to any groups. |
int |
getEntryCount()
Returns a count of the entries in the roster. |
RosterGroup |
getGroup(String name)
Returns the roster group with the specified name, or null if the group doesn't exist. |
int |
getGroupCount()
Returns the number of the groups in the roster. |
Iterator |
getGroups()
Returns an iterator the for all the roster groups. |
Presence |
getPresence(String user)
Returns the presence info for a particular user, or null if there is no presence information. |
int |
getSubscriptionMode()
Returns the subscription processing mode, which dictates what action Smack will take when subscription requests from other users are made. |
Iterator |
getUnfiledEntries()
Returns an Iterator for the unfiled roster entries. |
int |
getUnfiledEntryCount()
Returns a count of the unfiled entries in the roster. |
void |
reload()
Reloads the entire roster from the server. |
void |
removeRosterListener(RosterListener rosterListener)
Removes a listener from this roster. |
void |
setSubscriptionMode(int subscriptionMode)
Sets the subscription processing mode, which dictates what action Smack will take when subscription requests from other users are made. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int SUBCRIPTION_ACCEPT_ALL
public static final int SUBCRIPTION_REJECT_ALL
public static final int SUBSCRIPTION_MANUAL
Method Detail |
public int getSubscriptionMode()
public void setSubscriptionMode(int subscriptionMode)
subscriptionMode
- the subscription mode.public void reload()
public void addRosterListener(RosterListener rosterListener)
rosterListener
- a roster listener.public void removeRosterListener(RosterListener rosterListener)
rosterListener
- a roster listener.public RosterGroup createGroup(String name)
Note: you must add at least one entry to the group for the group to be kept after a logout/login. This is due to the way that XMPP stores group information.
name
- the name of the group.
public void createEntry(String user, String name, String[] groups) throws XMPPException
user
- the user.name
- the nickname of the user.groups
- the list of group names the entry will belong to, or null if the
the roster entry won't belong to a group.
XMPPException
public int getEntryCount()
public Iterator getEntries()
public int getUnfiledEntryCount()
public Iterator getUnfiledEntries()
public RosterGroup getGroup(String name)
name
- the name of the group.
public int getGroupCount()
public Iterator getGroups()
public Presence getPresence(String user)
user
- a fully qualified xmpp ID, e.g. jdoe@example.com
|
Smack | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |