KLDAP Library
#include <ldapoperation.h>
Public Member Functions | |
LdapOperation (LdapConnection &conn) | |
int | abandon (int id) |
int | add (const LdapObject &object) |
int | add (const LdapDN &dn, const ModOps &ops) |
int | add_s (const LdapObject &object) |
int | add_s (const LdapDN &dn, const ModOps &ops) |
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 |
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) |
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 1315 of file ldapoperation.cpp.
int LdapOperation::add | ( | const LdapObject & | object | ) |
Starts an addition operation.
Returns a message id if successful, -1 if not.
- Parameters
-
object the additional operation to start
Definition at line 1223 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.
- Parameters
-
dn the LdapDN operation to start ops the ModOps operation to start
Definition at line 1235 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.
- Parameters
-
object the object to add to LDAP database
Definition at line 1229 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.
- Parameters
-
dn the LdapDN object to add ops the ModOps object to add
Definition at line 1241 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 1204 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 1210 of file ldapoperation.cpp.
LdapControls LdapOperation::clientControls | ( | ) | const |
Returns the client controls (which set by setClientControls()).
Definition at line 124 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 1285 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 1297 of file ldapoperation.cpp.
LdapConnection & LdapOperation::connection | ( | ) |
Returns the connection object.
Definition at line 109 of file ldapoperation.cpp.
LdapControls LdapOperation::controls | ( | ) | const |
Returns the server controls from the returned ldap message (grabbed by result()).
Definition at line 139 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 1261 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.
- Parameters
-
dn the dn to delete
Definition at line 1267 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 1291 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 1303 of file ldapoperation.cpp.
QByteArray LdapOperation::extendedData | ( | ) | const |
Returns the data from the extended operation response (result returned RES_EXTENDED).
Definition at line 149 of file ldapoperation.cpp.
QByteArray LdapOperation::extendedOid | ( | ) | const |
Returns the OID of the extended operation response (result returned RES_EXTENDED).
Definition at line 144 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 154 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.
- Parameters
-
dn the DN to start modify operation on
Definition at line 1273 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 1279 of file ldapoperation.cpp.
LdapObject LdapOperation::object | ( | ) | const |
Returns the result object if result() returned RES_SEARCH_ENTRY.
Definition at line 134 of file ldapoperation.cpp.
QList< QByteArray > LdapOperation::referrals | ( | ) | const |
This function returns the referral strings from the parsed message (if any).
Definition at line 159 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 1247 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 1254 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 1216 of file ldapoperation.cpp.
LdapControls LdapOperation::serverControls | ( | ) | const |
Returns the server controls (which set by setServerControls()).
Definition at line 129 of file ldapoperation.cpp.
QByteArray LdapOperation::serverCred | ( | ) | const |
Returns the server response for a bind request (result returned RES_BIND).
Definition at line 164 of file ldapoperation.cpp.
void LdapOperation::setClientControls | ( | const LdapControls & | ctrls | ) |
Sets the client controls which will sent with each operation.
Definition at line 114 of file ldapoperation.cpp.
void LdapOperation::setConnection | ( | LdapConnection & | conn | ) |
Sets the connection object.
Without living connection object, LDAP operations are not possible.
- Parameters
-
the connection object to set
Definition at line 104 of file ldapoperation.cpp.
void LdapOperation::setServerControls | ( | const LdapControls & | ctrls | ) |
Sets the server controls which will sent with each operation.
Definition at line 119 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 1309 of file ldapoperation.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:21 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.