public final class PrivacyListManager extends ExtensionManager
Server-side privacy lists enable successful completion of the following use cases:
- Retrieving one's privacy lists.
- Adding, removing, and editing one's privacy lists.
- Setting, changing, or declining active lists.
- Setting, changing, or declining the default list (i.e., the list that is active by default).
- Allowing or blocking messages based on JID, group, or subscription type (or globally).
- Allowing or blocking inbound presence notifications based on JID, group, or subscription type (or globally).
- Allowing or blocking outbound presence notifications based on JID, group, or subscription type (or globally).
- Allowing or blocking IQ stanzas based on JID, group, or subscription type (or globally).
- Allowing or blocking all communications based on JID, group, or subscription type (or globally).
| Modifier and Type | Method and Description |
|---|---|
void |
addPrivacyListListener(PrivacyListListener privacyListListener)
Adds a privacy list listener.
|
void |
createOrUpdateList(PrivacyList privacyList)
Creates or edits a privacy list.
|
void |
declineActiveList()
Declines the use of any active list.
|
void |
declineDefaultList()
Declines the use of any default list.
|
PrivacyList |
getPrivacyList(String name)
Gets a privacy list.
|
Collection<PrivacyList> |
getPrivacyLists()
Gets the privacy lists.
|
void |
removeList(String name)
Removes a privacy list.
|
void |
removePrivacyListListener(PrivacyListListener privacyListListener)
Removes a previously added privacy list listener.
|
void |
setActiveList(String name)
Changes the active list currently being applied.
|
void |
setDefaultList(String name)
Change the default list (which applies to the user as a whole, not only the sending resource).
|
isEnabled, setEnabledpublic void addPrivacyListListener(PrivacyListListener privacyListListener)
privacyListListener - The listener.removePrivacyListListener(PrivacyListListener)public void removePrivacyListListener(PrivacyListListener privacyListListener)
privacyListListener - The listener.addPrivacyListListener(PrivacyListListener)public Collection<PrivacyList> getPrivacyLists() throws XmppException
StanzaException - If the entity returned a stanza error.NoResponseException - If the entity did not respond.XmppExceptionpublic PrivacyList getPrivacyList(String name) throws XmppException
name - The privacy list name.StanzaException - If the entity returned a stanza error.NoResponseException - If the entity did not respond.XmppExceptionpublic void setActiveList(String name) throws XmppException
name - The active list name.StanzaException - If the user attempts to set an active list but a list by that name does not exist, the server MUST return an <item-not-found/> stanza error to the user.NoResponseException - If the entity did not respond.XmppExceptionpublic void declineActiveList()
throws XmppException
StanzaException - If the request returned with an error.NoResponseException - If the entity did not respond.XmppExceptionpublic void setDefaultList(String name) throws XmppException
name - The list name.StanzaException - <conflict/> stanza error to the sending resource<item-not-found/> stanza error to the userNoResponseException - If the entity did not respond.XmppExceptionpublic void declineDefaultList()
throws XmppException
StanzaException - If one connected resource attempts to decline the use of a default list for the user as a whole but the default list currently applies to at least one other connected resource, the server MUST return a <conflict/> error to the sending resource.NoResponseException - If the entity did not respond.XmppExceptionpublic void createOrUpdateList(PrivacyList privacyList) throws XmppException
privacyList - The privacy list.StanzaException - If the entity returned a stanza error.NoResponseException - If the entity did not respond.XmppExceptionpublic void removeList(String name) throws XmppException
name - The privacy list.StanzaException - If the entity returned a stanza error.NoResponseException - If the entity did not respond.XmppExceptionCopyright © 2014–2015 XMPP.rocks. All rights reserved.