• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

KLDAP Library

KLDAP::LdapOperation

KLDAP::LdapOperation Class Reference

This class allows sending an ldap operation (search, rename, modify, delete, compare, exop) to an LDAP server. More...

#include <ldapoperation.h>

List of all members.


Public Types


Public Member Functions

int abandon (int id)
int add (const LdapDN &dn, const ModOps &ops)
int add (const LdapObject &object)
int add_s (const LdapDN &dn, const ModOps &ops)
int add_s (const LdapObject &object)
int bind (const QByteArray &creds=QByteArray(), SASL_Callback_Proc *saslproc=NULL, void *data=NULL)
int bind_s (SASL_Callback_Proc *saslproc=NULL, void *data=NULL)
LdapControls clientControls () const
int compare (const LdapDN &dn, const QString &attr, const QByteArray &value)
int compare_s (const LdapDN &dn, const QString &attr, const QByteArray &value)
LdapConnection & connection ()
LdapControls controls () const
int del (const LdapDN &dn)
int del_s (const LdapDN &dn)
int exop (const QString &oid, const QByteArray &data)
int exop_s (const QString &oid, const QByteArray &data)
QByteArray extendedData () const
QByteArray extendedOid () const
 LdapOperation (LdapConnection &conn)
QString matchedDn () const
int modify (const LdapDN &dn, const ModOps &ops)
int modify_s (const LdapDN &dn, const ModOps &ops)
LdapObject object () const
QList< QByteArray > referrals () const
int rename (const LdapDN &dn, const QString &newRdn, const QString &newSuperior, bool deleteold=true)
int rename_s (const LdapDN &dn, const QString &newRdn, const QString &newSuperior, bool deleteold=true)
typedef int() SASL_Callback_Proc (SASL_Credentials &cred, void *data)
int search (const LdapDN &base, LdapUrl::Scope scope, const QString &filter, const QStringList &attrs)
LdapControls serverControls () const
QByteArray serverCred () const
void setClientControls (const LdapControls &ctrls)
void setConnection (LdapConnection &conn)
void setServerControls (const LdapControls &ctrls)
int waitForResult (int id, int msecs=-1)

Detailed Description

This class allows sending an ldap operation (search, rename, modify, delete, compare, exop) to an LDAP server.

Definition at line 43 of file ldapoperation.h.


Member Function Documentation

int LdapOperation::abandon ( int  id  ) 

Abandons a long-running operation.

Requires the message id.

Definition at line 1292 of file ldapoperation.cpp.

int LdapOperation::add ( const LdapDN &  dn,
const ModOps &  ops 
)

Starts an addition operation.

This version accepts ModOps not LdapObject. Returns a message id if successful, -1 if not.

Definition at line 1212 of file ldapoperation.cpp.

int LdapOperation::add ( const LdapObject &  object  ) 

Starts an addition operation.

Returns a message id if successful, -1 if not.

Definition at line 1200 of file ldapoperation.cpp.

int LdapOperation::add_s ( const LdapDN &  dn,
const ModOps &  ops 
)

Adds the specified object to the LDAP database.

This version accepts ModOps not LdapObject. This is the synchronous version. Returns KLDAP_SUCCESS id if successful, else an LDAP error code.

Definition at line 1218 of file ldapoperation.cpp.

int LdapOperation::add_s ( const LdapObject &  object  ) 

Adds the specified object to the LDAP database.

Returns KLDAP_SUCCESS id if successful, else an LDAP error code.

Definition at line 1206 of file ldapoperation.cpp.

int LdapOperation::bind ( const QByteArray &  creds = QByteArray(),
SASL_Callback_Proc *  saslproc = NULL,
void *  data = NULL 
)

Binds to the server which specified in the connection object.

Can do simple or SASL bind. Returns a message id if successful, negative value if not.

Definition at line 1181 of file ldapoperation.cpp.

int LdapOperation::bind_s ( SASL_Callback_Proc *  saslproc = NULL,
void *  data = NULL 
)

Binds to the server which specified in the connection object.

Can do simple or SASL bind. This is the synchronous version. Returns KLDAP_SUCCESS id if successful, else an LDAP error code.

Definition at line 1187 of file ldapoperation.cpp.

LdapControls LdapOperation::clientControls (  )  const

Returns the client controls (which set by setClientControls()).

Definition at line 120 of file ldapoperation.cpp.

int LdapOperation::compare ( const LdapDN &  dn,
const QString &  attr,
const QByteArray &  value 
)

Starts a compare operation on the given DN, compares the specified attribute with the given value.

Returns a message id if successful, -1 if not.

Definition at line 1262 of file ldapoperation.cpp.

int LdapOperation::compare_s ( const LdapDN &  dn,
const QString &  attr,
const QByteArray &  value 
)

Performs a compare operation on the given DN, compares the specified attribute with the given value.

This is the synchronous version. Returns KLDAP_COMPARE_TRUE if the entry contains the attribute value and KLDAP_COMPARE_FALSE if it does not. Otherwise, some error code is returned.

Definition at line 1274 of file ldapoperation.cpp.

LdapConnection & LdapOperation::connection (  ) 

Returns the connection object.

Definition at line 105 of file ldapoperation.cpp.

LdapControls LdapOperation::controls (  )  const

Returns the server controls from the returned ldap message (grabbed by result()).

Definition at line 135 of file ldapoperation.cpp.

int LdapOperation::del ( const LdapDN &  dn  ) 

Starts a delete operation on the given DN.

Returns a message id if successful, -1 if not.

Definition at line 1238 of file ldapoperation.cpp.

int LdapOperation::del_s ( const LdapDN &  dn  ) 

Deletes the given DN.

This is the synchronous version. Returns KLDAP_SUCCESS id if successful, else an LDAP error code.

Definition at line 1244 of file ldapoperation.cpp.

int LdapOperation::exop ( const QString &  oid,
const QByteArray &  data 
)

Starts an extended operation specified with oid and data.

Returns a message id if successful, -1 if not.

Definition at line 1268 of file ldapoperation.cpp.

int LdapOperation::exop_s ( const QString &  oid,
const QByteArray &  data 
)

Performs an extended operation specified with oid and data.

This is the synchronous version. Returns KLDAP_SUCCESS id if successful, else an LDAP error code.

Definition at line 1280 of file ldapoperation.cpp.

QByteArray LdapOperation::extendedData (  )  const

Returns the data from the extended operation response (result returned RES_EXTENDED).

Definition at line 145 of file ldapoperation.cpp.

QByteArray LdapOperation::extendedOid (  )  const

Returns the OID of the extended operation response (result returned RES_EXTENDED).

Definition at line 140 of file ldapoperation.cpp.

QString LdapOperation::matchedDn (  )  const

The server might supply a matched DN string in the message indicating how much of a name in a request was recognized.

This can be grabbed by matchedDn().

Definition at line 150 of file ldapoperation.cpp.

int LdapOperation::modify ( const LdapDN &  dn,
const ModOps &  ops 
)

Starts a modify operation on the given DN.

Returns a message id if successful, -1 if not.

Definition at line 1250 of file ldapoperation.cpp.

int LdapOperation::modify_s ( const LdapDN &  dn,
const ModOps &  ops 
)

Performs a modify operation on the given DN.

This is the synchronous version. Returns KLDAP_SUCCESS id if successful, else an LDAP error code.

Definition at line 1256 of file ldapoperation.cpp.

LdapObject LdapOperation::object (  )  const

Returns the result object if result() returned RES_SEARCH_ENTRY.

Definition at line 130 of file ldapoperation.cpp.

QList< QByteArray > LdapOperation::referrals (  )  const

This function returns the referral strings from the parsed message (if any).

Definition at line 155 of file ldapoperation.cpp.

int LdapOperation::rename ( const LdapDN &  dn,
const QString &  newRdn,
const QString &  newSuperior,
bool  deleteold = true 
)

Starts a modrdn operation on given DN, changing its RDN to newRdn, changing its parent to newSuperior (if it's not empty), and deletes the old dn if deleteold is true.

Returns a message id if successful, -1 if not.

Definition at line 1224 of file ldapoperation.cpp.

int LdapOperation::rename_s ( const LdapDN &  dn,
const QString &  newRdn,
const QString &  newSuperior,
bool  deleteold = true 
)

Performs a modrdn operation on given DN, changing its RDN to newRdn, changing its parent to newSuperior (if it's not empty), and deletes the old dn if deleteold is true.

This is the synchronous version. Returns KLDAP_SUCCESS id if successful, else an LDAP error code.

Definition at line 1231 of file ldapoperation.cpp.

int LdapOperation::search ( const LdapDN &  base,
LdapUrl::Scope  scope,
const QString &  filter,
const QStringList &  attrs 
)

Starts a search operation with the given base DN, scope, filter and result attributes.

Returns a message id if successful, -1 if not.

Definition at line 1193 of file ldapoperation.cpp.

LdapControls LdapOperation::serverControls (  )  const

Returns the server controls (which set by setServerControls()).

Definition at line 125 of file ldapoperation.cpp.

QByteArray LdapOperation::serverCred (  )  const

Returns the server response for a bind request (result returned RES_BIND).

Definition at line 160 of file ldapoperation.cpp.

void LdapOperation::setClientControls ( const LdapControls &  ctrls  ) 

Sets the client controls which will sent with each operation.

Definition at line 110 of file ldapoperation.cpp.

void LdapOperation::setConnection ( LdapConnection &  conn  ) 

Sets the connection object.

Without living connection object, LDAP operations are not possible.

Definition at line 100 of file ldapoperation.cpp.

void LdapOperation::setServerControls ( const LdapControls &  ctrls  ) 

Sets the server controls which will sent with each operation.

Definition at line 115 of file ldapoperation.cpp.

int LdapOperation::waitForResult ( int  id,
int  msecs = -1 
)

Waits for up to msecs milliseconds for a result message from the LDAP server.

If msecs is -1, then this function will block indefinitely. If msecs is 0, then this function will return immediately, that is it will perform a poll for a result message.

Returns the type of the result LDAP message (RES_XXX constants). -1 if error occurred, 0 if the timeout value elapsed. Note! Return code -1 means that fetching the message resulted in error, not the LDAP operation error. Call connection().ldapErrorCode() to determine if the operation succeeded.

Definition at line 1286 of file ldapoperation.cpp.


The documentation for this class was generated from the following files:
  • ldapoperation.h
  • ldapoperation.cpp

KLDAP Library

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

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  • kabc
  • kblog
  • kcal
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.8
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal