Skip to content

Rdn

The Rdn class provides methods to manipulate relative distinguished names (RDNs).

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

Namespace: Softerra.Adaxes.Ldap

Constructors

  • Constructor

  • Description

  • Rdn()

  • Constructs a new instance of the Rdn class.

  • Rdn(String)

  • Constructs a new instance of the Rdn class based on a string representation of a relative distinguished name (RDN).

  • Rdn(Rdn)

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

  • Rdn(String, String)

  • Constructs a new instance of the Rdn class based on the specified RDN type and value.

Methods

  • Method

  • Description

  • AddPart(String, String)

  • Adds an RDN type-value pair to the collection based on the passed RDN type and RDN value strings.

  • AddPart(RdnPart)

  • Adds an RDN type-value pair to the collection.

  • ToString()

  • Returns a string representation of the RDN.

  • Explode(Boolean)

  • Returns individual components of the RDN as an array of String.

  • Explode(String, Boolean)

  • Returns individual components of a given RDN as an array of String, normalized.

  • Escape()

  • Returns the given RDN after escaping the characters that require escaping as per RFC 2253.

  • EscapeAttributeValue()

  • Returns the given RDN value after escaping the characters that require escaping as per RFC 2253.

  • Unescape()

  • Returns the given RDN after unescaping the characters that require escaping as per RFC 2253.

  • UnescapeAttributeValue()

  • Returns the given RDN value after unescaping the characters that require escaping as per RFC 2253.

  • CompareTo()

  • Compares the RDN with another RDN.

Properties

  • Property

  • Description

  • PartCount

  • Gets the number of RDN type-value pairs that this RDN contains.

  • Parts

  • Gets a collection of RDN type-value pairs that this RDN consists of.

  • RdnPart

  • Gets the first RDN type-value pair of all the pairs that this RDN consists of.

  • Type

  • Gets the type of this RDN.

  • Types

  • Gets a list of types that this RDN contains.

  • Value

  • Gets the value of this RDN.

  • Values

  • Gets a list of values that this RDN contains.

  • IsMultivalued

  • Gets a value that indicates whether the RDN is multivalued.

Details

Rdn()

Constructs a new instance of the Rdn class.

Rdn()

Rdn(String)

Constructs a new instance of the Rdn class based on a string representation of a relative distinguished name (RDN).

Rdn(String rdn)

Exceptions

  • ArgumentNullException
  • The rdn parameter is NULL.

  • ArgumentException

  • The rdn parameter contains a string with more than one RDN or does not contain a valid RDN string as per RFC 2253.

Rdn(Rdn)

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

Rdn(Rdn otherRdn)

Rdn(String, String)

Constructs a new instance of the Rdn class based on the specified RDN type and value.

Rdn(String type, String value)

AddPart(String, String)

Adds an RDN type-value pair to the collection based on the passed RDN type and RDN value strings.

void AddPart(String type, String value)

AddPart(RdnPart)

Adds an RDN type-value pair to the collection.

void AddPart(RdnPart part)

ToString()

Returns a string representation of the RDN.

String ToString(Boolean noTypes)

Parameters

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(Boolean)

Returns individual components of the RDN as an array of String.

String[] Explode(Boolean noTypes)

Parameters

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 individual components of a given RDN as an array of String, normalized.

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

Parameters

  • rdn - Contains the relative 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”).

Escape()

Returns the given RDN after escaping the characters that require escaping as per RFC 2253 (e.g. for RDN “CN=Acme, Inc” the method returns “CN=Acme\, Inc”).

static String Escape(String rdn)

EscapeAttributeValue()

Returns the given RDN value after escaping the characters that require escaping as per RFC 2253 (e.g. for RDN value “Acme, Inc” the method returns “Acme\, Inc”).

static String EscapeAttributeValue(String rdnValue)

Unescape()

Returns the given RDN after unescaping the characters that require escaping as per RFC 2253 (e.g. for RDN “CN=Acme\, Inc” the method returns “CN=Acme, Inc”).

static String Unescape(String rdn)

UnescapeAttributeValue()

Returns the given RDN value after unescaping the characters that require escaping as per RFC 2253 (e.g. for RDN value “Acme\, Inc” the method returns “Acme, Inc”).

static String UnescapeAttributeValue(String rdnValue)

CompareTo()

Compares the RDN with another RDN.

Int32 CompareTo(Rdn otherRdn)

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 RDN is less than the RDN specified in the otherRdn parameter.
  • If the return value is 0, this RDN is equal to the RDN specified in the otherRdn parameter.
  • If the return value is greater than zero, this RDN is greater than the RDN specified in the otherRdn parameter.

PartCount

Gets the number of RDN type-value pairs that this RDN contains.

  • Type:
  • Int32
  • Access:
  • Read-only

Parts

Gets a collection of RDN type-value pairs that this RDN consists of.

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

RdnPart

Gets the first RDN type-value pair of all the pairs that this RDN consists of.

Remarks

If the instance of the Rdn class is empty, the property gets an empty instance of the RdnPart class.


Type

Gets the type of this RDN.

  • Type:
  • String
  • Access:
  • Read-only

Remarks

This property assumes that the RDN contains only one RDN type-value pair. When multivalued RDNs are used, the property gets only the first RDN type. Use the Types property to obtain all the types.


Types

Gets a list of types that this RDN contains.

  • Type:
  • IList<String>
  • Access:
  • Read-only

Value

Gets the value of this RDN.

  • Type:
  • String
  • Access:
  • Read-only

Remarks

When multivalued RDNs are used, the property gets only the first RDN value. Use the Values property to get all the values.


Values

Gets a list of values that this RDN contains.

  • Type:
  • IList<String>
  • Access:
  • Read-only

IsMultivalued

Gets a value that indicates whether the RDN is multivalued.

  • Type:
  • Boolean
  • Access:
  • Read-only

Requirements

Minimum required version: 2009.1

See also