package org.jivesoftware.smack.packet; import java.util.*; /** * A Privacy IQ Packet, is used by the {@see PrivacyListManager} and {@see PrivacyProvider} to allow * and block communications from other users. It contains the appropriate structure to suit * user-defined privacy lists. Different configured Privacy packages are used in the Server – * Manager communication in order to: *
* * @return the name of the active list. */ public String getActiveName() { return activeName; } /** * Sets the name associated with the active list set for the session. Communications * will be verified against the active list.
*
* @param activeName is the name of the active list.
*/
public void setActiveName(String activeName) {
this.activeName = activeName;
}
/**
* Returns the name of the default list that applies to the user as a whole. Default list is
* processed if there is no active list set for the target session/resource to which a stanza
* is addressed, or if there are no current sessions for the user.
*
* @return the name of the default list.
*/
public String getDefaultName() {
return defaultName;
}
/**
* Sets the name of the default list that applies to the user as a whole. Default list is
* processed if there is no active list set for the target session/resource to which a stanza
* is addressed, or if there are no current sessions for the user.
*
* If there is no default list set, then all Privacy Items are processed.
*
* @param defaultName is the name of the default list.
*/
public void setDefaultName(String defaultName) {
this.defaultName = defaultName;
}
/**
* Returns the collection of privacy list that the user holds. A Privacy List contains a set of
* rules that define if communication with the list owner is allowed or denied.
* Users may have zero, one or more privacy items.
*
* @return a map where the key is the name of the list and the value the
* collection of privacy items.
*/
public Map");
} else {
buf.append("
");
}
for (PrivacyItem item : items) {
// Append the item xml representation
buf.append(item.toXML());
}
// Close the list tag
if (!items.isEmpty()) {
buf.append("
");
}
}
// Add packet extensions, if any are defined.
buf.append(getExtensionsXML());
buf.append("