#include <LDAPAsynConnection.h>
Inheritance diagram for LDAPAsynConnection:
Public Member Functions | |
LDAPAsynConnection (const std::string &hostname=std::string("localhost"), int port=389, LDAPConstraints *cons=new LDAPConstraints()) | |
Construtor that initializes a connection to a server. | |
virtual | ~LDAPAsynConnection () |
void | init (const std::string &hostname, int port) |
Initializes a connection to a server. | |
int | start_tls () |
Start TLS on this connection. | |
LDAPMessageQueue * | bind (const std::string &dn="", const std::string &passwd="", const LDAPConstraints *cons=0) |
Simple authentication to a LDAP-Server. | |
LDAPMessageQueue * | search (const std::string &base="", int scope=0, const std::string &filter="objectClass=*", const StringList &attrs=StringList(), bool attrsOnly=false, const LDAPConstraints *cons=0) |
Performing a search on a directory tree. | |
LDAPMessageQueue * | del (const std::string &dn, const LDAPConstraints *cons=0) |
Delete an entry from the directory. | |
LDAPMessageQueue * | compare (const std::string &dn, const LDAPAttribute &attr, const LDAPConstraints *cons=0) |
Perform the COMPARE-operation on an attribute. | |
LDAPMessageQueue * | add (const LDAPEntry *le, const LDAPConstraints *const =0) |
Add an entry to the directory. | |
LDAPMessageQueue * | modify (const std::string &dn, const LDAPModList *modlist, const LDAPConstraints *cons=0) |
Apply modifications to attributes of an entry. | |
LDAPMessageQueue * | rename (const std::string &dn, const std::string &newRDN, bool delOldRDN=false, const std::string &newParentDN="", const LDAPConstraints *cons=0) |
modify the DN of an entry | |
LDAPMessageQueue * | extOperation (const std::string &oid, const std::string &value="", const LDAPConstraints *cons=0) |
Perform a LDAP extended Operation. | |
void | abandon (LDAPMessageQueue *q) |
End an outstanding request. | |
void | unbind () |
Performs the UNBIND-operation on the destination server. | |
LDAP * | getSessionHandle () const |
const std::string & | getHost () const |
int | getPort () const |
void | setConstraints (LDAPConstraints *cons) |
Change the default constraints of the connection. | |
const LDAPConstraints * | getConstraints () const |
Get the default constraints of the connection. | |
LDAPAsynConnection * | referralConnect (const LDAPUrlList &urls, LDAPUrlList::const_iterator &usedUrl, const LDAPConstraints *cons) const |
This method is used internally for automatic referral chasing. | |
Static Public Attributes | |
const int | SEARCH_BASE = 0 |
Constant for the Search-Operation to indicate a Base-Level Search. | |
const int | SEARCH_ONE = 1 |
Constant for the Search-Operation to indicate a One-Level Search. | |
const int | SEARCH_SUB = 2 |
Constant for the Search-Operation to indicate a subtree Search. | |
Protected Attributes | |
bool | m_cacheEnabled |
Is caching enabled? | |
Private Member Functions | |
LDAPAsynConnection (const LDAPAsynConnection &lc) | |
Private copy constructor. | |
Private Attributes | |
LDAP * | cur_session |
A pointer to the C-API LDAP-structure that is associated with this connection. | |
LDAPConstraints * | m_constr |
A pointer to the default LDAPConstrains-object that is used when no LDAPConstraints-parameter is provided with a call for a LDAP-operation. | |
std::string | m_host |
The name of the destination host. | |
int | m_port |
The port the destination server is running on. |
It provides the methods for authentication, and all other LDAP-Operations (e.g. search, add, delete, etc.) All of the LDAP-Operations return a pointer to a LDAPMessageQueue-Object, which can be used to obtain the results of that operation. A basic example of this class could be like this:
1. Create a new LDAPAsynConnection Object:
2. Use the init-method to initialize the connection
3. Call the bind-method to authenticate to the directory
4. Obtain the bind results from the return LDAPMessageQueue-Object
5. Perform on of the operations on the directory (add, delete, search, ..)
6. Use the return LDAPMessageQueue to obtain the results of the operation
7. Close the connection (feature not implemented yet :) )
|
Construtor that initializes a connection to a server.
|
|
|
|
Private copy constructor. So nobody can call it. |
|
End an outstanding request.
|
|
Add an entry to the directory.
Reimplemented in LDAPConnection. |
|
Simple authentication to a LDAP-Server.
|
|
Perform the COMPARE-operation on an attribute.
|
|
Delete an entry from the directory. This method sends a delete request to the server
Reimplemented in LDAPConnection. |
|
Perform a LDAP extended Operation.
|
|
Get the default constraints of the connection.
Reimplemented in LDAPConnection. |
|
Reimplemented in LDAPConnection. |
|
Reimplemented in LDAPConnection. |
|
|
|
Initializes a connection to a server. There actually no communication to the server. Just the object is initialized (e.g. this method is called within the LDAPAsynConnection(char*,int,LDAPConstraints) constructor.)
Reimplemented in LDAPConnection. |
|
Apply modifications to attributes of an entry.
Reimplemented in LDAPConnection. |
|
This method is used internally for automatic referral chasing. It tries to bind to a destination server of the URLs of a referral.
|
|
modify the DN of an entry
Reimplemented in LDAPConnection. |
|
Performing a search on a directory tree. Use the search method to perform a search on the LDAP-Directory
Reimplemented in LDAPConnection. |
|
Change the default constraints of the connection. cons cons New LDAPConstraints to use with the connection Reimplemented in LDAPConnection. |
|
Start TLS on this connection. This isn't in the constructor, because it could fail (i.e. server doesn't have SSL cert, client api wasn't compiled against OpenSSL, etc.). If you need TLS, then you should error if this call fails with an error code. Reimplemented in LDAPConnection. |
|
Performs the UNBIND-operation on the destination server.
Reimplemented in LDAPConnection. |
|
A pointer to the C-API LDAP-structure that is associated with this connection.
|
|
Is caching enabled?
|
|
A pointer to the default LDAPConstrains-object that is used when no LDAPConstraints-parameter is provided with a call for a LDAP-operation.
|
|
The name of the destination host.
|
|
The port the destination server is running on.
|
|
Constant for the Search-Operation to indicate a Base-Level Search.
Reimplemented in LDAPConnection. |
|
Constant for the Search-Operation to indicate a One-Level Search.
Reimplemented in LDAPConnection. |
|
Constant for the Search-Operation to indicate a subtree Search.
Reimplemented in LDAPConnection. |