public final class PresenceManager extends Manager
See also 3. Managing Presence Subscriptions
This class allows to request, approve, deny and unsubscribe subscriptions.
This class is unconditionally thread-safe.| Modifier and Type | Method and Description |
|---|---|
String |
approveSubscription(Jid jid)
Approves a subscription request.
|
String |
denySubscription(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(Jid jid)
Gets the presence for a given contact.
|
String |
requestSubscription(Jid jid,
String status)
Sends a subscription request to a potential contact.
|
String |
unsubscribe(Jid jid)
Unsubscribes from a contact's presence.
|
isEnabled, setEnabledpublic final Presence getPresence(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(Jid jid, String status)
See also 3.1.1. Client Generation of Outbound Subscription Request
jid - The contact's JID.status - The status, which is used for additional information during the subscription request.public final String approveSubscription(Jid jid)
See also 3.1.4. Client Processing of Inbound Subscription Request
jid - The contact's JID, who has previously requested a subscription.public final String denySubscription(Jid jid)
This basically means that the contact won't receive presence information from you.
See also 3.2.1. Client Generation of Subscription Cancellationjid - The contact's JID, whose subscription is denied or canceled.public final String unsubscribe(Jid jid)
That basically means, that you will not receive any presence information from the contact anymore.
See also 3.3.1. Client Generation of Unsubscribejid - The contact's JID.public final Presence getLastSentPresence()
public final Collection<Presence> getLastSentPresences()
Copyright © 2014–2016 XMPP.rocks. All rights reserved.