C# Class Novell.Directory.Ldap.Utilclass.DN

A DN encapsulates a Distinguished Name (an ldap name with context). A DN does not need to be fully distinguished, or extend to the Root of a directory. It provides methods to get information about the DN and to manipulate the DN. The following are examples of valid DN:
  • cn=admin,ou=marketing,o=corporation
  • cn=admin,ou=marketing
  • 2.5.4.3=admin,ou=marketing
  • oid.2.5.4.3=admin,ou=marketing
Note: Multivalued attributes are all considered to be one component and are represented in one RDN (see RDN)
Inheritance: System.Object
Datei anzeigen Open project: EventStore/csharp-ldap Class Usage Examples

Public Methods

Method Description
DN ( ) : System
DN ( System dnString ) : System

Constructs a new DN based on the specified string representation of a distinguished name. The syntax of the DN must conform to that specified in RFC 2253.

Equals ( DN toDN ) : bool
Equals ( System toDN ) : bool
ToString ( ) : System.String

Creates and returns a string that represents this DN. The string follows RFC 2253, which describes String representation of DN's and RDN's

addRDN ( RDN rdn ) : void

Adds the RDN to the beginning of the current DN.

addRDNToBack ( RDN rdn ) : void

Adds the RDN to the end of the current DN

addRDNToFront ( RDN rdn ) : void

Adds the RDN to the beginning of the current DN.

countRDNs ( ) : int

Retrieves the count of RDNs, or individule names, in the Distinguished name

explodeDN ( bool noTypes ) : System.String[]

return a string array of the individual RDNs contained in the DN

getrdnList ( ) : System.Collections.ArrayList

Compares this DN to the specified DN to determine if they are equal.

isDescendantOf ( DN containerDN ) : bool

Determines if this DN is contained by the DN passed in. For example: "cn=admin, ou=marketing, o=corporation" is contained by "o=corporation", "ou=marketing, o=corporation", and "ou=marketing" but not by "cn=admin" or "cn=admin,ou=marketing,o=corporation" Note: For users of Netscape's SDK this method is comparable to contains

Private Methods

Method Description
InitBlock ( ) : void
hexToChar ( char hex1, char hex0 ) : char

Converts two valid hex digit characters that form the string representation of an ascii character value to the actual ascii character.

isAlpha ( char ch ) : bool

Checks a character to see if it is an ascii alphabetic character in ranges 65-90 or 97-122.

isDigit ( char ch ) : bool

Checks a character to see if it is an ascii digit (0-9) character in the ascii value range 48-57.

isHexDigit ( char ch ) : bool

Checks a character to see if it is valid hex digit 0-9, a-f, or A-F (ASCII value ranges 48-47, 65-70, 97-102).

needsEscape ( char ch ) : bool

Checks a character to see if it must always be escaped in the string representation of a DN. We must tests for space, sharp, and equals individually.

Method Details

DN() public method

public DN ( ) : System
return System

DN() public method

Constructs a new DN based on the specified string representation of a distinguished name. The syntax of the DN must conform to that specified in RFC 2253.
IllegalArgumentException if the the value of the dnString /// parameter does not adhere to the syntax described in /// RFC 2253 ///
public DN ( System dnString ) : System
dnString System a string representation of the distinguished name ///
return System

Equals() public method

public Equals ( DN toDN ) : bool
toDN DN
return bool

Equals() public method

public Equals ( System toDN ) : bool
toDN System
return bool

ToString() public method

Creates and returns a string that represents this DN. The string follows RFC 2253, which describes String representation of DN's and RDN's
public ToString ( ) : System.String
return System.String

addRDN() public method

Adds the RDN to the beginning of the current DN.
public addRDN ( RDN rdn ) : void
rdn RDN an RDN to be added ///
return void

addRDNToBack() public method

Adds the RDN to the end of the current DN
public addRDNToBack ( RDN rdn ) : void
rdn RDN an RDN to be added ///
return void

addRDNToFront() public method

Adds the RDN to the beginning of the current DN.
public addRDNToFront ( RDN rdn ) : void
rdn RDN an RDN to be added ///
return void

countRDNs() public method

Retrieves the count of RDNs, or individule names, in the Distinguished name
public countRDNs ( ) : int
return int

explodeDN() public method

return a string array of the individual RDNs contained in the DN
public explodeDN ( bool noTypes ) : System.String[]
noTypes bool If true, returns only the values of the /// components, and not the names, e.g. "Babs /// Jensen", "Accounting", "Acme", "us" - instead of /// "cn=Babs Jensen", "ou=Accounting", "o=Acme", and /// "c=us". ///
return System.String[]

getrdnList() public method

Compares this DN to the specified DN to determine if they are equal.
public getrdnList ( ) : System.Collections.ArrayList
return System.Collections.ArrayList

isDescendantOf() public method

Determines if this DN is contained by the DN passed in. For example: "cn=admin, ou=marketing, o=corporation" is contained by "o=corporation", "ou=marketing, o=corporation", and "ou=marketing" but not by "cn=admin" or "cn=admin,ou=marketing,o=corporation" Note: For users of Netscape's SDK this method is comparable to contains
public isDescendantOf ( DN containerDN ) : bool
containerDN DN of a container ///
return bool