Class PrivacyItem
java.lang.Object
org.jivesoftware.openfire.privacy.PrivacyItem
- All Implemented Interfaces:
Serializable
,Comparable<PrivacyItem>
,Cacheable
A privacy item acts a rule that when matched defines if a packet should be blocked or not.
- Author:
- Gaston Dombiak
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Type defines if the rule is based on JIDs, roster groups or presence subscription types. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(PrivacyItem other) int
Returns the approximate size of the Object in bytes.getGroup()
org.xmpp.packet.JID
getJID()
int
getOrder()
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 Details
-
compareTo
- 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
-
getType
-
getJID
public org.xmpp.packet.JID getJID() -
getGroup
-
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.
-