Class PrivacyItem
- java.lang.Object
-
- org.jivesoftware.openfire.privacy.PrivacyItem
-
- All Implemented Interfaces:
Serializable
,Comparable<PrivacyItem>
,Cacheable
public class PrivacyItem extends Object implements Cacheable, Comparable<PrivacyItem>
A privacy item acts a rule that when matched defines if a packet should be blocked or not.- Author:
- Gaston Dombiak
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PrivacyItem.Type
Type defines if the rule is based on JIDs, roster groups or presence subscription types.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(PrivacyItem other)
int
getCachedSize()
Returns the approximate size of the Object in bytes.String
getGroup()
org.xmpp.packet.JID
getJID()
int
getOrder()
RosterItem.SubType
getSubscription()
PrivacyItem.Type
getType()
boolean
isAllow()
boolean
isType(PrivacyItem.Type type)
boolean
matchesCondition(org.xmpp.packet.Packet packet, Roster roster, org.xmpp.packet.JID userJID)
Returns true if the packet to analyze matches the condition defined by this rule.
-
-
-
Method Detail
-
compareTo
public int compareTo(PrivacyItem other)
- Specified by:
compareTo
in interfaceComparable<PrivacyItem>
-
matchesCondition
public boolean matchesCondition(org.xmpp.packet.Packet packet, Roster roster, org.xmpp.packet.JID userJID)
Returns true if the packet to analyze matches the condition defined by this rule. Variables involved in the analysis are: type (e.g. jid, group, etc.), value (based on the type) and granular control that defines which type of packets should be considered.- Parameters:
packet
- the packet to analyze if matches the rule's condition.roster
- the roster of the owner of the privacy list.userJID
- the JID of the owner of the privacy list.- Returns:
- true if the packet to analyze matches the condition defined by this rule.
-
getOrder
public int getOrder()
-
isAllow
public boolean isAllow()
-
isType
public boolean isType(PrivacyItem.Type type)
-
getType
public PrivacyItem.Type getType()
-
getJID
public org.xmpp.packet.JID getJID()
-
getGroup
public String getGroup()
-
getSubscription
public RosterItem.SubType getSubscription()
-
getCachedSize
public int getCachedSize()
Description copied from interface:Cacheable
Returns the approximate size of the Object in bytes. The size should be considered to be a best estimate of how much memory the Object occupies and may be based on empirical trials or dynamic calculations.- Specified by:
getCachedSize
in interfaceCacheable
- Returns:
- the size of the Object in bytes.
-
-