|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opends.server.types.DN
@PublicAPI(stability=UNCOMMITTED, mayInstantiate=true, mayExtend=false, mayInvoke=true) public class DN
This class defines a data structure for storing and interacting with the distinguished names associated with entries in the Directory Server.
Field Summary | |
---|---|
static DN |
NULL_DN
A singleton instance of the null DN (a DN with no components). |
Constructor Summary | |
---|---|
DN()
Creates a new DN with no RDN components (i.e., a null DN or root DSE). |
|
DN(java.util.List<RDN> rdnComponents)
Creates a new DN with the provided set of RDNs, arranged with the suffix as the last element. |
|
DN(RDN[] rdnComponents)
Creates a new DN with the provided set of RDNs, arranged with the suffix as the last element. |
|
DN(RDN rdn,
DN parentDN)
Creates a new DN with the given RDN below the specified parent. |
Method Summary | |
---|---|
int |
compareTo(DN dn)
Compares this DN with the provided DN based on a natural order. |
DN |
concat(DN relativeBaseDN)
Creates a new DN that is a descendant of this DN, using the specified DN as a relative base DN. |
DN |
concat(RDN rdn)
Creates a new DN that is a child of this DN, using the specified RDN. |
DN |
concat(RDN[] rdnComponents)
Creates a new DN that is a descendant of this DN, using the specified RDN components. |
static DN |
decode(ByteString dnString)
Decodes the provided ASN.1 octet string as a DN. |
static DN |
decode(java.lang.String dnString)
Decodes the provided string as a DN. |
boolean |
equals(java.lang.Object o)
Indicates whether the provided object is equal to this DN. |
int |
getNumComponents()
Retrieves the number of RDN components for this DN. |
DN |
getParent()
Retrieves the DN of the entry that is the immediate parent for this entry. |
DN |
getParentDNInSuffix()
Retrieves the DN of the entry that is the immediate parent for this entry. |
RDN |
getRDN()
Retrieves the outermost RDN component for this DN (i.e., the one that is furthest from the suffix). |
RDN |
getRDN(int pos)
Retrieves the RDN component at the specified position in the set of components for this DN. |
int |
hashCode()
Retrieves the hash code for this DN. |
boolean |
isAncestorOf(DN dn)
Indicates whether this DN is an ancestor of the provided DN (i.e., that the RDN components of this DN are the same as the last RDN components for the provided DN). |
boolean |
isDescendantOf(DN dn)
Indicates whether this DN is a descendant of the provided DN (i.e., that the RDN components of the provided DN are the same as the last RDN components for this DN). |
boolean |
isNullDN()
Indicates whether this represents a null DN. |
boolean |
matchesBaseAndScope(DN baseDN,
SearchScope scope)
Indicates whether this entry falls within the range of the provided search base DN and scope. |
static DN |
nullDN()
Retrieves a singleton instance of the null DN. |
java.lang.String |
toNormalizedString()
Retrieves a normalized string representation of this DN. |
void |
toNormalizedString(java.lang.StringBuilder buffer)
Appends a normalized string representation of this DN to the provided buffer. |
java.lang.String |
toString()
Retrieves a string representation of this DN. |
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this DN to the provided buffer. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static DN NULL_DN
Constructor Detail |
---|
public DN()
public DN(RDN[] rdnComponents)
rdnComponents
- The set of RDN components that make up
this DN.public DN(java.util.List<RDN> rdnComponents)
rdnComponents
- The set of RDN components that make up
this DN.public DN(RDN rdn, DN parentDN)
rdn
- The RDN to use for the new DN. It must not be
null
.parentDN
- The DN of the entry below which the new DN
should exist. It must not be null
.Method Detail |
---|
public static DN nullDN()
public boolean isNullDN()
true
if this does represent a null DN, or
false
if it does not.public int getNumComponents()
public RDN getRDN()
null
if there are no RDN components in the
DN.public RDN getRDN(int pos)
pos
- The position of the RDN component to retrieve.
public DN getParent()
null
if the entry with this
DN does not have a parent.public DN getParentDNInSuffix()
null
if the entry with this
DN does not have a parent (either because there is only
a single RDN component or because this DN is a suffix
defined in the server).public DN concat(RDN rdn)
rdn
- The RDN for the child of this DN.
public DN concat(RDN[] rdnComponents)
rdnComponents
- The RDN components for the descendant of
this DN.
public DN concat(DN relativeBaseDN)
relativeBaseDN
- The relative base DN to concatenate onto
this DN.
public boolean isDescendantOf(DN dn)
dn
- The DN for which to make the determination.
true
if this DN is a descendant of the
provided DN, or false
if not.public boolean isAncestorOf(DN dn)
dn
- The DN for which to make the determination.
true
if this DN is an ancestor of the
provided DN, or false
if not.public boolean matchesBaseAndScope(DN baseDN, SearchScope scope)
baseDN
- The base DN for which to make the determination.scope
- The search scope for which to make the
determination.
true
if this entry is within the given
base and scope, or false
if it is not.public static DN decode(ByteString dnString) throws DirectoryException
dnString
- The ASN.1 octet string to decode as a DN.
DirectoryException
- If a problem occurs while trying to
decode the provided ASN.1 octet
string as a DN.public static DN decode(java.lang.String dnString) throws DirectoryException
dnString
- The string to decode as a DN.
DirectoryException
- If a problem occurs while trying to
decode the provided string as a DN.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- The object for which to make the determination.
true
if the provided object is a DN that is
equal to this DN, or false
if it is not.public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public void toString(java.lang.StringBuilder buffer)
buffer
- The buffer to which the information should be
appended.public java.lang.String toNormalizedString()
public void toNormalizedString(java.lang.StringBuilder buffer)
buffer
- The buffer to which the information should be
appended.public int compareTo(DN dn)
compareTo
in interface java.lang.Comparable<DN>
dn
- The DN against which to compare this DN.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |