• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepimlibs API Reference
  • KDE Home
  • Contact Us
 

KLDAP Library

  • KLDAP
  • LdapConnection
Public Types | Public Member Functions | Static Public Member Functions | List of all members
KLDAP::LdapConnection Class Reference

#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 LdapUrl &url)
 
 LdapConnection (const LdapServer &server)
 
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 36 of file ldapconnection.h.

Constructor & Destructor Documentation

LdapConnection::LdapConnection ( )

Constructs an LdapConnection object.

Definition at line 92 of file ldapconnection.cpp.

LdapConnection::LdapConnection ( const LdapUrl &  url)
explicit

Constructs an LdapConnection with the parameters given in url.

Definition at line 98 of file ldapconnection.cpp.

LdapConnection::LdapConnection ( const LdapServer &  server)
explicit

Constructs an LdapConnection with the parameters given in server.

Definition at line 105 of file ldapconnection.cpp.

Member Function Documentation

void LdapConnection::close ( )

Closes the LDAP connection.

Definition at line 431 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 421 of file ldapconnection.cpp.

QString LdapConnection::connectionError ( ) const

Returns a translated error string if connect() failed.

Definition at line 172 of file ldapconnection.cpp.

QString LdapConnection::errorString ( int  code)
static

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

Definition at line 143 of file ldapconnection.cpp.

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

Parameters
optionthe connection option to return
valuethe value of option to get

Definition at line 373 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 133 of file ldapconnection.cpp.

int LdapConnection::ldapErrorCode ( ) const

Returns the LDAP error code from the last operation.

Definition at line 385 of file ldapconnection.cpp.

QString LdapConnection::ldapErrorString ( ) const

Returns the LDAP error string from the last operation.

Definition at line 391 of file ldapconnection.cpp.

QString LdapConnection::saslErrorString ( ) const

Returns the SASL error string from the last SASL operation.

Definition at line 159 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 138 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 128 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 379 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.

Parameters
serverthe server object containing the connection parameters

Definition at line 123 of file ldapconnection.cpp.

bool LdapConnection::setSizeLimit ( int  sizelimit)

Sets the size limit for the connection.

Parameters
sizelimitthe connection size limit to set

Definition at line 397 of file ldapconnection.cpp.

bool LdapConnection::setTimeLimit ( int  timelimit)

Sets the time limit for the connection.

Parameters
timelimitthe connection time limit to set

Definition at line 409 of file ldapconnection.cpp.

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 118 of file ldapconnection.cpp.

int LdapConnection::sizeLimit ( ) const

Returns the current size limit.

Definition at line 403 of file ldapconnection.cpp.

int LdapConnection::timeLimit ( ) const

Returns the current time limit.

Definition at line 415 of file ldapconnection.cpp.


The documentation for this class was generated from the following files:
  • ldapconnection.h
  • ldapconnection.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:37:58 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KLDAP Library

Skip menu "KLDAP Library"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal