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:
  • Method Details

    • compareTo

      public int compareTo(PrivacyItem other)
      Specified by:
      compareTo in interface Comparable<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 interface Cacheable
      Returns:
      the size of the Object in bytes.