Skip to content

DN

The DN class contains methods to manipulate distinguished names (DNs).

Inheritance: The DN class implements the IComparable<DN> interface.

Namespace: Softerra.Adaxes.Ldap

Constructors

  • Constructor

  • Description

  • DN()

  • Constructs a new instance of the DN class.

  • DN(String)

  • Constructs a new instance of the DN class based on the specified string representation of the distinguished name.

  • DN(DN)

  • Constructs a new instance of the DN class by copying the DN from another instance of the DN class.

Methods

  • Method

  • Description

  • Explode(Boolean)

  • Returns an array of the individual relative distinguished names (RDNs) that the DN consists of.

  • Explode(String, Boolean)

  • Returns an array of the individual relative distinguished names (RDNs) that a given DN consists of.

  • Normalize()

  • Normalizes a given DN by removing non-significant space characters as per RFC 2253, Section4.

  • Concat(String, String[])

  • Concatenates an attribute type and one or more attribute values into a distinguished name string.

  • Concat(String[], String[])

  • Concatenates one or more attribute types and one or more attribute values into a distinguished name string.

  • IsValid()

  • Checks whether the specified string conforms to the distinguished name syntax.

  • AreEqual()

  • Checks whether the two strings correspond to the same DN using case-ignore matching.

  • IsDescendantOf()

  • Checks whether the directory object represented by the DN is a descendant of the specified DN of a directory object.

  • AddLeaf(Rdn)

  • Adds the specified RDN to the beginning of this DN.

  • AddLeaf(DN)

  • Adds the specified DN to the beginning of this DN.

  • AddLeaf(String)

  • Adds the specified DN represented by a String to the beginning of this DN.

  • AddParent(Rdn)

  • Adds the specified RDN to the end of this DN.

  • AddParent(DN)

  • Adds the specified DN to the end of this DN.

  • AddParent(String)

  • Adds the specified DN represented by a String to the end of this DN.

  • CompareTo()

  • Compares the DN with another DN.

Properties

  • Property

  • Description

  • Rdns

  • Gets a collection of relative distinguished names (RDNs) the distinguished name consists of.

  • Parent

  • Gets the parent DN of this DN. If this DN holds an empty DN (RootDSE), the returned instance of the DN class contains an empty DN as well.

  • Leaf

  • Gets the leaf relative distinguished name (RDN) of the DN.

Details

DN()

Constructs a new instance of the DN class.

DN()

DN(String)

Constructs a new instance of the DN class based on the specified string representation of the distinguished name.

DN(String dn)

Parameters

The dn parameter contains a string representation of the distinguished name.

Exceptions

  • ArgumentNullException
  • The dn parameter is NULL.

  • InvalidDNException

  • The value passed by the dn parameter does not adhere to the syntax described in RFC2253.

DN(DN)

Constructs a new instance of the DN class by copying the DN from another instance of the DN class.

DN(DN otherDn)

Exceptions

  • ArgumentNullException
  • The otherDn parameter is NULL.

Explode(Boolean)

Returns an array of the individual relative distinguished names (RDNs) that the DN consists of.

String[] Explode(Boolean noTypes)

Remarks

If the noTypes parameter is set to TRUE, the method returns only RDN values without RDN types (e.g. John Doe, Accounting, com instead of CN=John Doe, OU=Accounting, and DC=com).


Explode(String,Boolean)

Returns an array of the individual relative distinguished names (RDNs) that a given DN consists of.

static String[] Explode(String dn, Boolean noTypes)

Parameters

  • dn - Contains the distinguished name to parse.
  • noTypes - If set to TRUE, the method returns only RDN values without RDN types (e.g. John Doe, Accounting, com instead of CN=John Doe, OU=Accounting, and DC=com).

Normalize()

Normalizes a given DN by removing non-significant space characters as per RFC 2253, Section4.

static String Normalize(String dn)

Concat(String,String[])

Concatenates an attribute type and one or more attribute values into a distinguished name string.

static String Concat(String attributeType, String[] attributeValues)

Concat(String[],String[])

Concatenates one or more attribute types and one or more attribute values into a distinguished name string.

static String Concat(String[] attributeTypes, String[] attributeValues)

IsValid()

Checks whether the specified string conforms to the distinguished name syntax.

static Boolean IsValid(String dn)

AreEqual()

Checks whether the two strings correspond to the same DN using case-ignore matching.

static Boolean AreEqual(String x, String y)

Exceptions

  • InvalidDNException
  • One of or both the strings do not contain a valid DN.

IsDescendantOf()

Checks whether the directory object represented by the DN is a descendant of the specified DN of a directory object.

Boolean IsDescendantOf(DN containerDN)

AddLeaf(Rdn)

Adds the specified RDN to the beginning of this DN.

void AddLeaf(Rdn rdn)

AddLeaf(DN)

Adds the specified DN to the beginning of this DN.

void AddLeaf(DN dn)

AddLeaf(String)

Adds the specified DN represented by a String to the beginning of this DN.

void AddLeaf(String dn)

AddParent(Rdn)

Adds the specified RDN to the end of this DN.

void AddParent(Rdn rdn)

AddParent(DN)

Adds the specified DN to the end of this DN.

void AddParent(DN dn)

AddParent(String)

Adds the specified DN represented by a String to the end of this DN.

void AddParent(String dn)

CompareTo()

Compares the DN with another DN.

Int32 CompareTo(DN otherDn)

Return value

The method returns an Int32 that indicates the relative order of the objects being compared. The return value has the following meanings:

  • If the return value is less than zero, this DN is less than the DN specified in the otherDn parameter.
  • If the return value is 0, this DN is equal to the DN specified in the otherDn parameter.
  • If the return value is greater than zero, this DN is greater than the DN specified in the otherDn parameter.

Rdns

Gets a collection of relative distinguished names (RDNs) the distinguished name consists of. Each element in the collection is represented by the Rdn class.

  • Type:
  • Collection<Rdn>
  • Access:
  • Read-only

Parent

Gets the parent DN of this DN. If this DN holds an empty DN (RootDSE), the returned instance of the DN class contains an empty DN as well.

  • Type:
  • DN
  • Access:
  • Read-only

Leaf

Gets the leaf relative distinguished name (RDN) of the DN.

  • Type:
  • Rdn
  • Access:
  • Read-only

Requirements

Minimum required version: 2009.1

See also