public final class PrivacyRule extends Object implements Comparable<PrivacyRule>
This class is immutable.
- The order in which privacy list items are processed by the server is important. List items MUST be processed in ascending order determined by the integer values of the 'order' attribute for each
<item/>.- As soon as a stanza is matched against a privacy list rule, the server MUST appropriately handle the stanza in accordance with the rule and cease processing.
- If no fall-through item is provided in a list, the fall-through action is assumed to be "allow".
| Modifier and Type | Class and Description |
|---|---|
static class |
PrivacyRule.Action
Defines the action to perform with the privacy item: either allow or deny communication.
|
static class |
PrivacyRule.Type
Defines the type of communication which should be allowed of denied.
|
| Constructor and Description |
|---|
PrivacyRule(PrivacyRule.Action action,
long order)
Creates a privacy list item, which allows or blocks everything.
|
PrivacyRule(PrivacyRule.Action action,
long order,
Contact.Subscription subscription)
Creates a privacy rule of type 'subscription'.
|
PrivacyRule(PrivacyRule.Action action,
long order,
Jid jid)
Creates a privacy rule of type 'jid'.
|
PrivacyRule(PrivacyRule.Action action,
long order,
String group)
Creates a privacy rule of type 'group'.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(PrivacyRule o)
Compares this rule with another rule by comparing their order.
|
PrivacyRule |
filterIQ()
Creates a privacy rule, which filters IQ stanzas.
|
PrivacyRule |
filterMessage()
Creates a privacy rule, which filters message stanzas.
|
PrivacyRule |
filterPresenceIn()
Creates a privacy rule, which filters inbound presence stanzas.
|
PrivacyRule |
filterPresenceOut()
Creates a privacy rule, which filters outbound presence stanzas.
|
PrivacyRule.Action |
getAction()
Sets the action to perform (either allow or deny).
|
long |
getOrder()
Gets the order in which privacy items are processed by the server.
|
PrivacyRule.Type |
getType()
Gets the type.
|
String |
getValue()
Gets the value.
|
boolean |
isFilterIQ()
Indicates, whether inbound IQ stanzas are filtered.
|
boolean |
isFilterMessage()
Indicates, whether inbound message stanzas are filtered.
|
boolean |
isFilterPresenceIn()
Indicates, whether inbound presence notifications are filtered.
|
boolean |
isFilterPresenceOut()
Indicates, whether outbound presence notifications are filtered.
|
String |
toString() |
public PrivacyRule(PrivacyRule.Action action, long order)
action - The action to perform, i.e. either allow or deny.order - The order in which the privacy item is processed by the server. A non-negative integer that is unique among all items in the list.public PrivacyRule(PrivacyRule.Action action, long order, Contact.Subscription subscription)
action - The action to perform, i.e. either allow or deny.order - The order in which the privacy item is processed by the server. A non-negative integer that is unique among all items in the list.subscription - The subscription.public PrivacyRule(PrivacyRule.Action action, long order, Jid jid)
action - The action to perform, i.e. either allow or deny.order - The order in which the privacy item is processed by the server. A non-negative integer that is unique among all items in the list.jid - The JID.public PrivacyRule(PrivacyRule.Action action, long order, String group)
action - The action to perform, i.e. either allow or deny.order - The order in which the privacy item is processed by the server. A non-negative integer that is unique among all items in the list.group - The contact group.public final PrivacyRule.Type getType()
public final PrivacyRule.Action getAction()
public final String getValue()
public final long getOrder()
public final boolean isFilterMessage()
public final PrivacyRule filterMessage()
isFilterMessage()public final boolean isFilterIQ()
public final PrivacyRule filterIQ()
isFilterIQ()public final boolean isFilterPresenceIn()
public final PrivacyRule filterPresenceIn()
isFilterPresenceIn()public final boolean isFilterPresenceOut()
public final PrivacyRule filterPresenceOut()
isFilterPresenceOut()public final int compareTo(PrivacyRule o)
compareTo in interface Comparable<PrivacyRule>o - The other rule.Copyright © 2014–2015 XMPP.rocks. All rights reserved.