public class PrivacyListManager
extends org.jivesoftware.smack.Manager
PrivacyItem
).Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAMESPACE |
static org.jivesoftware.smack.filter.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(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.
|
java.lang.String |
getActiveListName()
Get the name of the active list.
|
PrivacyList |
getDefaultList()
Answer the default privacy list.
|
java.lang.String |
getDefaultListName()
Get the name of the default list.
|
java.lang.String |
getEffectiveListName()
Returns the name of the effective privacy list.
|
static PrivacyListManager |
getInstanceFor(org.jivesoftware.smack.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.
|
java.util.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(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.
|
public static final java.lang.String NAMESPACE
public static final org.jivesoftware.smack.filter.StanzaFilter PRIVACY_FILTER
public static PrivacyListManager getInstanceFor(org.jivesoftware.smack.XMPPConnection connection)
connection
- the connection used to look for the proper PrivacyListManager.public PrivacyList getActiveList() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException
org.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NoResponseException
org.jivesoftware.smack.SmackException.NotConnectedException
public java.lang.String getActiveListName() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException
org.jivesoftware.smack.SmackException.NoResponseException
org.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NotConnectedException
public PrivacyList getDefaultList() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException
org.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NoResponseException
org.jivesoftware.smack.SmackException.NotConnectedException
public java.lang.String getDefaultListName() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException
org.jivesoftware.smack.SmackException.NoResponseException
org.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NotConnectedException
public java.lang.String getEffectiveListName() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException
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.
org.jivesoftware.smack.SmackException.NoResponseException
org.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NotConnectedException
public PrivacyList getPrivacyList(java.lang.String listName) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException
listName
- the name of the list to get the allowed and blocked permissions.org.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NoResponseException
org.jivesoftware.smack.SmackException.NotConnectedException
public java.util.List<PrivacyList> getPrivacyLists() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException
org.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NoResponseException
org.jivesoftware.smack.SmackException.NotConnectedException
public void setActiveListName(java.lang.String listName) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException
listName
- the list name to set as the active one.org.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NoResponseException
org.jivesoftware.smack.SmackException.NotConnectedException
public void declineActiveList() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException
org.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NoResponseException
org.jivesoftware.smack.SmackException.NotConnectedException
public void setDefaultListName(java.lang.String listName) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException
listName
- the list name to set as the default one.org.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NoResponseException
org.jivesoftware.smack.SmackException.NotConnectedException
public void declineDefaultList() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException
org.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NoResponseException
org.jivesoftware.smack.SmackException.NotConnectedException
public void createPrivacyList(java.lang.String listName, java.util.List<PrivacyItem> privacyItems) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException
listName
- the list that has changed its content.privacyItems
- a List with every privacy item in the list.org.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NoResponseException
org.jivesoftware.smack.SmackException.NotConnectedException
public void updatePrivacyList(java.lang.String listName, java.util.List<PrivacyItem> privacyItems) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.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.org.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NoResponseException
org.jivesoftware.smack.SmackException.NotConnectedException
public void deletePrivacyList(java.lang.String listName) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException
listName
- the list that has changed its content.org.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NoResponseException
org.jivesoftware.smack.SmackException.NotConnectedException
public boolean addListener(PrivacyListListener listener)
listener
- a privacy list listener.public boolean removeListener(PrivacyListListener listener)
listener
- public boolean isSupported() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException
org.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NoResponseException
org.jivesoftware.smack.SmackException.NotConnectedException