public final class PrivacyListManager extends Manager
This class manages privacy lists, which allow users to block communications from other users as described in XEP-0016: Privacy Lists.
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(java.util.function.Consumer<PrivacyListEvent> privacyListListener)
Adds a privacy list listener.
|
AsyncResult<IQ> |
createOrUpdateList(PrivacyList privacyList)
Creates or edits a privacy list.
|
AsyncResult<IQ> |
declineActiveList()
Declines the use of any active list.
|
AsyncResult<IQ> |
declineDefaultList()
Declines the use of any default list.
|
AsyncResult<PrivacyList> |
getPrivacyList(java.lang.String name)
Gets a privacy list.
|
AsyncResult<java.util.Collection<PrivacyList>> |
getPrivacyLists()
Gets the privacy lists.
|
AsyncResult<IQ> |
removeList(java.lang.String name)
Removes a privacy list.
|
void |
removePrivacyListListener(java.util.function.Consumer<PrivacyListEvent> privacyListListener)
Removes a previously added privacy list listener.
|
AsyncResult<IQ> |
setActiveList(java.lang.String name)
Changes the active list currently being applied.
|
AsyncResult<IQ> |
setDefaultList(java.lang.String name)
Change the default list (which applies to the user as a whole, not only the sending resource).
|
isEnabled, setEnabled
public void addPrivacyListListener(java.util.function.Consumer<PrivacyListEvent> privacyListListener)
Adds a privacy list listener.
privacyListListener
- The listener.removePrivacyListListener(Consumer)
public void removePrivacyListListener(java.util.function.Consumer<PrivacyListEvent> privacyListListener)
Removes a previously added privacy list listener.
privacyListListener
- The listener.addPrivacyListListener(Consumer)
public AsyncResult<java.util.Collection<PrivacyList>> getPrivacyLists()
Gets the privacy lists.
public AsyncResult<PrivacyList> getPrivacyList(java.lang.String name)
Gets a privacy list.
name
- The privacy list name.public AsyncResult<IQ> setActiveList(java.lang.String name)
Changes the active list currently being applied.
name
- The active list name.public AsyncResult<IQ> declineActiveList()
Declines the use of any active list.
public AsyncResult<IQ> setDefaultList(java.lang.String name)
Change the default list (which applies to the user as a whole, not only the sending resource).
name
- The list name.public AsyncResult<IQ> declineDefaultList()
Declines the use of any default list.
public AsyncResult<IQ> createOrUpdateList(PrivacyList privacyList)
Creates or edits a privacy list.
privacyList
- The privacy list.public AsyncResult<IQ> removeList(java.lang.String name)
Removes a privacy list.
name
- The privacy list.Copyright © 2014–2019 XMPP.rocks. All rights reserved.