Class SimpleACIItem

java.lang.Object
com.isode.dsapi.aci.SimpleACIItem

public class SimpleACIItem extends Object
A simple-ACI item consisting of a role, rule and area.

The fields of this class may be accessed directly.

Since:
15.0
Author:
jp
  • Field Details

    • precedence

      public int precedence
      Precedence level: 0-255. Higher-numbered rules override lower-numbered rules.
    • role

      public SimpleACIRole role
      Role for an 'allow' rule, or null for a 'deny' rule.
    • rule

      public SimpleACIRule rule
      Rule
    • area

      public SimpleACIArea area
      Area
    • ORDER

      public static final Comparator<SimpleACIItem> ORDER
      Comparator to order SimpleACIItems: highest precedence first, then deny before allow, then ordered by role name, then by rule name.
  • Constructor Details

    • SimpleACIItem

      public SimpleACIItem()
      Construct a blank ACI item.
    • SimpleACIItem

      public SimpleACIItem(int precedence, SimpleACIRole role, SimpleACIRule rule, SimpleACIArea area)
      Construct an ACI item from a precedence, role, rule and area.
    • SimpleACIItem

      public SimpleACIItem(SimpleACIItem item)
      Copy constructor. Copies original info as well, so that 'changed' status is maintained.
  • Method Details

    • dup

      public SimpleACIItem dup()
      Copy a SimpleACIItem. This is a shallow copy, but it does copy the original values, so the changed status will be maintained.
    • hasChanged

      public boolean hasChanged()
      Test whether this item has changed compared to its original values.
    • wasBlank

      public boolean wasBlank()
      Check whether the original settings were blank.
    • setUnchanged

      public void setUnchanged()
      Clear the 'changed' state by copying the current values over the original values.
    • revert

      public void revert()
      Revert changes. Note that if the original settings were blank (test with wasBlank()), then reverting will leave the item invalid.
    • dumpXML

      public void dumpXML(com.isode.util.XMLOutput out) throws IOException
      Dump item as XML. Rules and roles are included by name only.
      Throws:
      IOException
    • loadXML

      public static SimpleACIItem loadXML(com.isode.util.XMLInput in, List<SimpleACIRule> rules, List<SimpleACIRole> roles)
      Try to load up the SimpleACIItem from XML using the given role and rule lists as context. Returns null if not found.
    • hashCode

      public int hashCode()
      Return hash code.
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Debugging dump.
      Overrides:
      toString in class Object