C# Class Novell.Directory.Ldap.LdapConnection

The central class that encapsulates the connection to a directory server through the Ldap protocol. LdapConnection objects are used to perform common Ldap operations such as search, modify and add. In addition, LdapConnection objects allow you to bind to an Ldap server, set connection and search constraints, and perform several other tasks. An LdapConnection object is not connected on construction and can only be connected to one server at one port. Multiple threads may share this single connection, typically by cloning the connection object, one for each thread. An application may have more than one LdapConnection object, connected to the same or different directory servers.
Inheritance: System.ICloneable
Mostra file Open project: EventStore/csharp-ldap Class Usage Examples

Private Properties

Property Type Description
Bind LdapResponseQueue
Bind LdapResponseQueue
Bind void
Bind void
Disconnect void
InitBlock void
SendRequestToServer LdapResponseQueue
chaseReferral System.Collections.ArrayList
chkResultCode void
getReferralConnection ReferralInfo
rebuildRequest LdapMessage
releaseReferralConnections void

Public Methods

Method Description
Abandon ( LdapMessageQueue queue ) : void

Abandons all outstanding operations managed by the queue. All operations in progress, which are managed by the specified queue, are abandoned.

Abandon ( LdapMessageQueue queue, LdapConstraints cons ) : void

Abandons all outstanding operations managed by the queue. All operations in progress, which are managed by the specified queue, are abandoned.

Abandon ( LdapSearchResults results ) : void

Notifies the server not to send additional results associated with this LdapSearchResults object, and discards any results already received.

Abandon ( LdapSearchResults results, LdapConstraints cons ) : void

Notifies the server not to send additional results associated with this LdapSearchResults object, and discards any results already received.

Abandon ( int id ) : void

Abandons an asynchronous operation.

Abandon ( int id, LdapConstraints cons ) : void

Abandons an asynchronous operation, using the specified constraints.

Add ( LdapEntry entry, LdapResponseQueue queue ) : LdapResponseQueue

Asynchronously adds an entry to the directory.

Add ( LdapEntry entry, LdapResponseQueue queue, LdapConstraints cons ) : LdapResponseQueue

Asynchronously adds an entry to the directory, using the specified constraints.

Add ( LdapEntry entry ) : void

Synchronously adds an entry to the directory.

Add ( LdapEntry entry, LdapConstraints cons ) : void

Synchronously adds an entry to the directory, using the specified constraints.

AddUnsolicitedNotificationListener ( LdapUnsolicitedNotificationListener listener ) : void

Registers an object to be notified on arrival of an unsolicited message from a server. An unsolicited message has the ID 0. A new thread is created and the method "messageReceived" in each registered object is called in turn.

Bind ( System dn, System passwd ) : void

Synchronously authenticates to the Ldap server (that the object is currently connected to) as an Ldapv3 bind, using the specified name and password. If the object has been disconnected from an Ldap server, this method attempts to reconnect to the server. If the object has already authenticated, the old authentication is discarded.

Bind ( System dn, System passwd, LdapConstraints cons ) : void

Synchronously authenticates to the Ldap server (that the object is currently connected to) as an Ldapv3 bind, using the specified name, password, and constraints. If the object has been disconnected from an Ldap server, this method attempts to reconnect to the server. If the object has already authenticated, the old authentication is discarded.

Bind ( int version, System dn, System passwd ) : void

Synchronously authenticates to the Ldap server (that the object is currently connected to) using the specified name, password, and Ldap version. If the object has been disconnected from an Ldap server, this method attempts to reconnect to the server. If the object has already authenticated, the old authentication is discarded.

Bind ( int version, System dn, System passwd, LdapConstraints cons ) : void

Synchronously authenticates to the Ldap server (that the object is currently connected to) using the specified name, password, Ldap version, and constraints. If the object has been disconnected from an Ldap server, this method attempts to reconnect to the server. If the object has already authenticated, the old authentication is discarded.

Clone ( ) : Object

Returns a copy of the object with a private context, but sharing the network connection if there is one. The network connection remains open until all clones have disconnected or gone out of scope. Any connection opened after cloning is private to the object making the connection. The clone can issue requests and freely modify options and search constraints, and , without affecting the source object or other clones. If the clone disconnects or reconnects, it is completely dissociated from the source object and other clones. Reauthenticating in a clone, however, is a global operation which will affect the source object and all associated clones, because it applies to the single shared physical connection. Any request by an associated object after one has reauthenticated will carry the new identity.

Compare ( System dn, LdapAttribute attr, LdapResponseQueue queue ) : LdapResponseQueue

Asynchronously compares an attribute value with one in the directory, using the specified queue. Please note that a successful completion of this command results in one of two status codes: LdapException.COMPARE_TRUE if the entry has the value, and LdapException.COMPARE_FALSE if the entry does not have the value or the attribute.

Compare ( System dn, LdapAttribute attr, LdapResponseQueue queue, LdapConstraints cons ) : LdapResponseQueue

Asynchronously compares an attribute value with one in the directory, using the specified queue and contraints. Please note that a successful completion of this command results in one of two status codes: LdapException.COMPARE_TRUE if the entry has the value, and LdapException.COMPARE_FALSE if the entry does not have the value or the attribute.

Compare ( System dn, LdapAttribute attr ) : bool

Synchronously checks to see if an entry contains an attribute with a specified value.

Compare ( System dn, LdapAttribute attr, LdapConstraints cons ) : bool

Synchronously checks to see if an entry contains an attribute with a specified value, using the specified constraints.

Connect ( System host, int port ) : void

Connects to the specified host and port. If this LdapConnection object represents an open connection, the connection is closed first before the new connection is opened. At this point, there is no authentication, and any operations are conducted as an anonymous client. When more than one host name is specified, each host is contacted in turn until a connection can be established.

Delete ( System dn, LdapResponseQueue queue ) : LdapResponseQueue

Asynchronously deletes the entry with the specified distinguished name from the directory and returns the results to the specified queue. Note: A Delete operation will not remove an entry that contains subordinate entries, nor will it dereference alias entries.

Delete ( System dn, LdapResponseQueue queue, LdapConstraints cons ) : LdapResponseQueue

Asynchronously deletes the entry with the specified distinguished name from the directory, using the specified contraints and queue. Note: A Delete operation will not remove an entry that contains subordinate entries, nor will it dereference alias entries.

Delete ( System dn ) : void

Synchronously deletes the entry with the specified distinguished name from the directory. Note: A Delete operation will not remove an entry that contains subordinate entries, nor will it dereference alias entries.

Delete ( System dn, LdapConstraints cons ) : void

Synchronously deletes the entry with the specified distinguished name from the directory, using the specified constraints. Note: A Delete operation will not remove an entry that contains subordinate entries, nor will it dereference alias entries.

Disconnect ( ) : void

Synchronously disconnects from the Ldap server. Before the object can perform Ldap operations again, it must reconnect to the server by calling connect. The disconnect method abandons any outstanding requests, issues an unbind request to the server, and then closes the socket.

Disconnect ( LdapConstraints cons ) : void

Synchronously disconnects from the Ldap server. Before the object can perform Ldap operations again, it must reconnect to the server by calling connect. The disconnect method abandons any outstanding requests, issues an unbind request to the server, and then closes the socket.

ExtendedOperation ( LdapExtendedOperation op ) : LdapExtendedResponse

Provides a synchronous means to access extended, non-mandatory operations offered by a particular Ldapv3 compliant server.

ExtendedOperation ( LdapExtendedOperation op, LdapConstraints cons ) : LdapExtendedResponse

Provides a synchronous means to access extended, non-mandatory operations offered by a particular Ldapv3 compliant server.

ExtendedOperation ( LdapExtendedOperation op, LdapConstraints cons, LdapResponseQueue queue ) : LdapResponseQueue

Provides an asynchronous means to access extended, non-mandatory operations offered by a particular Ldapv3 compliant server.

ExtendedOperation ( LdapExtendedOperation op, LdapResponseQueue queue ) : LdapResponseQueue

Provides an asynchronous means to access extended, non-mandatory operations offered by a particular Ldapv3 compliant server.

FetchSchema ( System schemaDN ) : LdapSchema

Retrieves the schema associated with a particular schema DN in the directory server. The schema DN for a particular entry is obtained by calling the getSchemaDN method of LDAPConnection

GetSchemaDN ( ) : System.String

Retrieves the Distiguished Name (DN) for the schema advertised in the root DSE of the Directory Server. The DN can be used with the methods fetchSchema and modify to retreive and extend schema definitions. The schema entry is located by reading subschemaSubentry attribute of the root DSE. This is equivalent to calling {@link #getSchemaDN(String) } with the DN parameter as an empty string: getSchemaDN("").

GetSchemaDN ( System dn ) : System.String

Retrieves the Distiguished Name (DN) of the schema associated with a entry in the Directory. The DN can be used with the methods fetchSchema and modify to retreive and extend schema definitions. Reads the subschemaSubentry of the entry specified.

LdapConnection ( ) : System

Constructs a new LdapConnection object, which will use the supplied class factory to construct a socket connection during LdapConnection.connect method.

Modify ( System dn, LdapModification mod, LdapResponseQueue queue ) : LdapResponseQueue

Asynchronously makes a single change to an existing entry in the directory. For example, this modify method can change the value of an attribute, add a new attribute value, or remove an existing attribute value. The LdapModification object specifies both the change to be made and the LdapAttribute value to be changed. If the request fails with {@link LdapException.CONNECT_ERROR}, it is indeterminate whether or not the server made the modification.

Modify ( System dn, LdapModification mod, LdapResponseQueue queue, LdapConstraints cons ) : LdapResponseQueue

Asynchronously makes a single change to an existing entry in the directory, using the specified constraints and queue. For example, this modify method can change the value of an attribute, add a new attribute value, or remove an existing attribute value. The LdapModification object specifies both the change to be made and the LdapAttribute value to be changed. If the request fails with {@link LdapException.CONNECT_ERROR}, it is indeterminate whether or not the server made the modification.

Modify ( System dn, LdapModification mod ) : void

Synchronously makes a single change to an existing entry in the directory. For example, this modify method changes the value of an attribute, adds a new attribute value, or removes an existing attribute value. The LdapModification object specifies both the change to be made and the LdapAttribute value to be changed. If the request fails with {@link LdapException.CONNECT_ERROR}, it is indeterminate whether or not the server made the modification.

Modify ( System dn, LdapModification mod, LdapConstraints cons ) : void

Synchronously makes a single change to an existing entry in the directory, using the specified constraints. For example, this modify method changes the value of an attribute, adds a new attribute value, or removes an existing attribute value. The LdapModification object specifies both the change to be made and the LdapAttribute value to be changed. If the request fails with {@link LdapException.CONNECT_ERROR}, it is indeterminate whether or not the server made the modification.

Read ( LdapUrl toGet ) : LdapEntry

Synchronously reads the entry specified by the Ldap URL. When this read method is called, a new connection is created automatically, using the host and port specified in the URL. After finding the entry, the method closes the connection (in other words, it disconnects from the Ldap server). If the URL specifies a filter and scope, they are not used. Of the information specified in the URL, this method only uses the Ldap host name and port number, the base distinguished name (DN), and the list of attributes to return.

Read ( LdapUrl toGet, LdapSearchConstraints cons ) : LdapEntry

Synchronously reads the entry specified by the Ldap URL, using the specified constraints. When this method is called, a new connection is created automatically, using the host and port specified in the URL. After finding the entry, the method closes the connection (in other words, it disconnects from the Ldap server). If the URL specifies a filter and scope, they are not used. Of the information specified in the URL, this method only uses the Ldap host name and port number, the base distinguished name (DN), and the list of attributes to return.

Read ( System dn ) : LdapEntry

Synchronously reads the entry for the specified distiguished name (DN) and retrieves all attributes for the entry.

Read ( System dn, LdapSearchConstraints cons ) : LdapEntry

Synchronously reads the entry for the specified distiguished name (DN), using the specified constraints, and retrieves all attributes for the entry.

Read ( System dn, System attrs ) : LdapEntry

Synchronously reads the entry for the specified distinguished name (DN) and retrieves only the specified attributes from the entry.

Read ( System dn, System attrs, LdapSearchConstraints cons ) : LdapEntry

Synchronously reads the entry for the specified distinguished name (DN), using the specified constraints, and retrieves only the specified attributes from the entry.

RemoveUnsolicitedNotificationListener ( LdapUnsolicitedNotificationListener listener ) : void

Deregisters an object so that it will no longer be notified on arrival of an unsolicited message from a server. If the object is null or was not previously registered for unsolicited notifications, the method does nothing.

Rename ( System dn, System newRdn, System newParentdn, bool deleteOldRdn, LdapResponseQueue queue ) : LdapResponseQueue

Asynchronously renames an existing entry in the directory, possibly repositioning the entry in the directory.

Rename ( System dn, System newRdn, System newParentdn, bool deleteOldRdn, LdapResponseQueue queue, LdapConstraints cons ) : LdapResponseQueue

Asynchronously renames an existing entry in the directory, using the specified constraints and possibily repositioning the entry in the directory.

Rename ( System dn, System newRdn, bool deleteOldRdn, LdapResponseQueue queue ) : LdapResponseQueue

Asynchronously renames an existing entry in the directory.

Rename ( System dn, System newRdn, bool deleteOldRdn, LdapResponseQueue queue, LdapConstraints cons ) : LdapResponseQueue

Asynchronously renames an existing entry in the directory, using the specified constraints.

Rename ( System dn, System newRdn, System newParentdn, bool deleteOldRdn ) : void

Synchronously renames an existing entry in the directory, possibly repositioning the entry in the directory tree.

Rename ( System dn, System newRdn, System newParentdn, bool deleteOldRdn, LdapConstraints cons ) : void

Synchronously renames an existing entry in the directory, using the specified constraints and possibly repositioning the entry in the directory tree.

Rename ( System dn, System newRdn, bool deleteOldRdn ) : void

Synchronously renames an existing entry in the directory.

Rename ( System dn, System newRdn, bool deleteOldRdn, LdapConstraints cons ) : void

Synchronously renames an existing entry in the directory, using the specified constraints.

Search ( System base_Renamed, int scope, System filter, System attrs, bool typesOnly, LdapSearchQueue queue ) : LdapSearchQueue

Asynchronously performs the search specified by the parameters.

Search ( System base_Renamed, int scope, System filter, System attrs, bool typesOnly, LdapSearchQueue queue, LdapSearchConstraints cons ) : LdapSearchQueue

Asynchronously performs the search specified by the parameters, also allowing specification of constraints for the search (such as the maximum number of entries to find or the maximum time to wait for search results).

Search ( LdapUrl toGet ) : LdapSearchResults

Synchronously performs the search specified by the Ldap URL, returning an enumerable LdapSearchResults object.

Search ( LdapUrl toGet, LdapSearchConstraints cons ) : LdapSearchResults

Synchronously perfoms the search specified by the Ldap URL, using the specified search constraints (such as the maximum number of entries to find or the maximum time to wait for search results). When this method is called, a new connection is created automatically, using the host and port specified in the URL. After all search results have been received from the server, the method closes the connection (in other words, it disconnects from the Ldap server). As part of the search constraints, a choice can be made as to whether to have the results delivered all at once or in smaller batches. If the results are to be delivered in smaller batches, each iteration blocks only until the next batch of results is returned.

Search ( System base_Renamed, int scope, System filter, System attrs, bool typesOnly ) : LdapSearchResults

Synchronously performs the search specified by the parameters.

Search ( System base_Renamed, int scope, System filter, System attrs, bool typesOnly, LdapSearchConstraints cons ) : LdapSearchResults

Synchronously performs the search specified by the parameters, using the specified search constraints (such as the maximum number of entries to find or the maximum time to wait for search results). As part of the search constraints, the method allows specifying whether or not the results are to be delivered all at once or in smaller batches. If specified that the results are to be delivered in smaller batches, each iteration blocks only until the next batch of results is returned.

SendRequest ( LdapMessage request, LdapMessageQueue queue ) : LdapMessageQueue

Sends an Ldap request to a directory server. The specified the Ldap request is sent to the directory server associated with this connection using default constraints. An Ldap request object is a subclass {@link LdapMessage} with the operation type set to one of the request types. You can build a request by using the request classes found in this package You should note that, since Ldap requests sent to the server using sendRequest are asynchronous, automatic referral following does not apply to these requests.

SendRequest ( LdapMessage request, LdapMessageQueue queue, LdapConstraints cons ) : LdapMessageQueue

Sends an Ldap request to a directory server. The specified the Ldap request is sent to the directory server associated with this connection. An Ldap request object is an {@link LdapMessage} with the operation type set to one of the request types. You can build a request by using the request classes found in this package You should note that, since Ldap requests sent to the server using sendRequest are asynchronous, automatic referral following does not apply to these requests.

getProperty ( System name ) : Object

Returns a property of a connection object.

startTLS ( ) : void

Starts Transport Layer Security (TLS) protocol on this connection to enable session privacy. This affects the LdapConnection object and all cloned objects. A socket factory that implements LdapTLSSocketFactory must be set on the connection.

stopTLS ( ) : void

Stops Transport Layer Security(TLS) on the LDAPConnection and reverts back to an anonymous state. @throws LDAPException This can occur for the following reasons:

  • StartTLS has not been called before stopTLS
  • There exists outstanding messages that have not received all responses
  • The sever was not able to support the operation

Note: The Sun and IBM implementions of JSSE do not currently allow stopping TLS on an open Socket. In order to produce the same results this method currently disconnects the socket and reconnects, giving the application an anonymous connection to the server, as required by StopTLS

Protected Methods

Method Description
MakeExtendedOperation ( LdapExtendedOperation op, LdapConstraints cons ) : LdapMessage

Formulates the extended operation, constraints into an LdapMessage and returns the LdapMessage. This is used by extendedOperation and startTLS which needs the LdapMessage to get the MessageID.

Private Methods

Method Description
Bind ( int version, System dn, sbyte passwd, LdapResponseQueue queue ) : LdapResponseQueue
Bind ( int version, System dn, sbyte passwd, LdapResponseQueue queue, LdapConstraints cons ) : LdapResponseQueue
Bind ( int version, System dn, sbyte passwd ) : void
Bind ( int version, System dn, sbyte passwd, LdapConstraints cons ) : void
Disconnect ( LdapConstraints cons, bool how ) : void

Synchronously disconnect from the server

InitBlock ( ) : void
SendRequestToServer ( LdapMessage msg, int timeout, LdapResponseQueue queue, BindProperties bindProps ) : LdapResponseQueue

Locates the appropriate message agent and sends the Ldap request to a directory server.

chaseReferral ( LdapMessageQueue queue, LdapConstraints cons, LdapMessage msg, System initialReferrals, int hopCount, bool searchReference, System connectionList ) : System.Collections.ArrayList

Follow referrals if necessary referral following enabled. This function is called only by synchronous requests. Search responses come here only if referral following is enabled and if we are processing a SearchResultReference or a Response with a status of REFERRAL, i.e. we are going to follow a referral. This functions recursively follows a referral until a result is returned or until the hop limit is reached.

chkResultCode ( LdapMessageQueue queue, LdapConstraints cons, LdapResponse response ) : void

Check the result code and throw an exception if needed. If referral following is enabled, checks if we need to follow a referral

getReferralConnection ( System referrals ) : ReferralInfo

get an LdapConnection object so that we can follow a referral. This function is never called if cons.getReferralFollowing() returns false.

rebuildRequest ( LdapMessage msg, LdapUrl url, bool reference ) : LdapMessage

Builds a new request replacing dn, scope, and filter where approprate

releaseReferralConnections ( System list ) : void

Method Details

Abandon() public method

Abandons all outstanding operations managed by the queue. All operations in progress, which are managed by the specified queue, are abandoned.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public Abandon ( LdapMessageQueue queue ) : void
queue LdapMessageQueue The queue returned from an asynchronous request. /// All outstanding operations managed by the queue /// are abandoned, and the queue is emptied. /// ///
return void

Abandon() public method

Abandons all outstanding operations managed by the queue. All operations in progress, which are managed by the specified queue, are abandoned.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public Abandon ( LdapMessageQueue queue, LdapConstraints cons ) : void
queue LdapMessageQueue The queue returned from an asynchronous request. /// All outstanding operations managed by the queue /// are abandoned, and the queue is emptied. /// ///
cons LdapConstraints The contraints specific to the operation. /// ///
return void

Abandon() public method

Notifies the server not to send additional results associated with this LdapSearchResults object, and discards any results already received.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public Abandon ( LdapSearchResults results ) : void
results LdapSearchResults An object returned from a search. /// ///
return void

Abandon() public method

Notifies the server not to send additional results associated with this LdapSearchResults object, and discards any results already received.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public Abandon ( LdapSearchResults results, LdapConstraints cons ) : void
results LdapSearchResults An object returned from a search. /// ///
cons LdapConstraints The contraints specific to the operation. /// ///
return void

Abandon() public method

Abandons an asynchronous operation.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public Abandon ( int id ) : void
id int The ID of the asynchronous operation to abandon. The ID /// can be obtained from the response queue for the /// operation. /// ///
return void

Abandon() public method

Abandons an asynchronous operation, using the specified constraints.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public Abandon ( int id, LdapConstraints cons ) : void
id int The ID of the asynchronous operation to abandon. /// The ID can be obtained from the search /// queue for the operation. /// ///
cons LdapConstraints The contraints specific to the operation. /// ///
return void

Add() public method

Asynchronously adds an entry to the directory.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public Add ( LdapEntry entry, LdapResponseQueue queue ) : LdapResponseQueue
entry LdapEntry LdapEntry object specifying the distinguished /// name and attributes of the new entry. /// ///
queue LdapResponseQueue Handler for messages returned from a server in /// response to this request. If it is null, a /// queue object is created internally. /// ///
return LdapResponseQueue

Add() public method

Asynchronously adds an entry to the directory, using the specified constraints.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public Add ( LdapEntry entry, LdapResponseQueue queue, LdapConstraints cons ) : LdapResponseQueue
entry LdapEntry LdapEntry object specifying the distinguished /// name and attributes of the new entry. /// ///
queue LdapResponseQueue Handler for messages returned from a server in /// response to this request. If it is null, a /// queue object is created internally. /// ///
cons LdapConstraints Constraints specific to the operation. /// ///
return LdapResponseQueue

Add() public method

Synchronously adds an entry to the directory.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public Add ( LdapEntry entry ) : void
entry LdapEntry LdapEntry object specifying the distinguished /// name and attributes of the new entry. /// ///
return void

Add() public method

Synchronously adds an entry to the directory, using the specified constraints.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public Add ( LdapEntry entry, LdapConstraints cons ) : void
entry LdapEntry LdapEntry object specifying the distinguished /// name and attributes of the new entry. /// ///
cons LdapConstraints Constraints specific to the operation. /// ///
return void

AddUnsolicitedNotificationListener() public method

Registers an object to be notified on arrival of an unsolicited message from a server. An unsolicited message has the ID 0. A new thread is created and the method "messageReceived" in each registered object is called in turn.
public AddUnsolicitedNotificationListener ( LdapUnsolicitedNotificationListener listener ) : void
listener LdapUnsolicitedNotificationListener An object to be notified on arrival of an /// unsolicited message from a server. This object must /// implement the LdapUnsolicitedNotificationListener interface. /// ///
return void

Bind() public method

Synchronously authenticates to the Ldap server (that the object is currently connected to) as an Ldapv3 bind, using the specified name and password. If the object has been disconnected from an Ldap server, this method attempts to reconnect to the server. If the object has already authenticated, the old authentication is discarded.
LdapException A general exception which includes an error /// message and an Ldap error code. /// ///
public Bind ( System dn, System passwd ) : void
dn System If non-null and non-empty, specifies that the /// connection and all operations through it should /// be authenticated with dn as the distinguished /// name. /// ///
passwd System If non-null and non-empty, specifies that the /// connection and all operations through it should /// be authenticated with dn as the distinguished /// name and passwd as password. /// /// Note: the application should use care in the use /// of String password objects. These are long lived /// objects, and may expose a security risk, especially /// in objects that are serialized. The LdapConnection /// keeps no long lived instances of these objects. /// ///
return void

Bind() public method

Synchronously authenticates to the Ldap server (that the object is currently connected to) as an Ldapv3 bind, using the specified name, password, and constraints. If the object has been disconnected from an Ldap server, this method attempts to reconnect to the server. If the object has already authenticated, the old authentication is discarded.
LdapException A general exception which includes an error /// message and an Ldap error code. /// ///
public Bind ( System dn, System passwd, LdapConstraints cons ) : void
dn System If non-null and non-empty, specifies that the /// connection and all operations through it should /// be authenticated with dn as the distinguished /// name. /// ///
passwd System If non-null and non-empty, specifies that the /// connection and all operations through it should /// be authenticated with dn as the distinguished /// name and passwd as password. /// Note: the application should use care in the use /// of String password objects. These are long lived /// objects, and may expose a security risk, especially /// in objects that are serialized. The LdapConnection /// keeps no long lived instances of these objects. /// ///
cons LdapConstraints Constraints specific to the operation. /// ///
return void

Bind() public method

Synchronously authenticates to the Ldap server (that the object is currently connected to) using the specified name, password, and Ldap version. If the object has been disconnected from an Ldap server, this method attempts to reconnect to the server. If the object has already authenticated, the old authentication is discarded.
LdapException A general exception which includes an error /// message and an Ldap error code. /// ///
public Bind ( int version, System dn, System passwd ) : void
version int The Ldap protocol version, use Ldap_V3. /// Ldap_V2 is not supported. /// ///
dn System If non-null and non-empty, specifies that the /// connection and all operations through it should /// be authenticated with dn as the distinguished /// name. /// ///
passwd System If non-null and non-empty, specifies that the /// connection and all operations through it should /// be authenticated with dn as the distinguished /// name and passwd as password. /// /// Note: the application should use care in the use /// of String password objects. These are long lived /// objects, and may expose a security risk, especially /// in objects that are serialized. The LdapConnection /// keeps no long lived instances of these objects. /// ///
return void

Bind() public method

Synchronously authenticates to the Ldap server (that the object is currently connected to) using the specified name, password, Ldap version, and constraints. If the object has been disconnected from an Ldap server, this method attempts to reconnect to the server. If the object has already authenticated, the old authentication is discarded.
LdapException A general exception which includes an error /// message and an Ldap error code. /// ///
public Bind ( int version, System dn, System passwd, LdapConstraints cons ) : void
version int The Ldap protocol version, use Ldap_V3. /// Ldap_V2 is not supported. /// ///
dn System If non-null and non-empty, specifies that the /// connection and all operations through it should /// be authenticated with dn as the distinguished /// name. /// ///
passwd System If non-null and non-empty, specifies that the /// connection and all operations through it should /// be authenticated with dn as the distinguished /// name and passwd as password. /// /// Note: the application should use care in the use /// of String password objects. These are long lived /// objects, and may expose a security risk, especially /// in objects that are serialized. The LdapConnection /// keeps no long lived instances of these objects. /// ///
cons LdapConstraints The constraints specific to the operation. /// ///
return void

Clone() public method

Returns a copy of the object with a private context, but sharing the network connection if there is one. The network connection remains open until all clones have disconnected or gone out of scope. Any connection opened after cloning is private to the object making the connection. The clone can issue requests and freely modify options and search constraints, and , without affecting the source object or other clones. If the clone disconnects or reconnects, it is completely dissociated from the source object and other clones. Reauthenticating in a clone, however, is a global operation which will affect the source object and all associated clones, because it applies to the single shared physical connection. Any request by an associated object after one has reauthenticated will carry the new identity.
public Clone ( ) : Object
return System.Object

Compare() public method

Asynchronously compares an attribute value with one in the directory, using the specified queue. Please note that a successful completion of this command results in one of two status codes: LdapException.COMPARE_TRUE if the entry has the value, and LdapException.COMPARE_FALSE if the entry does not have the value or the attribute.
LdapException A general exception which includes an error /// message and an Ldap error code. /// ///
public Compare ( System dn, LdapAttribute attr, LdapResponseQueue queue ) : LdapResponseQueue
dn System The distinguished name of the entry containing an /// attribute to compare. /// ///
attr LdapAttribute An attribute to compare. /// ///
queue LdapResponseQueue The queue for messages returned from a server in /// response to this request. If it is null, a /// queue object is created internally. /// ///
return LdapResponseQueue

Compare() public method

Asynchronously compares an attribute value with one in the directory, using the specified queue and contraints. Please note that a successful completion of this command results in one of two status codes: LdapException.COMPARE_TRUE if the entry has the value, and LdapException.COMPARE_FALSE if the entry does not have the value or the attribute.
LdapException A general exception which includes an error /// message and an Ldap error code. /// ///
public Compare ( System dn, LdapAttribute attr, LdapResponseQueue queue, LdapConstraints cons ) : LdapResponseQueue
dn System The distinguished name of the entry containing an /// attribute to compare. /// ///
attr LdapAttribute An attribute to compare. /// ///
queue LdapResponseQueue Handler for messages returned from a server in /// response to this request. If it is null, a /// queue object is created internally. /// ///
cons LdapConstraints Constraints specific to the operation. /// ///
return LdapResponseQueue

Compare() public method

Synchronously checks to see if an entry contains an attribute with a specified value.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public Compare ( System dn, LdapAttribute attr ) : bool
dn System The distinguished name of the entry to use in the /// comparison. /// ///
attr LdapAttribute The attribute to compare against the entry. The /// method checks to see if the entry has an /// attribute with the same name and value as this /// attribute. /// ///
return bool

Compare() public method

Synchronously checks to see if an entry contains an attribute with a specified value, using the specified constraints.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public Compare ( System dn, LdapAttribute attr, LdapConstraints cons ) : bool
dn System The distinguished name of the entry to use in the /// comparison. /// ///
attr LdapAttribute The attribute to compare against the entry. The /// method checks to see if the entry has an /// attribute with the same name and value as this /// attribute. /// ///
cons LdapConstraints Constraints specific to the operation. /// ///
return bool

Connect() public method

Connects to the specified host and port. If this LdapConnection object represents an open connection, the connection is closed first before the new connection is opened. At this point, there is no authentication, and any operations are conducted as an anonymous client. When more than one host name is specified, each host is contacted in turn until a connection can be established.
LdapException A general exception which includes an error /// message and an Ldap error code. /// ///
public Connect ( System host, int port ) : void
host System A host name or a dotted string representing the IP address /// of a host running an Ldap server. It may also /// contain a list of host names, space-delimited. Each host /// name can include a trailing colon and port number. /// ///
port int The TCP or UDP port number to connect to or contact. /// The default Ldap port is 389. The port parameter is /// ignored for any host hame which includes a colon and /// port number. /// ///
return void

Delete() public method

Asynchronously deletes the entry with the specified distinguished name from the directory and returns the results to the specified queue. Note: A Delete operation will not remove an entry that contains subordinate entries, nor will it dereference alias entries.
LdapException A general exception which includes an error /// message and an Ldap error code. /// ///
public Delete ( System dn, LdapResponseQueue queue ) : LdapResponseQueue
dn System The distinguished name of the entry to modify. /// ///
queue LdapResponseQueue The queue for messages returned from a server in /// response to this request. If it is null, a /// queue object is created internally. /// ///
return LdapResponseQueue

Delete() public method

Asynchronously deletes the entry with the specified distinguished name from the directory, using the specified contraints and queue. Note: A Delete operation will not remove an entry that contains subordinate entries, nor will it dereference alias entries.
LdapException A general exception which includes an error /// message and an Ldap error code. /// ///
public Delete ( System dn, LdapResponseQueue queue, LdapConstraints cons ) : LdapResponseQueue
dn System The distinguished name of the entry to delete. /// ///
queue LdapResponseQueue The queue for messages returned from a server in /// response to this request. If it is null, a /// queue object is created internally. /// ///
cons LdapConstraints The constraints specific to the operation. /// ///
return LdapResponseQueue

Delete() public method

Synchronously deletes the entry with the specified distinguished name from the directory. Note: A Delete operation will not remove an entry that contains subordinate entries, nor will it dereference alias entries.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public Delete ( System dn ) : void
dn System The distinguished name of the entry to delete. /// ///
return void

Delete() public method

Synchronously deletes the entry with the specified distinguished name from the directory, using the specified constraints. Note: A Delete operation will not remove an entry that contains subordinate entries, nor will it dereference alias entries.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public Delete ( System dn, LdapConstraints cons ) : void
dn System The distinguished name of the entry to delete. /// ///
cons LdapConstraints Constraints specific to the operation. /// ///
return void

Disconnect() public method

Synchronously disconnects from the Ldap server. Before the object can perform Ldap operations again, it must reconnect to the server by calling connect. The disconnect method abandons any outstanding requests, issues an unbind request to the server, and then closes the socket.
LdapException A general exception which includes an error /// message and an Ldap error code. /// ///
public Disconnect ( ) : void
return void

Disconnect() public method

Synchronously disconnects from the Ldap server. Before the object can perform Ldap operations again, it must reconnect to the server by calling connect. The disconnect method abandons any outstanding requests, issues an unbind request to the server, and then closes the socket.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public Disconnect ( LdapConstraints cons ) : void
cons LdapConstraints LDPConstraints to be set with the unbind request /// ///
return void

ExtendedOperation() public method

Provides a synchronous means to access extended, non-mandatory operations offered by a particular Ldapv3 compliant server.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public ExtendedOperation ( LdapExtendedOperation op ) : LdapExtendedResponse
op LdapExtendedOperation The object which contains (1) an identifier of an extended /// operation which should be recognized by the particular Ldap /// server this client is connected to and (2) /// an operation-specific sequence of octet strings /// or BER-encoded values. /// ///
return LdapExtendedResponse

ExtendedOperation() public method

Provides a synchronous means to access extended, non-mandatory operations offered by a particular Ldapv3 compliant server.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public ExtendedOperation ( LdapExtendedOperation op, LdapConstraints cons ) : LdapExtendedResponse
op LdapExtendedOperation The object which contains (1) an identifier of an extended /// operation which should be recognized by the particular Ldap /// server this client is connected to and (2) an /// operation-specific sequence of octet strings /// or BER-encoded values. /// ///
cons LdapConstraints The constraints specific to the operation. /// ///
return LdapExtendedResponse

ExtendedOperation() public method

Provides an asynchronous means to access extended, non-mandatory operations offered by a particular Ldapv3 compliant server.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public ExtendedOperation ( LdapExtendedOperation op, LdapConstraints cons, LdapResponseQueue queue ) : LdapResponseQueue
op LdapExtendedOperation The object which contains (1) an identifier of an extended /// operation which should be recognized by the particular Ldap /// server this client is connected to and (2) an operation- /// specific sequence of octet strings or BER-encoded values. /// ///
cons LdapConstraints The constraints specific to this operation. /// ///
queue LdapResponseQueue The queue for messages returned from a server in /// response to this request. If it is null, a queue /// object is created internally. /// ///
return LdapResponseQueue

ExtendedOperation() public method

Provides an asynchronous means to access extended, non-mandatory operations offered by a particular Ldapv3 compliant server.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public ExtendedOperation ( LdapExtendedOperation op, LdapResponseQueue queue ) : LdapResponseQueue
op LdapExtendedOperation The object which contains (1) an identifier of an extended /// operation which should be recognized by the particular Ldap /// server this client is connected to and (2) an /// operation-specific sequence of octet strings /// or BER-encoded values. /// ///
queue LdapResponseQueue The queue for messages returned from a server in /// response to this request. If it is null, a queue /// object is created internally. /// ///
return LdapResponseQueue

FetchSchema() public method

Retrieves the schema associated with a particular schema DN in the directory server. The schema DN for a particular entry is obtained by calling the getSchemaDN method of LDAPConnection
LDAPException This exception occurs if the schema entry /// cannot be retrieved with this connection. ///
public FetchSchema ( System schemaDN ) : LdapSchema
schemaDN System The schema DN used to fetch the schema. /// ///
return LdapSchema

GetSchemaDN() public method

Retrieves the Distiguished Name (DN) for the schema advertised in the root DSE of the Directory Server. The DN can be used with the methods fetchSchema and modify to retreive and extend schema definitions. The schema entry is located by reading subschemaSubentry attribute of the root DSE. This is equivalent to calling {@link #getSchemaDN(String) } with the DN parameter as an empty string: getSchemaDN("").
LDAPException This exception occurs if the schema DN /// cannot be retrieved, or if the subschemaSubentry attribute associated /// with the root DSE contains multiple values. /// ///
public GetSchemaDN ( ) : System.String
return System.String

GetSchemaDN() public method

Retrieves the Distiguished Name (DN) of the schema associated with a entry in the Directory. The DN can be used with the methods fetchSchema and modify to retreive and extend schema definitions. Reads the subschemaSubentry of the entry specified.
LDAPException This exception occurs if a null or empty /// value is passed as dn, if the subschemasubentry attribute cannot /// be retrieved, or the subschemasubentry contains multiple values. /// ///
public GetSchemaDN ( System dn ) : System.String
dn System Distinguished Name of any entry. The subschemaSubentry /// attribute is queried from this entry. /// ///
return System.String

LdapConnection() public method

Constructs a new LdapConnection object, which will use the supplied class factory to construct a socket connection during LdapConnection.connect method.
public LdapConnection ( ) : System
return System

MakeExtendedOperation() protected method

Formulates the extended operation, constraints into an LdapMessage and returns the LdapMessage. This is used by extendedOperation and startTLS which needs the LdapMessage to get the MessageID.
protected MakeExtendedOperation ( LdapExtendedOperation op, LdapConstraints cons ) : LdapMessage
op LdapExtendedOperation
cons LdapConstraints
return LdapMessage

Modify() public method

Asynchronously makes a single change to an existing entry in the directory. For example, this modify method can change the value of an attribute, add a new attribute value, or remove an existing attribute value. The LdapModification object specifies both the change to be made and the LdapAttribute value to be changed. If the request fails with {@link LdapException.CONNECT_ERROR}, it is indeterminate whether or not the server made the modification.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public Modify ( System dn, LdapModification mod, LdapResponseQueue queue ) : LdapResponseQueue
dn System Distinguished name of the entry to modify. /// ///
mod LdapModification A single change to be made to the entry. /// ///
queue LdapResponseQueue Handler for messages returned from a server in /// response to this request. If it is null, a /// queue object is created internally. /// ///
return LdapResponseQueue

Modify() public method

Asynchronously makes a single change to an existing entry in the directory, using the specified constraints and queue. For example, this modify method can change the value of an attribute, add a new attribute value, or remove an existing attribute value. The LdapModification object specifies both the change to be made and the LdapAttribute value to be changed. If the request fails with {@link LdapException.CONNECT_ERROR}, it is indeterminate whether or not the server made the modification.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public Modify ( System dn, LdapModification mod, LdapResponseQueue queue, LdapConstraints cons ) : LdapResponseQueue
dn System Distinguished name of the entry to modify. /// ///
mod LdapModification A single change to be made to the entry. /// ///
queue LdapResponseQueue Handler for messages returned from a server in /// response to this request. If it is null, a /// queue object is created internally. /// ///
cons LdapConstraints Constraints specific to the operation. /// ///
return LdapResponseQueue

Modify() public method

Synchronously makes a single change to an existing entry in the directory. For example, this modify method changes the value of an attribute, adds a new attribute value, or removes an existing attribute value. The LdapModification object specifies both the change to be made and the LdapAttribute value to be changed. If the request fails with {@link LdapException.CONNECT_ERROR}, it is indeterminate whether or not the server made the modification.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public Modify ( System dn, LdapModification mod ) : void
dn System The distinguished name of the entry to modify. /// ///
mod LdapModification A single change to be made to the entry. /// ///
return void

Modify() public method

Synchronously makes a single change to an existing entry in the directory, using the specified constraints. For example, this modify method changes the value of an attribute, adds a new attribute value, or removes an existing attribute value. The LdapModification object specifies both the change to be made and the LdapAttribute value to be changed. If the request fails with {@link LdapException.CONNECT_ERROR}, it is indeterminate whether or not the server made the modification.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public Modify ( System dn, LdapModification mod, LdapConstraints cons ) : void
dn System The distinguished name of the entry to modify. /// ///
mod LdapModification A single change to be made to the entry. /// ///
cons LdapConstraints The constraints specific to the operation. /// ///
return void

Read() public static method

Synchronously reads the entry specified by the Ldap URL. When this read method is called, a new connection is created automatically, using the host and port specified in the URL. After finding the entry, the method closes the connection (in other words, it disconnects from the Ldap server). If the URL specifies a filter and scope, they are not used. Of the information specified in the URL, this method only uses the Ldap host name and port number, the base distinguished name (DN), and the list of attributes to return.
LdapException if the object was not found ///
public static Read ( LdapUrl toGet ) : LdapEntry
toGet LdapUrl Ldap URL specifying the entry to read. /// ///
return LdapEntry

Read() public static method

Synchronously reads the entry specified by the Ldap URL, using the specified constraints. When this method is called, a new connection is created automatically, using the host and port specified in the URL. After finding the entry, the method closes the connection (in other words, it disconnects from the Ldap server). If the URL specifies a filter and scope, they are not used. Of the information specified in the URL, this method only uses the Ldap host name and port number, the base distinguished name (DN), and the list of attributes to return.
LdapException if the object was not found ///
public static Read ( LdapUrl toGet, LdapSearchConstraints cons ) : LdapEntry
toGet LdapUrl Ldap URL specifying the entry to read. /// ///
cons LdapSearchConstraints Constraints specific to the operation. /// ///
return LdapEntry

Read() public method

Synchronously reads the entry for the specified distiguished name (DN) and retrieves all attributes for the entry.
LdapException if the object was not found ///
public Read ( System dn ) : LdapEntry
dn System The distinguished name of the entry to retrieve. /// ///
return LdapEntry

Read() public method

Synchronously reads the entry for the specified distiguished name (DN), using the specified constraints, and retrieves all attributes for the entry.
LdapException if the object was not found ///
public Read ( System dn, LdapSearchConstraints cons ) : LdapEntry
dn System The distinguished name of the entry to retrieve. /// ///
cons LdapSearchConstraints The constraints specific to the operation. /// ///
return LdapEntry

Read() public method

Synchronously reads the entry for the specified distinguished name (DN) and retrieves only the specified attributes from the entry.
LdapException if the object was not found ///
public Read ( System dn, System attrs ) : LdapEntry
dn System The distinguished name of the entry to retrieve. /// ///
attrs System The names of the attributes to retrieve. /// ///
return LdapEntry

Read() public method

Synchronously reads the entry for the specified distinguished name (DN), using the specified constraints, and retrieves only the specified attributes from the entry.
LdapException if the object was not found ///
public Read ( System dn, System attrs, LdapSearchConstraints cons ) : LdapEntry
dn System The distinguished name of the entry to retrieve. /// ///
attrs System The names of the attributes to retrieve. /// ///
cons LdapSearchConstraints The constraints specific to the operation. /// ///
return LdapEntry

RemoveUnsolicitedNotificationListener() public method

Deregisters an object so that it will no longer be notified on arrival of an unsolicited message from a server. If the object is null or was not previously registered for unsolicited notifications, the method does nothing.
public RemoveUnsolicitedNotificationListener ( LdapUnsolicitedNotificationListener listener ) : void
listener LdapUnsolicitedNotificationListener An object to no longer be notified on arrival of /// an unsolicited message from a server. /// ///
return void

Rename() public method

Asynchronously renames an existing entry in the directory, possibly repositioning the entry in the directory.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public Rename ( System dn, System newRdn, System newParentdn, bool deleteOldRdn, LdapResponseQueue queue ) : LdapResponseQueue
dn System The current distinguished name of the entry. /// ///
newRdn System The new relative distinguished name for the entry. /// ///
newParentdn System The distinguished name of an existing entry which /// is to be the new parent of the entry. /// ///
deleteOldRdn bool If true, the old name is not retained as an /// attribute value. If false, the old name is /// retained as an attribute value. /// ///
queue LdapResponseQueue The queue for messages returned from a server in /// response to this request. If it is null, a /// queue object is created internally. /// ///
return LdapResponseQueue

Rename() public method

Asynchronously renames an existing entry in the directory, using the specified constraints and possibily repositioning the entry in the directory.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public Rename ( System dn, System newRdn, System newParentdn, bool deleteOldRdn, LdapResponseQueue queue, LdapConstraints cons ) : LdapResponseQueue
dn System The current distinguished name of the entry. /// ///
newRdn System The new relative distinguished name for the entry. /// ///
newParentdn System The distinguished name of an existing entry which /// is to be the new parent of the entry. /// ///
deleteOldRdn bool If true, the old name is not retained as an /// attribute value. If false, the old name is /// retained as an attribute value. /// ///
queue LdapResponseQueue The queue for messages returned from a server in /// response to this request. If it is null, a /// queue object is created internally. /// ///
cons LdapConstraints The constraints specific to the operation. /// ///
return LdapResponseQueue

Rename() public method

Asynchronously renames an existing entry in the directory.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public Rename ( System dn, System newRdn, bool deleteOldRdn, LdapResponseQueue queue ) : LdapResponseQueue
dn System The current distinguished name of the entry. /// ///
newRdn System The new relative distinguished name for the entry. /// ///
deleteOldRdn bool If true, the old name is not retained as an /// attribute value. If false, the old name is /// retained as an attribute value. /// ///
queue LdapResponseQueue The queue for messages returned from a server in /// response to this request. If it is null, a /// queue object is created internally. /// ///
return LdapResponseQueue

Rename() public method

Asynchronously renames an existing entry in the directory, using the specified constraints.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public Rename ( System dn, System newRdn, bool deleteOldRdn, LdapResponseQueue queue, LdapConstraints cons ) : LdapResponseQueue
dn System The current distinguished name of the entry. /// ///
newRdn System The new relative distinguished name for the entry. /// ///
deleteOldRdn bool If true, the old name is not retained as an /// attribute value. If false, the old name is /// retained as an attribute value. /// ///
queue LdapResponseQueue The queue for messages returned from a server in /// response to this request. If it is null, a /// queue object is created internally. /// ///
cons LdapConstraints The constraints specific to the operation. /// ///
return LdapResponseQueue

Rename() public method

Synchronously renames an existing entry in the directory, possibly repositioning the entry in the directory tree.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public Rename ( System dn, System newRdn, System newParentdn, bool deleteOldRdn ) : void
dn System The current distinguished name of the entry. /// ///
newRdn System The new relative distinguished name for the entry. /// ///
newParentdn System The distinguished name of an existing entry which /// is to be the new parent of the entry. /// ///
deleteOldRdn bool If true, the old name is not retained as an /// attribute value. If false, the old name is /// retained as an attribute value. /// ///
return void

Rename() public method

Synchronously renames an existing entry in the directory, using the specified constraints and possibly repositioning the entry in the directory tree.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public Rename ( System dn, System newRdn, System newParentdn, bool deleteOldRdn, LdapConstraints cons ) : void
dn System The current distinguished name of the entry. /// ///
newRdn System The new relative distinguished name for the entry. /// ///
newParentdn System The distinguished name of an existing entry which /// is to be the new parent of the entry. /// ///
deleteOldRdn bool If true, the old name is not retained as an /// attribute value. If false, the old name is /// retained as an attribute value. /// ///
cons LdapConstraints The constraints specific to the operation. /// ///
return void

Rename() public method

Synchronously renames an existing entry in the directory.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public Rename ( System dn, System newRdn, bool deleteOldRdn ) : void
dn System The current distinguished name of the entry. /// ///
newRdn System The new relative distinguished name for the entry. /// ///
deleteOldRdn bool If true, the old name is not retained as an /// attribute value. If false, the old name is /// retained as an attribute value. /// ///
return void

Rename() public method

Synchronously renames an existing entry in the directory, using the specified constraints.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public Rename ( System dn, System newRdn, bool deleteOldRdn, LdapConstraints cons ) : void
dn System The current distinguished name of the entry. /// ///
newRdn System The new relative distinguished name for the entry. /// ///
deleteOldRdn bool If true, the old name is not retained as an /// attribute value. If false, the old name is /// retained as an attribute value. /// ///
cons LdapConstraints The constraints specific to the operation. /// ///
return void

Search() public method

Asynchronously performs the search specified by the parameters.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public Search ( System base_Renamed, int scope, System filter, System attrs, bool typesOnly, LdapSearchQueue queue ) : LdapSearchQueue
base_Renamed System
scope int The scope of the entries to search. The following /// are the valid options: ///
    ///
  • SCOPE_BASE - searches only the base DN
  • /// ///
  • SCOPE_ONE - searches only entries under the base DN
  • /// ///
  • SCOPE_SUB - searches the base DN and all entries /// within its subtree
  • ///
///
filter System Search filter specifying the search criteria. /// ///
attrs System Names of attributes to retrieve. /// ///
typesOnly bool If true, returns the names but not the values of /// the attributes found. If false, returns the /// names and values for attributes found. /// ///
queue LdapSearchQueue Handler for messages returned from a server in /// response to this request. If it is null, a /// queue object is created internally. /// ///
return LdapSearchQueue

Search() public method

Asynchronously performs the search specified by the parameters, also allowing specification of constraints for the search (such as the maximum number of entries to find or the maximum time to wait for search results).
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public Search ( System base_Renamed, int scope, System filter, System attrs, bool typesOnly, LdapSearchQueue queue, LdapSearchConstraints cons ) : LdapSearchQueue
base_Renamed System
scope int The scope of the entries to search. The following /// are the valid options: ///
    ///
  • SCOPE_BASE - searches only the base DN
  • /// ///
  • SCOPE_ONE - searches only entries under the base DN
  • /// ///
  • SCOPE_SUB - searches the base DN and all entries /// within its subtree
  • ///
///
filter System The search filter specifying the search criteria. /// ///
attrs System The names of attributes to retrieve. /// ///
typesOnly bool If true, returns the names but not the values of /// the attributes found. If false, returns the /// names and values for attributes found. /// ///
queue LdapSearchQueue The queue for messages returned from a server in /// response to this request. If it is null, a /// queue object is created internally. /// ///
cons LdapSearchConstraints The constraints specific to the search. /// ///
return LdapSearchQueue

Search() public static method

Synchronously performs the search specified by the Ldap URL, returning an enumerable LdapSearchResults object.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public static Search ( LdapUrl toGet ) : LdapSearchResults
toGet LdapUrl The Ldap URL specifying the entry to read. /// ///
return LdapSearchResults

Search() public static method

Synchronously perfoms the search specified by the Ldap URL, using the specified search constraints (such as the maximum number of entries to find or the maximum time to wait for search results). When this method is called, a new connection is created automatically, using the host and port specified in the URL. After all search results have been received from the server, the method closes the connection (in other words, it disconnects from the Ldap server). As part of the search constraints, a choice can be made as to whether to have the results delivered all at once or in smaller batches. If the results are to be delivered in smaller batches, each iteration blocks only until the next batch of results is returned.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public static Search ( LdapUrl toGet, LdapSearchConstraints cons ) : LdapSearchResults
toGet LdapUrl Ldap URL specifying the entry to read. /// ///
cons LdapSearchConstraints The constraints specific to the search. /// ///
return LdapSearchResults

Search() public method

Synchronously performs the search specified by the parameters.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public Search ( System base_Renamed, int scope, System filter, System attrs, bool typesOnly ) : LdapSearchResults
base_Renamed System
scope int The scope of the entries to search. The following /// are the valid options: ///
    ///
  • SCOPE_BASE - searches only the base DN
  • /// ///
  • SCOPE_ONE - searches only entries under the base DN
  • /// ///
  • SCOPE_SUB - searches the base DN and all entries /// within its subtree
  • ///
///
filter System Search filter specifying the search criteria. /// ///
attrs System Names of attributes to retrieve. /// ///
typesOnly bool If true, returns the names but not the values of /// the attributes found. If false, returns the /// names and values for attributes found. /// ///
return LdapSearchResults

Search() public method

Synchronously performs the search specified by the parameters, using the specified search constraints (such as the maximum number of entries to find or the maximum time to wait for search results). As part of the search constraints, the method allows specifying whether or not the results are to be delivered all at once or in smaller batches. If specified that the results are to be delivered in smaller batches, each iteration blocks only until the next batch of results is returned.
LdapException A general exception which includes an error /// message and an Ldap error code. ///
public Search ( System base_Renamed, int scope, System filter, System attrs, bool typesOnly, LdapSearchConstraints cons ) : LdapSearchResults
base_Renamed System
scope int The scope of the entries to search. The following /// are the valid options: ///
    ///
  • SCOPE_BASE - searches only the base DN
  • /// ///
  • SCOPE_ONE - searches only entries under the base DN
  • /// ///
  • SCOPE_SUB - searches the base DN and all entries /// within its subtree
  • ///
///
filter System The search filter specifying the search criteria. /// ///
attrs System The names of attributes to retrieve. /// ///
typesOnly bool If true, returns the names but not the values of /// the attributes found. If false, returns the /// names and values for attributes found. /// ///
cons LdapSearchConstraints The constraints specific to the search. /// ///
return LdapSearchResults

SendRequest() public method

Sends an Ldap request to a directory server. The specified the Ldap request is sent to the directory server associated with this connection using default constraints. An Ldap request object is a subclass {@link LdapMessage} with the operation type set to one of the request types. You can build a request by using the request classes found in this package You should note that, since Ldap requests sent to the server using sendRequest are asynchronous, automatic referral following does not apply to these requests.
LdapException A general exception which includes an error /// message and an Ldap error code. /// ///
public SendRequest ( LdapMessage request, LdapMessageQueue queue ) : LdapMessageQueue
request LdapMessage The Ldap request to send to the directory server. ///
queue LdapMessageQueue The queue for messages returned from a server in /// response to this request. If it is null, a /// queue object is created internally. ///
return LdapMessageQueue

SendRequest() public method

Sends an Ldap request to a directory server. The specified the Ldap request is sent to the directory server associated with this connection. An Ldap request object is an {@link LdapMessage} with the operation type set to one of the request types. You can build a request by using the request classes found in this package You should note that, since Ldap requests sent to the server using sendRequest are asynchronous, automatic referral following does not apply to these requests.
LdapException A general exception which includes an error /// message and an Ldap error code. /// ///
public SendRequest ( LdapMessage request, LdapMessageQueue queue, LdapConstraints cons ) : LdapMessageQueue
request LdapMessage The Ldap request to send to the directory server. ///
queue LdapMessageQueue The queue for messages returned from a server in /// response to this request. If it is null, a /// queue object is created internally. ///
cons LdapConstraints The constraints that apply to this request ///
return LdapMessageQueue

getProperty() public method

Returns a property of a connection object.
public getProperty ( System name ) : Object
name System Name of the property to be returned. /// /// The following read-only properties are available /// for any given connection: ///
    ///
  • Ldap_PROPERTY_SDK returns the version of this SDK, /// as a Float data type.
  • /// ///
  • Ldap_PROPERTY_PROTOCOL returns the highest supported version of /// the Ldap protocol, as a Float data type.
  • /// ///
  • Ldap_PROPERTY_SECURITY returns a comma-separated list of the /// types of authentication supported, as a /// string.
  • ///
/// /// A deep copy of the property is provided where applicable; a /// client does not need to clone the object received. /// ///
return System.Object

startTLS() public method

Starts Transport Layer Security (TLS) protocol on this connection to enable session privacy. This affects the LdapConnection object and all cloned objects. A socket factory that implements LdapTLSSocketFactory must be set on the connection.
LdapException Thrown if TLS cannot be started. If a /// SocketFactory has been specified that does not implement /// LdapTLSSocketFactory an LdapException is thrown. /// ///
public startTLS ( ) : void
return void

stopTLS() public method

Stops Transport Layer Security(TLS) on the LDAPConnection and reverts back to an anonymous state. @throws LDAPException This can occur for the following reasons:
  • StartTLS has not been called before stopTLS
  • There exists outstanding messages that have not received all responses
  • The sever was not able to support the operation

Note: The Sun and IBM implementions of JSSE do not currently allow stopping TLS on an open Socket. In order to produce the same results this method currently disconnects the socket and reconnects, giving the application an anonymous connection to the server, as required by StopTLS

public stopTLS ( ) : void
return void