public class PrivacyListManager extends Manager
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NAMESPACE |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(PrivacyListListener listener)
Adds a packet listener that will be notified of any new update in the user
privacy communication.
|
void |
createPrivacyList(java.lang.String listName,
java.util.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(java.lang.String listName)
Remove a privacy list.
|
PrivacyList |
getActiveList()
Answer the active privacy list.
|
PrivacyList |
getDefaultList()
Answer the default privacy list.
|
static PrivacyListManager |
getInstanceFor(XMPPConnection connection)
Returns the PrivacyListManager instance associated with a given XMPPConnection.
|
PrivacyList |
getPrivacyList(java.lang.String listName)
Answer the privacy list items under listName with the allowed and blocked permissions.
|
PrivacyList[] |
getPrivacyLists()
Answer every privacy list with the allowed and blocked permissions.
|
boolean |
isSupported()
Check if the user's server supports privacy lists.
|
void |
setActiveListName(java.lang.String listName)
Set or change the active list to listName.
|
void |
setDefaultListName(java.lang.String listName)
Set or change the default list to listName.
|
void |
updatePrivacyList(java.lang.String listName,
java.util.List<PrivacyItem> privacyItems)
The client has edited an existing list.
|
connection, schedulepublic static final java.lang.String NAMESPACE
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
XMPPException.XMPPErrorExceptionSmackException.NoResponseExceptionSmackException.NotConnectedExceptionpublic PrivacyList getDefaultList() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException
XMPPException.XMPPErrorExceptionSmackException.NoResponseExceptionSmackException.NotConnectedExceptionpublic PrivacyList getPrivacyList(java.lang.String listName) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException
listName - the name of the list to get the allowed and blocked permissions.XMPPException.XMPPErrorExceptionSmackException.NoResponseExceptionSmackException.NotConnectedExceptionpublic PrivacyList[] getPrivacyLists() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException
XMPPException.XMPPErrorExceptionSmackException.NoResponseExceptionSmackException.NotConnectedExceptionpublic void setActiveListName(java.lang.String listName)
throws SmackException.NoResponseException,
XMPPException.XMPPErrorException,
SmackException.NotConnectedException
listName - the list name to set as the active one.XMPPException.XMPPErrorExceptionSmackException.NoResponseExceptionSmackException.NotConnectedExceptionpublic void declineActiveList()
throws SmackException.NoResponseException,
XMPPException.XMPPErrorException,
SmackException.NotConnectedException
public void setDefaultListName(java.lang.String listName)
throws SmackException.NoResponseException,
XMPPException.XMPPErrorException,
SmackException.NotConnectedException
listName - the list name to set as the default one.XMPPException.XMPPErrorExceptionSmackException.NoResponseExceptionSmackException.NotConnectedExceptionpublic void declineDefaultList()
throws SmackException.NoResponseException,
XMPPException.XMPPErrorException,
SmackException.NotConnectedException
public void createPrivacyList(java.lang.String listName,
java.util.List<PrivacyItem> privacyItems)
throws SmackException.NoResponseException,
XMPPException.XMPPErrorException,
SmackException.NotConnectedException
listName - the list that has changed its content.privacyItems - a List with every privacy item in the list.XMPPException.XMPPErrorExceptionSmackException.NoResponseExceptionSmackException.NotConnectedExceptionpublic void updatePrivacyList(java.lang.String listName,
java.util.List<PrivacyItem> privacyItems)
throws SmackException.NoResponseException,
XMPPException.XMPPErrorException,
SmackException.NotConnectedException
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.NotConnectedExceptionpublic void deletePrivacyList(java.lang.String listName)
throws SmackException.NoResponseException,
XMPPException.XMPPErrorException,
SmackException.NotConnectedException
listName - the list that has changed its content.XMPPException.XMPPErrorExceptionSmackException.NoResponseExceptionSmackException.NotConnectedExceptionpublic void addListener(PrivacyListListener listener)
listener - a packet listener.public boolean isSupported()
throws SmackException.NoResponseException,
XMPPException.XMPPErrorException,
SmackException.NotConnectedException
XMPPException.XMPPErrorExceptionSmackException.NoResponseExceptionSmackException.NotConnectedException