Class BaseSubtreeSpecification
- java.lang.Object
-
- org.apache.directory.api.ldap.model.subtree.BaseSubtreeSpecification
-
- All Implemented Interfaces:
SubtreeSpecification
public class BaseSubtreeSpecification extends Object implements SubtreeSpecification
A simple implementation of the SubtreeSpecification interface.- Author:
- Apache Directory Project
-
-
Field Summary
-
Fields inherited from interface org.apache.directory.api.ldap.model.subtree.SubtreeSpecification
UNBOUNDED_MAX
-
-
Constructor Summary
Constructors Constructor Description BaseSubtreeSpecification()
Creates a simple subtree whose administrative point is necessarily the base and all subordinates underneath (excluding those that are part of inner areas) are part of the the subtree.BaseSubtreeSpecification(ExprNode refinement)
Creates a simple subtree refinement whose administrative point is necessarily the base and only those subordinates selected by the refinement filter are included.BaseSubtreeSpecification(Dn base)
Creates a simple subtree whose administrative point above the base and all subordinates underneath the base (excluding those that are part of inner areas) are part of the the subtree.BaseSubtreeSpecification(Dn base, int minBaseDistance, int maxBaseDistance, Set<Dn> chopAfter, Set<Dn> chopBefore)
Creates a subtree without a refinement filter where all other aspects can be varied.BaseSubtreeSpecification(Dn base, int minBaseDistance, int maxBaseDistance, Set<Dn> chopAfter, Set<Dn> chopBefore, ExprNode refinement)
Creates a subtree which may be a refinement filter where all aspects of the specification can be set.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Dn
getBase()
Gets an Rdn relative to the administrative context where the subtree scope begins.Set<Dn>
getChopAfterExclusions()
A set of RDNs relative to the base entry representing chopAfter specificExclusions from the subtree.Set<Dn>
getChopBeforeExclusions()
A set of RDNs relative to the base entry representing chopBefore specificExclusions from the subtree.int
getMaxBaseDistance()
Gets the distance after which to start excluding entries in the subtree or subtree refinement.int
getMinBaseDistance()
Gets the distance at which to start including entries in the subtree.ExprNode
getRefinement()
A subtree refinement represents a non-contiguous selection of entries using a limited filter expression where attribute assertions are based on the objectClass of the entries.String
toString()
void
toString(StringBuilder buffer)
Converts this item into its string representation as stored in directory.
-
-
-
Constructor Detail
-
BaseSubtreeSpecification
public BaseSubtreeSpecification()
Creates a simple subtree whose administrative point is necessarily the base and all subordinates underneath (excluding those that are part of inner areas) are part of the the subtree.
-
BaseSubtreeSpecification
public BaseSubtreeSpecification(ExprNode refinement)
Creates a simple subtree refinement whose administrative point is necessarily the base and only those subordinates selected by the refinement filter are included.- Parameters:
refinement
- the filter expression only composed of objectClass attribute value assertions
-
BaseSubtreeSpecification
public BaseSubtreeSpecification(Dn base)
Creates a simple subtree whose administrative point above the base and all subordinates underneath the base (excluding those that are part of inner areas) are part of the the subtree.- Parameters:
base
- the base of the subtree relative to the administrative point
-
BaseSubtreeSpecification
public BaseSubtreeSpecification(Dn base, int minBaseDistance, int maxBaseDistance, Set<Dn> chopAfter, Set<Dn> chopBefore)
Creates a subtree without a refinement filter where all other aspects can be varied.- Parameters:
base
- the base of the subtree relative to the administrative pointminBaseDistance
- the minimum distance below base to start including entriesmaxBaseDistance
- the maximum distance from base past which entries are excludedchopAfter
- the set of subordinates entries whose subordinates are to be excludedchopBefore
- the set of subordinates entries and their subordinates to exclude
-
BaseSubtreeSpecification
public BaseSubtreeSpecification(Dn base, int minBaseDistance, int maxBaseDistance, Set<Dn> chopAfter, Set<Dn> chopBefore, ExprNode refinement)
Creates a subtree which may be a refinement filter where all aspects of the specification can be set. If the refinement filter is null this defaults toBaseSubtreeSpecification(org.apache.directory.api.ldap.model.name.Dn, int, int, Set, Set)
.- Parameters:
base
- the base of the subtree relative to the administrative pointminBaseDistance
- the minimum distance below base to start including entriesmaxBaseDistance
- the maximum distance from base past which entries are excludedchopAfter
- the set of subordinates entries whose subordinates are to be excludedchopBefore
- the set of subordinates entries and their subordinates to excluderefinement
- the filter expression only composed of objectClass attribute value assertions
-
-
Method Detail
-
getBase
public Dn getBase()
Description copied from interface:SubtreeSpecification
Gets an Rdn relative to the administrative context where the subtree scope begins. All subentries containing these specifications are immediate subordinates to the administrative point, and are considered to be part of the same naming context. Hence the base for the subtree specification of a subentry immediately subordinate to dc=apache,dc=org would be relative to the dc=apache,dc=org context.- Specified by:
getBase
in interfaceSubtreeSpecification
- Returns:
- The base
-
getChopBeforeExclusions
public Set<Dn> getChopBeforeExclusions()
Description copied from interface:SubtreeSpecification
A set of RDNs relative to the base entry representing chopBefore specificExclusions from the subtree. According to RFC 3672: "If the chopBefore form is used then the specified entry and its subordinates are excluded from the subtree or subtree refinement."- Specified by:
getChopBeforeExclusions
in interfaceSubtreeSpecification
- Returns:
- The set of ChopBefore exclusions
-
getChopAfterExclusions
public Set<Dn> getChopAfterExclusions()
Description copied from interface:SubtreeSpecification
A set of RDNs relative to the base entry representing chopAfter specificExclusions from the subtree. According to RFC 3672: "If the chopAfter form is used then only the subordinates of the specified entry are excluded from the subtree or subtree refinement."- Specified by:
getChopAfterExclusions
in interfaceSubtreeSpecification
- Returns:
- The set of ChopAfter exclusions
-
getMinBaseDistance
public int getMinBaseDistance()
Description copied from interface:SubtreeSpecification
Gets the distance at which to start including entries in the subtree. All entries whose Rdn arcs relative to the base are less than the minimum are excluded from the subtree or subtree refinement. The default is zero and therefore excludes nothing.- Specified by:
getMinBaseDistance
in interfaceSubtreeSpecification
- Returns:
- The mimimum distance from the base
-
getMaxBaseDistance
public int getMaxBaseDistance()
Description copied from interface:SubtreeSpecification
Gets the distance after which to start excluding entries in the subtree or subtree refinement. RFC 3672 Section 2.1.3 states: "Entries that are more than the maximum number of Rdn arcs below the base entry are excluded from the subtree or subtree refinement. An absent maximum component indicates that there is no upper limit on the number of Rdn arcs below the base entry for entries in the subtree or subtree refinement." If the maximum is limitless a negative value should be used to represent the maximum distance - which makes no sense other than to denote the lack of an upper limit.- Specified by:
getMaxBaseDistance
in interfaceSubtreeSpecification
- Returns:
- The maximum distance from the base
- See Also:
SubtreeSpecification.UNBOUNDED_MAX
-
getRefinement
public ExprNode getRefinement()
Description copied from interface:SubtreeSpecification
A subtree refinement represents a non-contiguous selection of entries using a limited filter expression where attribute assertions are based on the objectClass of the entries.- Specified by:
getRefinement
in interfaceSubtreeSpecification
- Returns:
- The refinement
-
toString
public void toString(StringBuilder buffer)
Converts this item into its string representation as stored in directory.- Specified by:
toString
in interfaceSubtreeSpecification
- Parameters:
buffer
- the string buffer
-
toString
public String toString()
- Overrides:
toString
in classObject
- See Also:
Object.toString()
-
-