Package org.forgerock.opendj.ldap
Class SubtreeSpecification
java.lang.Object
org.forgerock.opendj.ldap.SubtreeSpecification
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 ClassesModifier and TypeClassDescriptionstatic final classA refinement which uses a search filter.static classAbstract interface for RFC3672 specification filter refinements. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether the provided object is logically equal to this subtree specification object.Get the absolute base DN of the subtree specification.Get the ChopAfter LocalNames from the specificExclusions.Get the ChopBefore LocalNames from the specificExclusions.intGet the maximumDepth.intGet the minimumDepth.Get the specification filter refinements.Get the relative base LocalName, ie the "base" field.inthashCode()Retrieves the hash code for this subtree specification object.booleanisDNWithinScope(Dn dn) Determine if the specified DN is within the scope of the subtree specification.booleanisWithinScope(Entry entry, Schema schema) Determine if an entry is within the scope of the subtree specification.static voidtoRFC3641StringValue(StringBuilder builder, String string) Append a string to a string builder, escaping any double quotes according to the StringValue production in RFC 3641.toString()Retrieves a string representation of this subtree specification object.toString(StringBuilder builder) Append the string representation of the subtree specification to the provided string builder.static SubtreeSpecificationParses the string argument as an RFC3672 subtree specification.
-
Constructor Details
-
SubtreeSpecification
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 Details
-
valueOf
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
Indicates whether the provided object is logically equal to this subtree specification object. -
getBaseDN
Get the absolute base DN of the subtree specification.- Returns:
- Returns the absolute base DN of the subtree specification.
-
getChopAfter
Get the ChopAfter LocalNames from the specificExclusions.- Returns:
- A collection of LocalNames (i.e. DNs but relative to the base parameter)
-
getChopBefore
Get the ChopBefore LocalNames from the specificExclusions.- Returns:
- A collection of LocalNames (i.e. DNs but relative to the base parameter)
-
getRefinements
Get the specification filter refinements.- Returns:
- Returns the specification filter refinements, or
nullif none were specified.
-
getRelativeBaseDN
Get the relative base LocalName, ie the "base" field.- Returns:
- The Dn
-
getMinimumDepth
public int getMinimumDepth()Get the minimumDepth.- Returns:
- The minimum depth.
-
getMaximumDepth
public int getMaximumDepth()Get the maximumDepth.- Returns:
- The maximum depth.
-
hashCode
public int hashCode()Retrieves the hash code for this subtree specification object. -
isDNWithinScope
Determine if the specified DN is within the scope of the subtree specification.- Parameters:
dn- The distinguished name.- Returns:
- Returns
trueif the DN is within the scope of the subtree specification, orfalseotherwise.
-
isWithinScope
Determine if an entry is within the scope of the subtree specification.- Parameters:
entry- the entryschema- the schema- Returns:
trueif the entry is within the scope of the subtree specification, orfalseif not.
-
toString
Retrieves a string representation of this subtree specification object. -
toString
Append the string representation of the subtree specification to the provided string builder.- Parameters:
builder- The string builder.- Returns:
- The string builder.
-
toRFC3641StringValue
Append a string to a string builder, escaping any double quotes according to the StringValue production in RFC 3641.In RFC 3641 the StringValue production looks like this:
StringValue = dquote *SafeUTF8Character dquote dquote = %x22 ; " (double quote) SafeUTF8Character = %x00-21 / %x23-7F / ; ASCII minus dquote dquote dquote / ; escaped double quote %xC0-DF %x80-BF / ; 2 byte UTF-8 character %xE0-EF 2(%x80-BF) / ; 3 byte UTF-8 character %xF0-F7 3(%x80-BF) ; 4 byte UTF-8 characterThat is, strings are surrounded by double-quotes and any internal double-quotes are doubled up.
- Parameters:
builder- The string builder.string- The string to escape and append.
-