KLDAPCore::LdapOperation
#include <ldapoperation.h>
Public Types | |
using | ModOp |
using | ModOps = QList<ModOp> |
using | ModType |
using | ResultType |
using | SASL_Callback_Proc = int(SASL_Credentials &, void *) |
enum | SASL_Fields { SASL_Authname = 0x1 , SASL_Authzid = 0x2 , SASL_Realm = 0x4 , SASL_Password = 0x8 } |
Public Member Functions | |
LdapOperation (LdapConnection &conn) | |
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=nullptr, void *data=nullptr) |
int | bind_s (SASL_Callback_Proc *saslproc=nullptr, void *data=nullptr) |
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 30 of file ldapoperation.h.
Member Typedef Documentation
◆ ModOp
using KLDAPCore::LdapOperation::ModOp |
Definition at line 54 of file ldapoperation.h.
◆ ModOps
using KLDAPCore::LdapOperation::ModOps = QList<ModOp> |
Definition at line 60 of file ldapoperation.h.
◆ ModType
using KLDAPCore::LdapOperation::ModType |
Definition at line 33 of file ldapoperation.h.
◆ ResultType
using KLDAPCore::LdapOperation::ResultType |
Definition at line 40 of file ldapoperation.h.
◆ SASL_Callback_Proc
using KLDAPCore::LdapOperation::SASL_Callback_Proc = int(SASL_Credentials &, void *) |
Definition at line 77 of file ldapoperation.h.
Member Enumeration Documentation
◆ SASL_Fields
enum KLDAPCore::LdapOperation::SASL_Fields |
Definition at line 62 of file ldapoperation.h.
Constructor & Destructor Documentation
◆ LdapOperation() [1/2]
LdapOperation::LdapOperation | ( | ) |
Definition at line 76 of file ldapoperation.cpp.
◆ LdapOperation() [2/2]
|
explicit |
Definition at line 82 of file ldapoperation.cpp.
Member Function Documentation
◆ abandon()
|
nodiscard |
Abandons a long-running operation.
Requires the message id.
Definition at line 1273 of file ldapoperation.cpp.
◆ add() [1/2]
|
nodiscard |
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 1195 of file ldapoperation.cpp.
◆ add() [2/2]
|
nodiscard |
Starts an addition operation.
Returns a message id if successful, -1 if not.
- Parameters
-
object the additional operation to start
Definition at line 1183 of file ldapoperation.cpp.
◆ add_s() [1/2]
|
nodiscard |
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 1201 of file ldapoperation.cpp.
◆ add_s() [2/2]
|
nodiscard |
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 1189 of file ldapoperation.cpp.
◆ bind()
|
nodiscard |
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 1165 of file ldapoperation.cpp.
◆ bind_s()
|
nodiscard |
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 1171 of file ldapoperation.cpp.
◆ clientControls()
|
nodiscard |
Returns the client controls (which set by setClientControls()).
Definition at line 110 of file ldapoperation.cpp.
◆ compare()
|
nodiscard |
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 1243 of file ldapoperation.cpp.
◆ compare_s()
|
nodiscard |
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 1255 of file ldapoperation.cpp.
◆ connection()
LdapConnection & LdapOperation::connection | ( | ) |
Returns the connection object.
Definition at line 95 of file ldapoperation.cpp.
◆ controls()
|
nodiscard |
Returns the server controls from the returned ldap message (grabbed by result()).
Definition at line 125 of file ldapoperation.cpp.
◆ del()
|
nodiscard |
Starts a delete operation on the given DN.
Returns a message id if successful, -1 if not.
Definition at line 1219 of file ldapoperation.cpp.
◆ del_s()
|
nodiscard |
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 1225 of file ldapoperation.cpp.
◆ exop()
|
nodiscard |
Starts an extended operation specified with oid and data.
Returns a message id if successful, -1 if not.
Definition at line 1249 of file ldapoperation.cpp.
◆ exop_s()
|
nodiscard |
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 1261 of file ldapoperation.cpp.
◆ extendedData()
|
nodiscard |
Returns the data from the extended operation response (result returned RES_EXTENDED).
Definition at line 135 of file ldapoperation.cpp.
◆ extendedOid()
|
nodiscard |
Returns the OID of the extended operation response (result returned RES_EXTENDED).
Definition at line 130 of file ldapoperation.cpp.
◆ matchedDn()
|
nodiscard |
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 140 of file ldapoperation.cpp.
◆ modify()
|
nodiscard |
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 1231 of file ldapoperation.cpp.
◆ modify_s()
|
nodiscard |
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 1237 of file ldapoperation.cpp.
◆ object()
|
nodiscard |
Returns the result object if result() returned RES_SEARCH_ENTRY.
Definition at line 120 of file ldapoperation.cpp.
◆ referrals()
|
nodiscard |
This function returns the referral strings from the parsed message (if any).
Definition at line 145 of file ldapoperation.cpp.
◆ rename()
|
nodiscard |
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 1207 of file ldapoperation.cpp.
◆ rename_s()
|
nodiscard |
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 1213 of file ldapoperation.cpp.
◆ search()
|
nodiscard |
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 1177 of file ldapoperation.cpp.
◆ serverControls()
|
nodiscard |
Returns the server controls (which set by setServerControls()).
Definition at line 115 of file ldapoperation.cpp.
◆ serverCred()
|
nodiscard |
Returns the server response for a bind request (result returned RES_BIND).
Definition at line 150 of file ldapoperation.cpp.
◆ setClientControls()
void LdapOperation::setClientControls | ( | const LdapControls & | ctrls | ) |
Sets the client controls which will sent with each operation.
Definition at line 100 of file ldapoperation.cpp.
◆ setConnection()
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 90 of file ldapoperation.cpp.
◆ setServerControls()
void LdapOperation::setServerControls | ( | const LdapControls & | ctrls | ) |
Sets the server controls which will sent with each operation.
Definition at line 105 of file ldapoperation.cpp.
◆ waitForResult()
|
nodiscard |
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 1267 of file ldapoperation.cpp.
The documentation for this class was generated from the following files:
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.