|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.echomine.jabber.JabberRosterService
public class JabberRosterService
Contains all the methods to work with rosters. Roster Management is really simple.
Few things to note about roster management. If you're adding a user to the roster, you will not be notified of the user's presence. You need to explicitly submit a presence subscription message after you add a user to the roster. However, if you're removing an user from the roster, the server will automatically unsubscribe you from that user's presence automatically. Be sure to pay attention to this distinction or you will have some bugs in your application.
The recommended way of subscribing to an user's presence is to follow the simple procedure: (1) add the user to the roster, including the groups the user will be in, (2) send a presence subscription message, and (3) wait for replies from the server and update your application accordingly. Do not update your application after you submit these messages. The server will send you roster/presence update information automatically, which you can then use to update your application.
Constructor Summary | |
---|---|
JabberRosterService(JabberSession session)
|
Method Summary | |
---|---|
void |
addToRoster(JID jid,
java.lang.String name,
java.lang.String group,
boolean wait)
this is a convenience method to add a JID to the roster. |
void |
addToRoster(RosterItem item,
boolean wait)
adds a roster item to the list stored on the server. |
void |
removeFromRoster(JID jid,
boolean wait)
a convenience method to remove a JID from the roster. |
void |
removeFromRoster(RosterItem item,
boolean wait)
removes a specific item from the roster |
java.util.List |
requestRosterList(boolean wait)
requests the server to send a list of the roster, the reply will be sent to roster listeners, so be sure to listen for the events. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JabberRosterService(JabberSession session)
Method Detail |
---|
public java.util.List requestRosterList(boolean wait) throws SendMessageFailedException
wait
- true if the caller wants to wait until there is a reply to the message
SendMessageFailedException
public void addToRoster(JID jid, java.lang.String name, java.lang.String group, boolean wait) throws SendMessageFailedException
wait
- true if the caller wants to wait until there is a reply to the message
SendMessageFailedException
public void addToRoster(RosterItem item, boolean wait) throws SendMessageFailedException
wait
- true if the caller wants to wait until there is a reply to the message
SendMessageFailedException
public void removeFromRoster(JID jid, boolean wait) throws SendMessageFailedException
wait
- true if the caller wants to wait until there is a reply to the message
SendMessageFailedException
public void removeFromRoster(RosterItem item, boolean wait) throws SendMessageFailedException
wait
- true if the caller wants to wait until there is a reply to the message
SendMessageFailedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |