Package com.isode.dsapi.aci
Class ACIRegion
java.lang.Object
com.isode.dsapi.aci.ACIRegion
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 -
Constructor Summary
ConstructorsConstructorDescriptionACIRegion
(ACIRegion.Type type, DN dn) Construct a new SINGLE, SUBENTRY_SINGLE or SUBENTRY_SUBTREE region based on the given DN.ACIRegion
(AttributeValue subtreespec) Construct an ACIRegion from a subtreeSpecification.Construct a new SUBTREE region for prescriptiveACI for the given base DN and list of ACSAs (i.e. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Tests whether a single normal-entry DN is within the region.boolean
containsSubEntry
(DN dn) 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.getType()
Get the type of the region.int
hashCode()
Hashcodeintersection
(ACIRegion region) Calculate the intersection of two regions, or return null if there is no intersection.boolean
intersects
(ACIRegion region) Tests whether two regions intersect.toString()
Generate debugging string.
-
Constructor Details
-
ACIRegion
Construct a new SINGLE, SUBENTRY_SINGLE or SUBENTRY_SUBTREE region based on the given DN. -
ACIRegion
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 DNacsa
- List of ACSA DNs, or null
-
ACIRegion
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
Get the type of the region. -
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
Get the list of before chop-points for the SUBTREE region-type, or an empty list if there are none. -
getAfterChops
Get the list of after chop-points for the SUBTREE region-type, or an empty list if there are none. -
getSubentryExcludes
Get the list of subentry exclude points for the SUBTREE region-type, or an empty list if there are none. -
contains
Tests whether a single normal-entry DN is within the region. Use containsSubEntry() to test subentry DNs. -
containsSubEntry
Tests whether a single subentry DN is within the region. Use contains() to test normal-entry DNs. -
intersects
Tests whether two regions intersect. -
intersection
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 -
equals
Test for equality. -
toString
Generate debugging string.
-