Class ACIRegion

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

public class ACIRegion extends Object
ACIRegion: A region of the DIT which is affected by ACI. There are four types of region:
  • SINGLE: single-entry scope, for entryACI rules used in a normal entry
  • SUBENTRY_SINGLE: single-entry scope, for entryACI rules used in a subentry
  • SUBTREE: a region of the DIT consisting of one specific entry and all entries below it, optionally limited by a set of before/after chop-points, depth min/max limits and objectclass filters. Subentries are included, although subentries immediately below specific entries may be excluded. With immediate subentries excluded, this corresponds to the scope of prescriptiveACI rules found in a subentry of an ACSA or ACIA entry; note that the ACSA/ACIA entry itself is included in the scope of prescriptiveACI, although X.501 isn't too clear on that. Inferior ACSA starting-points become chop points as a new scope begins at each inferior ACSA. The rest of the limits are derived from the subtreeSpecification. @@@ TODO: Some limits derived from the subtreeSpecification are not-yet-implemented.
  • SUBENTRY_SUBTREE: a number of subentries immediately below a parent entry, corresponding to the scope of subentryACI rules found in an ACSA or ACIA entry

Note that each of these types correspond to either just subentries or just normal entries, except for SUBTREE which does cover subentries (except ones that have been specifically excluded).

Tests may be done to see if a given DN is within the region, to test whether two regions overlap, and to generate the region that is the intersection of two other regions.

Author:
jp
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Types for ACIRegion
  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct a new SINGLE, SUBENTRY_SINGLE or SUBENTRY_SUBTREE region based on the given DN.
    Construct an ACIRegion from a subtreeSpecification.
    ACIRegion(DN base, List<DN> acsa)
    Construct a new SUBTREE region for prescriptiveACI for the given base DN and list of ACSAs (i.e.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Tests whether a single normal-entry DN is within the region.
    boolean
    Tests whether a single subentry DN is within the region.
    boolean
    Test for equality.
    Get the list of after chop-points for the SUBTREE region-type, or an empty list if there are none.
    Get the base DN associated with the region (depending on its type): for SINGLE and SUBENTRY_SINGLE it is the entry-DN, for SUBENTRY_SUBTREE it is the parent of the subentries, for SUBTREE it is the base of the subtree.
    Get the list of before chop-points for the SUBTREE region-type, or an empty list if there are none.
    Get the list of subentry exclude points for the SUBTREE region-type, or an empty list if there are none.
    Get the type of the region.
    int
    Hashcode
    Calculate the intersection of two regions, or return null if there is no intersection.
    boolean
    Tests whether two regions intersect.
    Generate debugging string.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ACIRegion

      public ACIRegion(ACIRegion.Type type, DN dn)
      Construct a new SINGLE, SUBENTRY_SINGLE or SUBENTRY_SUBTREE region based on the given DN.
    • ACIRegion

      public ACIRegion(DN base, List<DN> acsa)
      Construct a new SUBTREE region for prescriptiveACI for the given base DN and list of ACSAs (i.e. possible chop-points). The chops-points are filtered to the ones within the subtree. Immediate subentries are excluded from the region.
      Parameters:
      base - Base DN
      acsa - List of ACSA DNs, or null
    • ACIRegion

      public ACIRegion(AttributeValue subtreespec) throws BadValueException
      Construct an ACIRegion from a subtreeSpecification. TODO: Note that min/max depth limits and objectclass refinements aren't supported at the moment -- they will give an exception.
      Parameters:
      subtreespec - AttributeValue containing specification
      Throws:
      BadValueException - if there is a decoding error or if a part of the subtreespec is specified that we don't yet support.
  • Method Details

    • getType

      public ACIRegion.Type getType()
      Get the type of the region.
    • getBaseDN

      public DN getBaseDN()
      Get the base DN associated with the region (depending on its type): for SINGLE and SUBENTRY_SINGLE it is the entry-DN, for SUBENTRY_SUBTREE it is the parent of the subentries, for SUBTREE it is the base of the subtree.
    • getBeforeChops

      public List<DN> getBeforeChops()
      Get the list of before chop-points for the SUBTREE region-type, or an empty list if there are none.
    • getAfterChops

      public List<DN> getAfterChops()
      Get the list of after chop-points for the SUBTREE region-type, or an empty list if there are none.
    • getSubentryExcludes

      public List<DN> getSubentryExcludes()
      Get the list of subentry exclude points for the SUBTREE region-type, or an empty list if there are none.
    • contains

      public boolean contains(DN dn)
      Tests whether a single normal-entry DN is within the region. Use containsSubEntry() to test subentry DNs.
    • containsSubEntry

      public boolean containsSubEntry(DN dn)
      Tests whether a single subentry DN is within the region. Use contains() to test normal-entry DNs.
    • intersects

      public boolean intersects(ACIRegion region)
      Tests whether two regions intersect.
    • intersection

      public ACIRegion intersection(ACIRegion region) throws BadValueException
      Calculate the intersection of two regions, or return null if there is no intersection.
      Throws:
      BadValueException - if the intersection can't be represented.
    • hashCode

      public int hashCode()
      Hashcode
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Test for equality.
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Generate debugging string.
      Overrides:
      toString in class Object