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 classPrivacyItem.TypeType 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 intcompareTo(PrivacyItem other)intgetCachedSize()Returns the approximate size of the Object in bytes.StringgetGroup()org.xmpp.packet.JIDgetJID()intgetOrder()RosterItem.SubTypegetSubscription()PrivacyItem.TypegetType()booleanisAllow()booleanisType(PrivacyItem.Type type)booleanmatchesCondition(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:
compareToin 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:CacheableReturns 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:
getCachedSizein interfaceCacheable- Returns:
- the size of the Object in bytes.
-
-