org.opends.server.core
Class SimpleSubtreeSpecification

java.lang.Object
  extended by org.opends.server.api.SubtreeSpecification
      extended by org.opends.server.core.SimpleSubtreeSpecification
Direct Known Subclasses:
AbsoluteSubtreeSpecification, RelativeSubtreeSpecification, RFC3672SubtreeSpecification

public abstract class SimpleSubtreeSpecification
extends SubtreeSpecification

A simple subtree specification implementation that has a subtree base, optional minimum and maximum depths, and a set of chop specifications.


Nested Class Summary
protected static class SimpleSubtreeSpecification.Parser
          Internal utility class which can be used by sub-classes to help parse string representations.
 
Constructor Summary
protected SimpleSubtreeSpecification(DN baseDN, int minimumDepth, int maximumDepth, java.lang.Iterable<DN> chopBefore, java.lang.Iterable<DN> chopAfter)
          Create a new simple subtree specification.
 
Method Summary
protected  boolean commonComponentsEquals(SimpleSubtreeSpecification other)
          Determine if the common components of this subtree specification are equal to the common components of another subtre specification.
protected  int commonComponentsHashCode()
          Get a hash code of the subtree specification's common components.
protected  DN getBaseDN()
          Get the absolute base DN of the subtree specification.
 java.lang.Iterable<DN> getChopAfter()
          Get the set of chop after relative DNs.
 java.lang.Iterable<DN> getChopBefore()
          Get the set of chop before relative DNs.
 int getMaximumDepth()
          Get the maximum depth of the subtree specification.
 int getMinimumDepth()
          Get the minimum depth of the subtree specification.
protected  boolean isDNWithinScope(DN dn)
          Determine if the specified DN is within the scope of the subtree specification.
 
Methods inherited from class org.opends.server.api.SubtreeSpecification
equals, hashCode, isWithinScope, toString, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleSubtreeSpecification

protected SimpleSubtreeSpecification(DN baseDN,
                                     int minimumDepth,
                                     int maximumDepth,
                                     java.lang.Iterable<DN> chopBefore,
                                     java.lang.Iterable<DN> chopAfter)
Create a new simple subtree specification.

Parameters:
baseDN - The absolute base DN of the subtree.
minimumDepth - The minimum depth (<=0 means unlimited).
maximumDepth - The maximum depth (<0 means unlimited).
chopBefore - The set of chop before local names (relative to the base DN), or null if there are none.
chopAfter - The set of chop after local names (relative to the base DN), or null if there are none.
Method Detail

isDNWithinScope

protected final boolean isDNWithinScope(DN dn)
Determine if the specified DN is within the scope of the subtree specification.

Parameters:
dn - The distringuished name.
Returns:
Returns true if the DN is within the scope of the subtree specification, or false otherwise.

getBaseDN

protected final DN getBaseDN()
Get the absolute base DN of the subtree specification.

Returns:
Returns the absolute base DN of the subtree specification.

commonComponentsEquals

protected final boolean commonComponentsEquals(SimpleSubtreeSpecification other)
Determine if the common components of this subtree specification are equal to the common components of another subtre specification.

Parameters:
other - The other subtree specification.
Returns:
Returns true if they are equal.

commonComponentsHashCode

protected final int commonComponentsHashCode()
Get a hash code of the subtree specification's common components.

Returns:
The computed hash code.

getChopAfter

public final java.lang.Iterable<DN> getChopAfter()
Get the set of chop after relative DNs.

Returns:
Returns the set of chop after relative DNs, or null if there are not any.

getChopBefore

public final java.lang.Iterable<DN> getChopBefore()
Get the set of chop before relative DNs.

Returns:
Returns the set of chop before relative DNs, or null if there are not any.

getMaximumDepth

public final int getMaximumDepth()
Get the maximum depth of the subtree specification.

Returns:
Returns the maximum depth (<0 indicates unlimited depth).

getMinimumDepth

public final int getMinimumDepth()
Get the minimum depth of the subtree specification.

Returns:
Returns the minimum depth (<=0 indicates unlimited depth).