KLDAPCore::LdapConnection
#include <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 LdapServer &server) | |
LdapConnection (const LdapUrl &url) | |
void | close () |
int | connect () |
QString | connectionError () const |
int | getOption (int option, void *value) const |
void * | handle () const |
int | ldapErrorCode () const |
QString | ldapErrorString () const |
QString | saslErrorString () const |
void * | saslHandle () const |
const LdapServer & | server () const |
int | setOption (int option, void *value) |
void | setServer (const LdapServer &server) |
bool | setSizeLimit (int sizelimit) |
bool | setTimeLimit (int timelimit) |
void | setUrl (const LdapUrl &url) |
int | sizeLimit () const |
int | timeLimit () const |
Static Public Member Functions | |
static QString | errorString (int code) |
Detailed Description
This class represents a connection to an LDAP server.
Definition at line 23 of file ldapconnection.h.
Member Enumeration Documentation
◆ SASL_Fields
enum KLDAPCore::LdapConnection::SASL_Fields |
Definition at line 26 of file ldapconnection.h.
Constructor & Destructor Documentation
◆ LdapConnection() [1/3]
LdapConnection::LdapConnection | ( | ) |
Constructs an LdapConnection object.
Definition at line 70 of file ldapconnection.cpp.
◆ LdapConnection() [2/3]
|
explicit |
Constructs an LdapConnection with the parameters given in url.
Definition at line 76 of file ldapconnection.cpp.
◆ LdapConnection() [3/3]
|
explicit |
Constructs an LdapConnection with the parameters given in server.
Definition at line 83 of file ldapconnection.cpp.
◆ ~LdapConnection()
LdapConnection::~LdapConnection | ( | ) |
Definition at line 90 of file ldapconnection.cpp.
Member Function Documentation
◆ close()
void LdapConnection::close | ( | ) |
Closes the LDAP connection.
Definition at line 439 of file ldapconnection.cpp.
◆ connect()
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 429 of file ldapconnection.cpp.
◆ connectionError()
|
nodiscard |
Returns a translated error string if connect() failed.
Definition at line 137 of file ldapconnection.cpp.
◆ errorString()
|
staticnodiscard |
Returns a translated error message from the specified LDAP error code.
Definition at line 120 of file ldapconnection.cpp.
◆ getOption()
|
nodiscard |
Gets an option from the connection.
The option value can be client library specific, so avoid this function if possible
- Parameters
-
option the connection option to return value the value of option to get
Definition at line 381 of file ldapconnection.cpp.
◆ handle()
void * LdapConnection::handle | ( | ) | const |
Returns the opaqe client-library specific LDAP object.
Avoid its usage if you can.
Definition at line 110 of file ldapconnection.cpp.
◆ ldapErrorCode()
|
nodiscard |
Returns the LDAP error code from the last operation.
Definition at line 393 of file ldapconnection.cpp.
◆ ldapErrorString()
|
nodiscard |
Returns the LDAP error string from the last operation.
Definition at line 399 of file ldapconnection.cpp.
◆ saslErrorString()
|
nodiscard |
Returns the SASL error string from the last SASL operation.
Definition at line 130 of file ldapconnection.cpp.
◆ saslHandle()
void * LdapConnection::saslHandle | ( | ) | const |
Returns the opaqe sasl-library specific SASL object.
Avoid its usage if you can.
Definition at line 115 of file ldapconnection.cpp.
◆ server()
const LdapServer & LdapConnection::server | ( | ) | const |
Returns the connection parameters which was specified with an LDAP Url or a LdapServer structure.
Definition at line 105 of file ldapconnection.cpp.
◆ setOption()
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 387 of file ldapconnection.cpp.
◆ setServer()
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.
- Parameters
-
server the server object containing the connection parameters
Definition at line 100 of file ldapconnection.cpp.
◆ setSizeLimit()
|
nodiscard |
Sets the size limit for the connection.
- Parameters
-
sizelimit the connection size limit to set
Definition at line 405 of file ldapconnection.cpp.
◆ setTimeLimit()
|
nodiscard |
Sets the time limit for the connection.
- Parameters
-
timelimit the connection time limit to set
Definition at line 417 of file ldapconnection.cpp.
◆ setUrl()
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.
- Parameters
-
url the URL containing the connection parameters
Definition at line 95 of file ldapconnection.cpp.
◆ sizeLimit()
|
nodiscard |
Returns the current size limit.
Definition at line 411 of file ldapconnection.cpp.
◆ timeLimit()
|
nodiscard |
Returns the current time limit.
Definition at line 423 of file ldapconnection.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:34:09 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.