Package org.opends.server.types
Class SubtreeSpecification
- java.lang.Object
-
- org.opends.server.types.SubtreeSpecification
-
@PublicAPI(stability=VOLATILE, mayInstantiate=false, mayExtend=true, mayInvoke=false) public final class SubtreeSpecification extends Object
An RFC 3672 subtree specification.This implementation extends RFC 3672 by supporting search filters for specification filters. More specifically, the
Refinement
product has been extended as follows:Refinement = item / and / or / not / Filter Filter = dquote *SafeUTF8Character dquote
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SubtreeSpecification.FilterRefinement
A refinement which uses a search filter.
-
Constructor Summary
Constructors Constructor Description SubtreeSpecification(Dn rootDN)
Create a dummy subtree specification.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
Indicates whether the provided object is logically equal to this subtree specification object.Dn
getBaseDN()
Get the absolute base DN of the subtree specification.org.opends.server.types.SubtreeSpecification.Refinement
getRefinements()
Get the specification filter refinements.int
hashCode()
Retrieves the hash code for this subtree specification object.boolean
isDNWithinScope(Dn dn)
Determine if the specified DN is within the scope of the subtree specification.boolean
isWithinScope(Entry entry)
Determine if an entry is within the scope of the subtree specification.String
toString()
Retrieves a string representation of this subtree specification object.StringBuilder
toString(StringBuilder builder)
Append the string representation of the subtree specification to the provided string builder.static SubtreeSpecification
valueOf(Dn rootDN, String s)
Parses the string argument as an RFC3672 subtree specification.
-
-
-
Constructor Detail
-
SubtreeSpecification
public SubtreeSpecification(Dn rootDN)
Create a dummy subtree specification. To be used when no subtree specification exists, for example in the case of old Draft based ldapSubEntry (non RFC3672 compliant).- Parameters:
rootDN
- The root DN of the subtree.
-
-
Method Detail
-
valueOf
public static SubtreeSpecification valueOf(Dn rootDN, String s) throws LdapException
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:
LdapException
- If the string does not contain a parsable relative subtree specification.
-
equals
public boolean equals(Object obj)
Indicates whether the provided object is logically equal to this subtree specification object.
-
getBaseDN
public Dn getBaseDN()
Get the absolute base DN of the subtree specification.- Returns:
- Returns the absolute base DN of the subtree specification.
-
getRefinements
public org.opends.server.types.SubtreeSpecification.Refinement getRefinements()
Get the specification filter refinements.- Returns:
- Returns the specification filter refinements, or
null
if none were specified.
-
hashCode
public int hashCode()
Retrieves the hash code for this subtree specification object.
-
isDNWithinScope
public boolean isDNWithinScope(Dn dn)
Determine if the specified DN is within the scope of the subtree specification.- Parameters:
dn
- The distinguished name.- Returns:
- Returns
true
if the DN is within the scope of the subtree specification, orfalse
otherwise.
-
isWithinScope
public boolean isWithinScope(Entry entry)
Determine if an entry is within the scope of the subtree specification.- Parameters:
entry
- The entry.- Returns:
true
if the entry is within the scope of the subtree specification, orfalse
if not.
-
toString
public String toString()
Retrieves a string representation of this subtree specification object.
-
toString
public StringBuilder toString(StringBuilder builder)
Append the string representation of the subtree specification to the provided string builder.- Parameters:
builder
- The string builder.- Returns:
- The string builder.
-
-