public final class PresenceManager extends Manager
This class allows to request, approve, deny and unsubscribe subscriptions.
This class is unconditionally thread-safe.| Modifier and Type | Method and Description |
|---|---|
String |
approveSubscription(rocks.xmpp.addr.Jid jid)
Approves a subscription request.
|
String |
denySubscription(rocks.xmpp.addr.Jid jid)
Cancels a previously granted subscription or denies a subscription request.
|
Presence |
getLastSentPresence()
Gets the last sent (non-directed) presence, that has been broadcast by the server.
|
Collection<Presence> |
getLastSentPresences()
Gets the last sent presences, that have been sent, including directed presences.
|
Presence |
getPresence(rocks.xmpp.addr.Jid jid)
Gets the presence for a given contact.
|
String |
requestSubscription(rocks.xmpp.addr.Jid jid,
String status)
Sends a subscription request to a potential contact.
|
String |
unsubscribe(rocks.xmpp.addr.Jid jid)
Unsubscribes from a contact's presence.
|
isEnabled, setEnabledpublic final Presence getPresence(rocks.xmpp.addr.Jid jid)
If the given JID is a bare JID, and the contact has sent multiple presences with different resources,
the "best" presence is returned, i.e. the presence with the highest priority or the presence with the "most available" <show/> element.
If the JID is a full JID, the exact presence of that JID is returned.
If no presence could be found an unavailable presence is returned.
jid - The JID.public final String requestSubscription(rocks.xmpp.addr.Jid jid, String status)
jid - The contact's JID.status - The status, which is used for additional information during the subscription request.public final String approveSubscription(rocks.xmpp.addr.Jid jid)
jid - The contact's JID, who has previously requested a subscription.public final String denySubscription(rocks.xmpp.addr.Jid jid)
This basically means that the contact won't receive presence information from you.
jid - The contact's JID, whose subscription is denied or canceled.public final String unsubscribe(rocks.xmpp.addr.Jid jid)
That basically means, that you will not receive any presence information from the contact anymore.
jid - The contact's JID.public final Presence getLastSentPresence()
public final Collection<Presence> getLastSentPresences()
Copyright © 2014–2016 XMPP.rocks. All rights reserved.