|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.echomine.jabber.JabberPresenceService
public class JabberPresenceService
Deals with all presence broadcast and receiving. The service offers easy ways to set your presence and also obtain presence.
NOTE: The presence works in conjunction with the Roster. Here is usually what happens. (1) When you subscribe to a presence, the user will appear in your roster (with no group and no nickname) automatically. (2) When you unsubscribe from a presence, the user will remain in the roster and must be explicitly removed. However, you will not receive any presence notification even though the person is in your roster.
The recommended way in adding and removing subscriptions is through the Roster first. Take a look at RosterService to see what the recommended way in adding and removing users.
Field Summary |
---|
Fields inherited from interface com.echomine.jabber.PresenceCode |
---|
SHOW_AWAY, SHOW_CHAT, SHOW_DO_NOT_DISTURB, SHOW_EXTENDED_AWAY, SHOW_ONLINE, TYPE_AVAILABLE, TYPE_INVISIBLE, TYPE_PROBE, TYPE_SUBSCRIBE, TYPE_SUBSCRIBED, TYPE_UNAVAILABLE, TYPE_UNSUBSCRIBE, TYPE_UNSUBSCRIBED |
Constructor Summary | |
---|---|
JabberPresenceService(JabberSession session)
|
Method Summary | |
---|---|
void |
acceptSubscribe(JabberPresenceMessage msg)
when you receive a subscribe message, you may pass that subscribe message to this method to accept the subscription. |
void |
denySubscribe(JabberPresenceMessage msg)
Takes a subscription request message and uses it to return a reply that declines the subscription request. |
void |
sendSubscribed(JID jid)
sends a "subscribed" (not subscribe) message to the jid, essentially giving permission to the JID to know about your subscription. |
void |
sendUnsubscribed(JID jid)
sends a "unsubscribed" (not unsubscribe) message to the jid, essentially cancelling any permission given previous to be subscribed to you. |
void |
setToAvailable(java.lang.String showState,
java.lang.String status,
boolean wait)
sets status to available with optional show state and status line. |
void |
setToUnavailable()
Sets the status to unavailable. |
void |
subscribe(JID jid)
request to subscribe to a JID's presence. |
void |
unsubscribe(JID jid)
unsubscribe from the jid so as not to receive further presence notifications from that jid. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JabberPresenceService(JabberSession session)
Method Detail |
---|
public void setToAvailable(java.lang.String showState, java.lang.String status, boolean wait) throws SendMessageFailedException
showState
- optional parameter to set the show state (chat, away, extended away, etc), null if not setting a statestatus
- the status to set, or null if not setting a status textwait
- true if the caller wants to wait until there is a reply to the message
SendMessageFailedException
public void setToUnavailable() throws SendMessageFailedException
SendMessageFailedException
public void subscribe(JID jid) throws SendMessageFailedException
SendMessageFailedException
public void unsubscribe(JID jid) throws SendMessageFailedException
SendMessageFailedException
public void sendSubscribed(JID jid) throws SendMessageFailedException
SendMessageFailedException
public void sendUnsubscribed(JID jid) throws SendMessageFailedException
SendMessageFailedException
public void acceptSubscribe(JabberPresenceMessage msg) throws SendMessageFailedException
msg
- the subscribe message sent by the remote
SendMessageFailedException
public void denySubscribe(JabberPresenceMessage msg) throws SendMessageFailedException
msg
- the subscribe message sent by the remote
SendMessageFailedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |