org.opends.server.core
Class RelativeSubtreeSpecification

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

public final class RelativeSubtreeSpecification
extends SimpleSubtreeSpecification

A relative subtree specification.

Relative subtree specifications are very similar toRFC 3672 subtree specifications with the only difference being that the specification filter is not a set of refinements, but an LDAP search filter.

The string representation of a relative subtree specification is defined by the following grammar:

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

  ss-relative-base      = "relativeBase&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
RelativeSubtreeSpecification(DN rootDN, DN relativeBaseDN, int minimumDepth, int maximumDepth, java.lang.Iterable<DN> chopBefore, java.lang.Iterable<DN> chopAfter, SearchFilter filter)
          Create a new relative subtree specification.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Indicates whether the provided object is logically equal to this subtree specification object.
 SearchFilter getFilter()
          Get the specification filter.
 DN getRelativeBaseDN()
          Get the relative base DN.
 DN getRootDN()
          Get the root DN.
 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 RelativeSubtreeSpecification valueOf(DN rootDN, java.lang.String s)
          Parses the string argument as a relative 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

RelativeSubtreeSpecification

public RelativeSubtreeSpecification(DN rootDN,
                                    DN relativeBaseDN,
                                    int minimumDepth,
                                    int maximumDepth,
                                    java.lang.Iterable<DN> chopBefore,
                                    java.lang.Iterable<DN> chopAfter,
                                    SearchFilter filter)
Create a new relative subtree specification.

Parameters:
rootDN - The root DN of the subtree.
relativeBaseDN - The relative base DN (or null if not specified).
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 RelativeSubtreeSpecification valueOf(DN rootDN,
                                                   java.lang.String s)
                                            throws DirectoryException
Parses the string argument as a relative subtree specification.

Parameters:
rootDN - The DN of the subtree specification's base entry.
s - The string to be parsed.
Returns:
The relative subtree specification represented by the string argument.
Throws:
DirectoryException - If the string does not contain a parsable relative subtree specification.

getRootDN

public DN getRootDN()
Get the root DN.

Returns:
Returns the root DN.

getRelativeBaseDN

public DN getRelativeBaseDN()
Get the relative base DN.

Returns:
Returns the relative base DN or null if none was specified.

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.