org.opends.server.core
Class AbsoluteSubtreeSpecification

java.lang.Object
  extended by org.opends.server.api.SubtreeSpecification
      extended by org.opends.server.core.SimpleSubtreeSpecification
          extended by org.opends.server.core.AbsoluteSubtreeSpecification

public final class AbsoluteSubtreeSpecification
extends SimpleSubtreeSpecification

An absolute subtree specification.

Absolute subtree specifications are based on RFC 3672 subtree specifications but have the following differences:

The string representation of an absolute subtree specification is defined by the following grammar:

  SubtreeSpecification  = "{"       sp ss-absolute-base
                              [ sep sp ss-specificExclusions ]
                              [ sep sp ss-minimum ]
                              [ sep sp ss-maximum ]
                              [ sep sp ss-specificationFilter ]
                       sp "}"

  ss-absolute-base      = "absoluteBase&quot msp DistinguishedName

  ss-specificExclusions = "specificExclusions&quot
                                             msp SpecificExclusions

  ss-minimum            = "minimum&quot msp BaseDistance

  ss-maximum            = "maximum&quot msp BaseDistance

  ss-specificationFilter = "specificationFilter&quot msp Filter

  SpecificExclusions    = "{"
                            [ sp SpecificExclusion
                              ( "," sp SpecificExclusion ) ]
                       sp "}"

  SpecificExclusion     = chopBefore / chopAfter

  chopBefore            = "chopBefore&quot ":" LocalName

  chopAfter             = "chopAfter&quot ":" LocalName

  Filter                = dquote *SafeUTF8Character dquote
 


Nested Class Summary
 
Nested classes/interfaces inherited from class org.opends.server.core.SimpleSubtreeSpecification
SimpleSubtreeSpecification.Parser
 
Constructor Summary
AbsoluteSubtreeSpecification(DN absoluteBaseDN, int minimumDepth, int maximumDepth, java.lang.Iterable<DN> chopBefore, java.lang.Iterable<DN> chopAfter, SearchFilter filter)
          Create a new absolute subtree specification.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Indicates whether the provided object is logically equal to this subtree specification object.
 DN getAbsoluteBaseDN()
          Get the absolute base DN.
 SearchFilter getFilter()
          Get the specification filter.
 int hashCode()
          Retrieves the hash code for this subtree specification object.
 boolean isWithinScope(Entry entry)
          Determine if an entry is within the scope of the subtree specification.
 java.lang.StringBuilder toString(java.lang.StringBuilder builder)
          Append the string representation of the subtree specification to the provided string builder.
static AbsoluteSubtreeSpecification valueOf(java.lang.String s)
          Parses the string argument as an absolute subtree specification.
 
Methods inherited from class org.opends.server.core.SimpleSubtreeSpecification
commonComponentsEquals, commonComponentsHashCode, getBaseDN, getChopAfter, getChopBefore, getMaximumDepth, getMinimumDepth, isDNWithinScope
 
Methods inherited from class org.opends.server.api.SubtreeSpecification
toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbsoluteSubtreeSpecification

public AbsoluteSubtreeSpecification(DN absoluteBaseDN,
                                    int minimumDepth,
                                    int maximumDepth,
                                    java.lang.Iterable<DN> chopBefore,
                                    java.lang.Iterable<DN> chopAfter,
                                    SearchFilter filter)
Create a new absolute subtree specification.

Parameters:
absoluteBaseDN - 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.
filter - The optional search filter (null if there is no filter).
Method Detail

valueOf

public static AbsoluteSubtreeSpecification valueOf(java.lang.String s)
                                            throws DirectoryException
Parses the string argument as an absolute subtree specification.

The parser is very lenient regarding the ordering of the various subtree specification fields. However, it will not except multiple occurrances of a particular field.

Parameters:
s - The string to be parsed.
Returns:
The absolute subtree specification represented by the string argument.
Throws:
DirectoryException - If the string does not contain a parsable absolute subtree specification.

getAbsoluteBaseDN

public DN getAbsoluteBaseDN()
Get the absolute base DN.

Returns:
Returns the absolute base DN.

getFilter

public SearchFilter getFilter()
Get the specification filter.

Returns:
Returns the search filter, or null if there is no filter.

isWithinScope

public boolean isWithinScope(Entry entry)
Determine if an entry is within the scope of the subtree specification.

Specified by:
isWithinScope in class SubtreeSpecification
Parameters:
entry - The entry.
Returns:
true if the entry is within the scope of the subtree specification, or false if not.

toString

public java.lang.StringBuilder toString(java.lang.StringBuilder builder)
Append the string representation of the subtree specification to the provided string builder.

Specified by:
toString in class SubtreeSpecification
Parameters:
builder - The string builder.
Returns:
The string builder.

equals

public boolean equals(java.lang.Object obj)
Indicates whether the provided object is logically equal to this subtree specification object.

Specified by:
equals in class SubtreeSpecification
Parameters:
obj - The object for which to make the determination.
Returns:
true if the provided object is logically equal to this subtree specification object, or false if not.

hashCode

public int hashCode()
Retrieves the hash code for this subtree specification object.

Specified by:
hashCode in class SubtreeSpecification
Returns:
The hash code for this subtree specification object.