KLDAP Library
KLDAP::LdapConnection Class Reference
#include <ldapconnection.h>
Detailed Description
This class represents a connection to an LDAP server.Definition at line 36 of file ldapconnection.h.
Public Types | |
enum | SASL_Fields { SASL_Authname = 0x1, SASL_Authzid = 0x2, SASL_Realm = 0x4, SASL_Password = 0x8 } |
Public Member Functions | |
LdapConnection () | |
LdapConnection (const LdapUrl &url) | |
LdapConnection (const LdapServer &server) | |
void | setUrl (const LdapUrl &url) |
const LdapServer & | server () const |
void | setServer (const LdapServer &server) |
int | connect () |
QString | connectionError () const |
void | close () |
bool | setSizeLimit (int sizelimit) |
int | sizeLimit () const |
bool | setTimeLimit (int timelimit) |
int | timeLimit () const |
int | getOption (int option, void *value) const |
int | setOption (int option, void *value) |
int | ldapErrorCode () const |
QString | ldapErrorString () const |
QString | saslErrorString () const |
void * | handle () const |
void * | saslHandle () const |
Static Public Member Functions | |
static QString | errorString (int code) |
Constructor & Destructor Documentation
LdapConnection::LdapConnection | ( | ) |
LdapConnection::LdapConnection | ( | const LdapUrl & | url | ) | [explicit] |
Constructs an LdapConnection with the parameters given in url.
Definition at line 94 of file ldapconnection.cpp.
LdapConnection::LdapConnection | ( | const LdapServer & | server | ) | [explicit] |
Constructs an LdapConnection with the parameters given in server.
Definition at line 101 of file ldapconnection.cpp.
Member Function Documentation
void LdapConnection::setUrl | ( | const LdapUrl & | url | ) |
Sets the connection parameters via the specified url.
After this, you need to call connect() to connect with the new parameters.
Definition at line 114 of file ldapconnection.cpp.
const LdapServer & LdapConnection::server | ( | ) | const |
Returns the connection parameters which was specified with an LDAP Url or a LdapServer structure.
Definition at line 124 of file ldapconnection.cpp.
void LdapConnection::setServer | ( | const LdapServer & | server | ) |
Sets the connection parameters via the specified server structure.
After this, you need to call connect() to connect with the new parameters.
Definition at line 119 of file ldapconnection.cpp.
int LdapConnection::connect | ( | ) |
Sets up the connection parameters with creating a handle to the LDAP server.
Also sets sizelimit and timelimit and starts TLS if it is requested. Returns 0 if successful, else returns an LDAP error code, and an error string which is available via connectionError().
Definition at line 412 of file ldapconnection.cpp.
QString LdapConnection::connectionError | ( | ) | const |
Returns a translated error string if connect() failed.
Definition at line 167 of file ldapconnection.cpp.
void LdapConnection::close | ( | ) |
bool LdapConnection::setSizeLimit | ( | int | sizelimit | ) |
int LdapConnection::sizeLimit | ( | ) | const |
bool LdapConnection::setTimeLimit | ( | int | timelimit | ) |
int LdapConnection::timeLimit | ( | ) | const |
int LdapConnection::getOption | ( | int | option, | |
void * | value | |||
) | const |
Gets an option from the connection.
The option value can be client library specific, so avoid this function if possible
Definition at line 364 of file ldapconnection.cpp.
int LdapConnection::setOption | ( | int | option, | |
void * | value | |||
) |
Sets an option in the connection.
The option value can be client library specific, so avoid this function if possible
Definition at line 370 of file ldapconnection.cpp.
int LdapConnection::ldapErrorCode | ( | ) | const |
Returns the LDAP error code from the last operation.
Definition at line 376 of file ldapconnection.cpp.
QString LdapConnection::ldapErrorString | ( | ) | const |
Returns the LDAP error string from the last operation.
Definition at line 382 of file ldapconnection.cpp.
QString LdapConnection::errorString | ( | int | code | ) | [static] |
Returns a translated error message from the specified LDAP error code.
Definition at line 139 of file ldapconnection.cpp.
QString LdapConnection::saslErrorString | ( | ) | const |
Returns the SASL error string from the last SASL operation.
Definition at line 154 of file ldapconnection.cpp.
void * LdapConnection::handle | ( | ) | const |
Returns the opaqe client-library specific LDAP object.
Avoid its usage if you can.
Definition at line 129 of file ldapconnection.cpp.
void * LdapConnection::saslHandle | ( | ) | const |
Returns the opaqe sasl-library specific SASL object.
Avoid its usage if you can.
Definition at line 134 of file ldapconnection.cpp.
The documentation for this class was generated from the following files: