KLDAPCore::LdapClient Class

An object that represents a configured LDAP server. More...

Header: #include <KLDAPCore/LdapClient>
CMake: find_package(KPim6LdapCore REQUIRED)
target_link_libraries(mytarget PRIVATE KPim6::LdapCore)
Inherits: QObject

Public Functions

LdapClient(int clientNumber, QObject *parent = nullptr)
virtual ~LdapClient() override
QStringList attributes() const
void cancelQuery()
int clientNumber() const
int completionWeight() const
bool isActive() const
const KLDAPCore::LdapServer server() const
void setAttributes(const QStringList &attributes)
void setCompletionWeight(int weight)
void setScope(const QString &scope)
void setServer(const KLDAPCore::LdapServer &server)
void startQuery(const QString &filter)

Signals

void done()
void error(const QString &message)
void result(const KLDAPCore::LdapClient &client, const KLDAPCore::LdapObject &)

Detailed Description

This class represents a client that to an LDAP server that can be used for LDAP lookups. Every client is identified by a unique numeric id.

Member Function Documentation

[explicit] LdapClient::LdapClient(int clientNumber, QObject *parent = nullptr)

Creates a new ldap client.

clientNumber The unique number of this client. parent The parent object.

[override virtual noexcept] LdapClient::~LdapClient()

Destroys the ldap client.

QStringList LdapClient::attributes() const

Returns the LDAP attributes that should be returned in the query result.

See also setAttributes().

void LdapClient::cancelQuery()

Cancels a running query.

int LdapClient::clientNumber() const

Returns the number of this client.

int LdapClient::completionWeight() const

Returns the completion weight of this client.

See also setCompletionWeight().

[signal] void LdapClient::done()

This signal is emitted when the query has finished.

[signal] void LdapClient::error(const QString &message)

This signal is emitted in case of an error.

message A message that describes the error.

bool LdapClient::isActive() const

Returns whether this client is currently running a search query.

[signal] void LdapClient::result(const KLDAPCore::LdapClient &client, const KLDAPCore::LdapObject &)

This signal is emitted once for each object that is returned from the query

const KLDAPCore::LdapServer LdapClient::server() const

Returns the ldap server information that are used by this client.

See also setServer().

void LdapClient::setAttributes(const QStringList &attributes)

Sets the LDAP attributes that should be returned in the query result.

Pass an empty list to include all available attributes.

See also attributes().

void LdapClient::setCompletionWeight(int weight)

Sets the completion weight of this client.

This value will be used to sort the results of this client when used for auto completion.

See also completionWeight().

void LdapClient::setScope(const QString &scope)

Sets the scope of the LDAP query.

Valid values are 'one' or 'sub'.

void LdapClient::setServer(const KLDAPCore::LdapServer &server)

Sets the LDAP server information that shall be used by this client.

See also server().

void LdapClient::startQuery(const QString &filter)

Starts the query with the given filter.