org.opends.server.core
Class RFC3672SubtreeSpecification

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

public final class RFC3672SubtreeSpecification
extends SimpleSubtreeSpecification

An RFC 3672 subtree specification.

Refer to RFC 3672 for a detailed definition of the subtree specification string representation.


Nested Class Summary
static class RFC3672SubtreeSpecification.AndRefinement
          RFC 3672 subtree specification AND refinement.
static class RFC3672SubtreeSpecification.ItemRefinement
          RFC 3672 subtree specification Item refinement.
static class RFC3672SubtreeSpecification.NotRefinement
          RFC 3672 subtree specification NOT refinement.
static class RFC3672SubtreeSpecification.OrRefinement
          RFC 3672 subtree specification OR refinement.
static class RFC3672SubtreeSpecification.Refinement
          Abstract interface for RFC3672 specification filter refinements.
 
Nested classes/interfaces inherited from class org.opends.server.core.SimpleSubtreeSpecification
SimpleSubtreeSpecification.Parser
 
Constructor Summary
RFC3672SubtreeSpecification(DN rootDN, DN relativeBaseDN, int minimumDepth, int maximumDepth, java.lang.Iterable<DN> chopBefore, java.lang.Iterable<DN> chopAfter, RFC3672SubtreeSpecification.Refinement refinements)
          Create a new RFC3672 subtree specification.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Indicates whether the provided object is logically equal to this subtree specification object.
 RFC3672SubtreeSpecification.Refinement getRefinements()
          Get the specification filter refinements.
 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 RFC3672SubtreeSpecification valueOf(DN rootDN, java.lang.String s)
          Parses the string argument as an RFC3672 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

RFC3672SubtreeSpecification

public RFC3672SubtreeSpecification(DN rootDN,
                                   DN relativeBaseDN,
                                   int minimumDepth,
                                   int maximumDepth,
                                   java.lang.Iterable<DN> chopBefore,
                                   java.lang.Iterable<DN> chopAfter,
                                   RFC3672SubtreeSpecification.Refinement refinements)
Create a new RFC3672 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 relative base DN), or null if there are none.
chopAfter - The set of chop after local names (relative to the relative base DN), or null if there are none.
refinements - The optional specification filter refinements, or null if there are none.
Method Detail

valueOf

public static RFC3672SubtreeSpecification valueOf(DN rootDN,
                                                  java.lang.String s)
                                           throws DirectoryException
Parses the string argument as an RFC3672 subtree specification.

Parameters:
rootDN - The DN of the subtree specification's base entry.
s - The string to be parsed.
Returns:
The RFC3672 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.

getRefinements

public RFC3672SubtreeSpecification.Refinement getRefinements()
Get the specification filter refinements.

Returns:
Returns the specification filter refinements, or null if none were specified.

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.