org.apache.directory.shared.ldap.subtree
Class BaseSubtreeSpecification

java.lang.Object
  extended byorg.apache.directory.shared.ldap.subtree.BaseSubtreeSpecification
All Implemented Interfaces:
SubtreeSpecification

public class BaseSubtreeSpecification
extends java.lang.Object
implements SubtreeSpecification

A simple implementation of the SubtreeSpecification interface.

Version:
$Rev: 379008 $
Author:
Apache Directory Project

Field Summary
 
Fields inherited from interface org.apache.directory.shared.ldap.subtree.SubtreeSpecification
UNBOUNDED_MAX
 
Constructor Summary
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(javax.naming.Name 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(javax.naming.Name base, int minBaseDistance, int maxBaseDistance, java.util.Set chopAfter, java.util.Set chopBefore)
          Creates a subtree without a refinement filter where all other aspects can be varied.
BaseSubtreeSpecification(javax.naming.Name base, int minBaseDistance, int maxBaseDistance, java.util.Set chopAfter, java.util.Set chopBefore, ExprNode refinement)
          Creates a subtree which may be a refinement filter where all aspects of the specification can be set.
 
Method Summary
 javax.naming.Name getBase()
          Gets an RDN relative to the administrative context where the subtree scope begins.
 java.util.Set getChopAfterExclusions()
          A set of RDNs relative to the base entry representing chopAfter specificExclusions from the subtree.
 java.util.Set 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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(javax.naming.Name 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(javax.naming.Name base,
                                int minBaseDistance,
                                int maxBaseDistance,
                                java.util.Set chopAfter,
                                java.util.Set 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 point
minBaseDistance - the minimum distance below base to start including entries
maxBaseDistance - the maximum distance from base past which entries are excluded
chopAfter - the set of subordinates entries whose subordinates are to be excluded
chopBefore - the set of subordinates entries and their subordinates to exclude

BaseSubtreeSpecification

public BaseSubtreeSpecification(javax.naming.Name base,
                                int minBaseDistance,
                                int maxBaseDistance,
                                java.util.Set chopAfter,
                                java.util.Set 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 to BaseSubtreeSpecification(Name, int, int, Set, Set).

Parameters:
base - the base of the subtree relative to the administrative point
minBaseDistance - the minimum distance below base to start including entries
maxBaseDistance - the maximum distance from base past which entries are excluded
chopAfter - the set of subordinates entries whose subordinates are to be excluded
chopBefore - the set of subordinates entries and their subordinates to exclude
refinement - the filter expression only composed of objectClass attribute value assertions
Method Detail

getBase

public javax.naming.Name 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 interface SubtreeSpecification
Returns:
the RDN representing the base of the subtree, or the empty name if the base is the administrative point - note that this Name is not Normalized according to matchingRules.

getChopBeforeExclusions

public java.util.Set 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 interface SubtreeSpecification
Returns:
a set of relative Names to the subtree base or the empty set

getChopAfterExclusions

public java.util.Set 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 interface SubtreeSpecification
Returns:
a set of relative Names to the subtree base or the empty set

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 interface SubtreeSpecification
Returns:
the minimum number of RDN arcs relative to base for inclusion

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 interface SubtreeSpecification
Returns:
the number of arcs relative to the base after which entries are excluded
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 interface SubtreeSpecification
Returns:
a limited filter expression tree representing a subtree refinement or null if one does not exist for this subtree specification


Copyright © 2003-2006 . All Rights Reserved.