Akonadi::Server::Handler
#include <handler.h>
Public Member Functions | |
Handler (const Handler &)=delete | |
Handler (Handler &&) noexcept=delete | |
AkonadiServer & | akonadi () const |
bool | checkScopeConstraints (const Scope &scope, const QList< Scope::SelectionScope > &permittedScopes) const |
Protocol::CommandPtr | command () const |
Connection * | connection () const |
bool | failureResponse (const char *response) |
bool | failureResponse (const QByteArray &response) |
bool | failureResponse (const QString &response) |
Handler & | operator= (const Handler &)=delete |
Handler & | operator= (Handler &&) noexcept=delete |
virtual bool | parseStream ()=0 |
template<typename T > | |
void | sendResponse () |
template<typename T > | |
void | sendResponse (T &&response) |
void | setCommand (const Protocol::CommandPtr &cmd) |
void | setConnection (Connection *connection) |
void | setTag (quint64 tag) |
DataStore * | storageBackend () const |
template<typename T > | |
bool | successResponse () |
template<typename T > | |
bool | successResponse (T &&response) |
quint64 | tag () const |
Static Public Member Functions | |
static std::unique_ptr< Handler > | findHandlerForCommandAlwaysAllowed (Protocol::Command::Type cmd, AkonadiServer &akonadi) |
static std::unique_ptr< Handler > | findHandlerForCommandAuthenticated (Protocol::Command::Type cmd, AkonadiServer &akonadi) |
static std::unique_ptr< Handler > | findHandlerForCommandNonAuthenticated (Protocol::Command::Type cmd, AkonadiServer &akonadi) |
Protected Member Functions | |
Handler (AkonadiServer &akonadi) | |
Protected Attributes | |
Protocol::CommandPtr | m_command |
Detailed Description
The handler interfaces describes an entity capable of handling an AkonadiIMAP command.
Constructor & Destructor Documentation
◆ Handler()
|
protected |
Definition at line 161 of file handler.cpp.
Member Function Documentation
◆ akonadi()
AkonadiServer & Handler::akonadi | ( | ) | const |
Definition at line 201 of file handler.cpp.
◆ checkScopeConstraints()
bool Handler::checkScopeConstraints | ( | const Scope & | scope, |
const QList< Scope::SelectionScope > & | permittedScopes ) const |
Definition at line 233 of file handler.cpp.
◆ command()
Protocol::CommandPtr Handler::command | ( | ) | const |
Definition at line 181 of file handler.cpp.
◆ connection()
Connection * Handler::connection | ( | ) | const |
Definition at line 191 of file handler.cpp.
◆ failureResponse() [1/3]
bool Handler::failureResponse | ( | const char * | response | ) |
Definition at line 211 of file handler.cpp.
◆ failureResponse() [2/3]
bool Handler::failureResponse | ( | const QByteArray & | response | ) |
Definition at line 206 of file handler.cpp.
◆ failureResponse() [3/3]
bool Handler::failureResponse | ( | const QString & | response | ) |
Definition at line 216 of file handler.cpp.
◆ findHandlerForCommandAlwaysAllowed()
|
static |
Find a handler for a command that is always allowed, like LOGOUT.
- Parameters
-
cmd the command string
- Returns
- an instance to the handler. The handler is deleted after
- See also
- handelLine is executed. The caller needs to delete the handler in case an exception is thrown from handelLine.
Definition at line 50 of file handler.cpp.
◆ findHandlerForCommandAuthenticated()
|
static |
Find a handler for a command that is allowed when the client is authenticated, like LIST, FETCH, etc.
- Parameters
-
cmd the command string
- Returns
- an instance to the handler. The handler is deleted after
- See also
- handelLine is executed. The caller needs to delete the handler in case an exception is thrown from handelLine.
Definition at line 59 of file handler.cpp.
◆ findHandlerForCommandNonAuthenticated()
|
static |
Find a handler for a command that is allowed when the client is not yet authenticated, like LOGIN.
- Parameters
-
cmd the command string
- Returns
- an instance to the handler. The handler is deleted after
- See also
- handelLine is executed. The caller needs to delete the handler in case an exception is thrown from handelLine.
Definition at line 40 of file handler.cpp.
◆ parseStream()
|
pure virtual |
Parse and handle the IMAP message using the streaming parser.
The implementation MUST leave the trailing newline character(s) in the stream!
- Returns
- true if parsed successfully, false in case of parse failure
Implemented in Akonadi::Server::CollectionCopyHandler, Akonadi::Server::CollectionDeleteHandler, Akonadi::Server::CollectionFetchHandler, Akonadi::Server::CollectionModifyHandler, Akonadi::Server::CollectionMoveHandler, Akonadi::Server::CollectionStatsFetchHandler, Akonadi::Server::ItemCopyHandler, Akonadi::Server::ItemCreateHandler, Akonadi::Server::ItemDeleteHandler, Akonadi::Server::ItemFetchHandler, Akonadi::Server::ItemLinkHandler, Akonadi::Server::ItemModifyHandler, Akonadi::Server::ItemMoveHandler, Akonadi::Server::LoginHandler, Akonadi::Server::LogoutHandler, Akonadi::Server::ResourceSelectHandler, Akonadi::Server::SearchCreateHandler, Akonadi::Server::SearchHandler, Akonadi::Server::SearchResultHandler, Akonadi::Server::TagFetchHandler, and Akonadi::Server::TransactionHandler.
◆ sendResponse() [1/2]
|
inline |
◆ sendResponse() [2/2]
|
inline |
◆ setCommand()
void Handler::setCommand | ( | const Protocol::CommandPtr & | cmd | ) |
Definition at line 176 of file handler.cpp.
◆ setConnection()
void Handler::setConnection | ( | Connection * | connection | ) |
Definition at line 186 of file handler.cpp.
◆ setTag()
void Handler::setTag | ( | quint64 | tag | ) |
Set the tag of the command to be processed, and thus of the response generated by this handler.
- Parameters
-
tag The command tag, an alphanumerical string, normally.
Definition at line 166 of file handler.cpp.
◆ storageBackend()
DataStore * Handler::storageBackend | ( | ) | const |
Definition at line 196 of file handler.cpp.
◆ successResponse() [1/2]
|
inline |
◆ successResponse() [2/2]
|
inline |
◆ tag()
quint64 Handler::tag | ( | ) | const |
The tag of the command associated with this handler.
Definition at line 171 of file handler.cpp.
Member Data Documentation
◆ m_command
|
protected |
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.