public final class PrivacyList extends Object implements Comparable<PrivacyList>
This class is immutable.Most instant messaging systems have found it necessary to implement some method for users to block communications from particular other users (this is also required by sections 5.1.5, 5.1.15, 5.3.2, and 5.4.10 of RFC 2779 [3]. In XMPP this is done by managing one's privacy lists using the 'jabber:iq:privacy' namespace.
| Constructor and Description |
|---|
PrivacyList(String name)
Creates a privacy list.
|
PrivacyList(String name,
Collection<PrivacyRule> items)
Creates a privacy list with rules.
|
| Modifier and Type | Method and Description |
|---|---|
PrivacyList |
asActive()
Gets the privacy list marked as active list.
|
PrivacyList |
asDefault()
Gets the privacy list marked as default list.
|
int |
compareTo(PrivacyList o)
Compares this privacy list with another list.
|
static PrivacyList |
createInvisibilityList()
Creates a global invisibility list.
|
static PrivacyList |
createInvisibilityListExceptForGroups(String listName,
String... groups)
Creates a global invisibility list, where you are still visible to some contacts.
|
static PrivacyList |
createInvisibilityListExceptForUsers(String listName,
rocks.xmpp.addr.Jid... jids)
Creates a global invisibility list, where you are still visible to some contacts.
|
static PrivacyList |
createInvisibilityListForGroups(String listName,
String... groups)
Creates a selective invisibility list.
|
static PrivacyList |
createInvisibilityListForUsers(String listName,
rocks.xmpp.addr.Jid... jids)
Creates a selective invisibility list.
|
String |
getName()
Gets the name of the privacy list.
|
List<PrivacyRule> |
getPrivacyRules()
Gets the privacy rules.
|
boolean |
isActive()
Indicates whether this is the active list.
|
boolean |
isDefault()
Indicates whether this is the default list.
|
String |
toString() |
public PrivacyList(String name, Collection<PrivacyRule> items)
name - The privacy list's name.items - The privacy rules.public PrivacyList(String name)
name - The privacy list's name.public static PrivacyList createInvisibilityList()
public static PrivacyList createInvisibilityListExceptForUsers(String listName, rocks.xmpp.addr.Jid... jids)
listName - The list name. See 4. Implementation Notes for recommended list names.jids - The JIDs to which you are still visible.public static PrivacyList createInvisibilityListExceptForGroups(String listName, String... groups)
listName - The list name. See 4. Implementation Notes for recommended list names.groups - The roster groups to which you are still visible.public static PrivacyList createInvisibilityListForUsers(String listName, rocks.xmpp.addr.Jid... jids)
listName - The list name. See 4. Implementation Notes for recommended list names.jids - The JIDs to which you appear invisible.public static PrivacyList createInvisibilityListForGroups(String listName, String... groups)
listName - The list name. See 4. Implementation Notes for recommended list names.groups - The roster groups to which you appear invisible.public final List<PrivacyRule> getPrivacyRules()
public final String getName()
public final boolean isDefault()
public final boolean isActive()
public final PrivacyList asActive()
isActive()public final PrivacyList asDefault()
isDefault()public final int compareTo(PrivacyList o)
compareTo in interface Comparable<PrivacyList>o - The other list.Copyright © 2014–2017 XMPP.rocks. All rights reserved.