public final class PrivacyListManager extends Manager
PrivacyItem).| Modifier and Type | Field and Description |
|---|---|
static String |
NAMESPACE |
static StanzaFilter |
PRIVACY_FILTER |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addListener(PrivacyListListener listener)
Adds a privacy list listener that will be notified of any new update in the user
privacy communication.
|
void |
createPrivacyList(String listName,
List<PrivacyItem> privacyItems)
The client has created a new list.
|
void |
declineActiveList()
Client declines the use of active lists.
|
void |
declineDefaultList()
Client declines the use of default lists.
|
void |
deletePrivacyList(String listName)
Remove a privacy list.
|
PrivacyList |
getActiveList()
Answer the active privacy list.
|
String |
getActiveListName()
Get the name of the active list.
|
PrivacyList |
getDefaultList()
Answer the default privacy list.
|
String |
getDefaultListName()
Get the name of the default list.
|
String |
getEffectiveListName()
Returns the name of the effective privacy list.
|
static PrivacyListManager |
getInstanceFor(XMPPConnection connection)
Returns the PrivacyListManager instance associated with a given XMPPConnection.
|
PrivacyList |
getPrivacyList(String listName)
Answer the privacy list items under listName with the allowed and blocked permissions.
|
List<PrivacyList> |
getPrivacyLists()
Answer every privacy list with the allowed and blocked permissions.
|
boolean |
isSupported()
Check if the user's server supports privacy lists.
|
boolean |
removeListener(PrivacyListListener listener)
Removes the privacy list listener.
|
void |
setActiveListName(String listName)
Set or change the active list to listName.
|
void |
setDefaultListName(String listName)
Set or change the default list to listName.
|
void |
updatePrivacyList(String listName,
List<PrivacyItem> privacyItems)
The client has edited an existing list.
|
connection, getAuthenticatedConnectionOrThrow, schedulepublic static final String NAMESPACE
public static final StanzaFilter PRIVACY_FILTER
public static PrivacyListManager getInstanceFor(XMPPConnection connection)
connection - the connection used to look for the proper PrivacyListManager.public PrivacyList getActiveList() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
null if there is no active list.XMPPException.XMPPErrorExceptionSmackException.NoResponseExceptionSmackException.NotConnectedExceptionInterruptedExceptionpublic String getActiveListName() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
SmackException.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionInterruptedExceptionpublic PrivacyList getDefaultList() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
null if there is no default list.XMPPException.XMPPErrorExceptionSmackException.NoResponseExceptionSmackException.NotConnectedExceptionInterruptedExceptionpublic String getDefaultListName() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
SmackException.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionInterruptedExceptionpublic String getEffectiveListName() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
The effective privacy list is the one that is currently enforced on the connection. It's either the active privacy list, or, if the active privacy list is not set, the default privacy list.
SmackException.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionInterruptedExceptionpublic PrivacyList getPrivacyList(String listName) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
listName - the name of the list to get the allowed and blocked permissions.XMPPException.XMPPErrorExceptionSmackException.NoResponseExceptionSmackException.NotConnectedExceptionInterruptedExceptionpublic List<PrivacyList> getPrivacyLists() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
XMPPException.XMPPErrorExceptionSmackException.NoResponseExceptionSmackException.NotConnectedExceptionInterruptedExceptionpublic void setActiveListName(String listName) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
listName - the list name to set as the active one.XMPPException.XMPPErrorExceptionSmackException.NoResponseExceptionSmackException.NotConnectedExceptionInterruptedExceptionpublic void declineActiveList() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
public void setDefaultListName(String listName) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
listName - the list name to set as the default one.XMPPException.XMPPErrorExceptionSmackException.NoResponseExceptionSmackException.NotConnectedExceptionInterruptedExceptionpublic void declineDefaultList() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
public void createPrivacyList(String listName, List<PrivacyItem> privacyItems) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
listName - the list that has changed its content.privacyItems - a List with every privacy item in the list.XMPPException.XMPPErrorExceptionSmackException.NoResponseExceptionSmackException.NotConnectedExceptionInterruptedExceptionpublic void updatePrivacyList(String listName, List<PrivacyItem> privacyItems) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
PrivacyItem list MUST contain all elements in the
list (not the "delta").listName - the list that has changed its content.privacyItems - a List with every privacy item in the list.XMPPException.XMPPErrorExceptionSmackException.NoResponseExceptionSmackException.NotConnectedExceptionInterruptedExceptionpublic void deletePrivacyList(String listName) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
listName - the list that has changed its content.XMPPException.XMPPErrorExceptionSmackException.NoResponseExceptionSmackException.NotConnectedExceptionInterruptedExceptionpublic boolean addListener(PrivacyListListener listener)
listener - a privacy list listener.public boolean removeListener(PrivacyListListener listener)
listener - public boolean isSupported() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
XMPPException.XMPPErrorExceptionSmackException.NoResponseExceptionSmackException.NotConnectedExceptionInterruptedException