KLDAPCore::LdapConnection

Search for usage in LXR

#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 LdapServerserver () 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]

LdapConnection::LdapConnection ( const LdapUrl & url)
explicit

Constructs an LdapConnection with the parameters given in url.

Definition at line 76 of file ldapconnection.cpp.

◆ LdapConnection() [3/3]

LdapConnection::LdapConnection ( const LdapServer & server)
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()

QString LdapConnection::connectionError ( ) const
nodiscard

Returns a translated error string if connect() failed.

Definition at line 137 of file ldapconnection.cpp.

◆ errorString()

QString LdapConnection::errorString ( int code)
staticnodiscard

Returns a translated error message from the specified LDAP error code.

Definition at line 120 of file ldapconnection.cpp.

◆ getOption()

int LdapConnection::getOption ( int option,
void * value ) const
nodiscard

Gets an option from the connection.

The option value can be client library specific, so avoid this function if possible

Parameters
optionthe connection option to return
valuethe 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()

int LdapConnection::ldapErrorCode ( ) const
nodiscard

Returns the LDAP error code from the last operation.

Definition at line 393 of file ldapconnection.cpp.

◆ ldapErrorString()

QString LdapConnection::ldapErrorString ( ) const
nodiscard

Returns the LDAP error string from the last operation.

Definition at line 399 of file ldapconnection.cpp.

◆ saslErrorString()

QString LdapConnection::saslErrorString ( ) const
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
serverthe server object containing the connection parameters

Definition at line 100 of file ldapconnection.cpp.

◆ setSizeLimit()

bool LdapConnection::setSizeLimit ( int sizelimit)
nodiscard

Sets the size limit for the connection.

Parameters
sizelimitthe connection size limit to set

Definition at line 405 of file ldapconnection.cpp.

◆ setTimeLimit()

bool LdapConnection::setTimeLimit ( int timelimit)
nodiscard

Sets the time limit for the connection.

Parameters
timelimitthe 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
urlthe URL containing the connection parameters

Definition at line 95 of file ldapconnection.cpp.

◆ sizeLimit()

int LdapConnection::sizeLimit ( ) const
nodiscard

Returns the current size limit.

Definition at line 411 of file ldapconnection.cpp.

◆ timeLimit()

int LdapConnection::timeLimit ( ) const
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:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:03:36 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.