public final class PrivacyRule extends Object implements Comparable<PrivacyRule>
- 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.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 incoming IQ stanzas are filtered.
|
boolean |
isFilterMessage()
Indicates, whether incoming message stanzas are filtered.
|
boolean |
isFilterPresenceIn()
Indicates, whether incoming presence notifications are filtered.
|
boolean |
isFilterPresenceOut()
Indicates, whether outgoing presence notifications are filtered.
|
void |
setAction(PrivacyRule.Action action)
Sets the action to perform (either allow or deny).
|
void |
setFilterIQ(boolean filterIQ)
Indicates, whether incoming IQ stanzas are filtered.
|
void |
setFilterMessage(boolean filterMessages)
Indicates, whether incoming message stanzas are filtered.
|
void |
setFilterPresenceIn(boolean filterPresenceIn)
Indicates, whether incoming presence notifications are filtered.
|
void |
setFilterPresenceOut(boolean filterPresenceOut)
Indicates, whether outgoing presence notifications are filtered.
|
void |
setOrder(int order)
Gets the order in which privacy items are processed by the server.
|
void |
setType(PrivacyRule.Type type)
Sets the type.
|
void |
setValue(String value)
Sets the value.
|
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 PrivacyRule.Type getType()
setType(PrivacyRule.Type)public void setType(PrivacyRule.Type type)
type - The type.getType()public PrivacyRule.Action getAction()
setAction(PrivacyRule.Action)public void setAction(PrivacyRule.Action action)
action - The action.getAction()public String getValue()
setValue(String)public void setValue(String value)
PrivacyRule.Type.JID, then the value must be a valid JID.PrivacyRule.Type.GROUP, then the value should be the name of a group in the user's roster.PrivacyRule.Type.SUBSCRIPTION, then the value must be one of "both", "to", "from", or "none".value - The value.getValue()public long getOrder()
setOrder(int)public void setOrder(int order)
order - The order.getOrder()public boolean isFilterMessage()
setFilterMessage(boolean)public void setFilterMessage(boolean filterMessages)
filterMessages - True, if incoming message stanzas are filtered.isFilterMessage()public boolean isFilterIQ()
setFilterIQ(boolean)public void setFilterIQ(boolean filterIQ)
filterIQ - True, if incoming IQ stanzas are filtered.isFilterIQ()public boolean isFilterPresenceIn()
setFilterPresenceIn(boolean)public void setFilterPresenceIn(boolean filterPresenceIn)
filterPresenceIn - True, if incoming presence notifications are filtered.isFilterPresenceIn()public boolean isFilterPresenceOut()
setFilterPresenceOut(boolean)public void setFilterPresenceOut(boolean filterPresenceOut)
filterPresenceOut - True, if outgoing presence notifications are filtered.isFilterPresenceOut()public int compareTo(PrivacyRule o)
compareTo in interface Comparable<PrivacyRule>o - The other rule.Copyright © 2014 XMPP.rocks. All rights reserved.