Akonadi::Server::Connection

Search for usage in LXR

#include <connection.h>

Signals

void connectionClosing ()
 
void disconnected ()
 

Public Member Functions

AkonadiServer & akonadi () const
 
const CommandContext & context () const
 
bool isOwnerResource (const Collection &collection) const
 
bool isOwnerResource (const PimItem &item) const
 
Protocol::CommandPtr readCommand ()
 
void sendResponse (qint64 tag, const Protocol::CommandPtr &response)
 
template<typename T >
std::enable_if< std::is_base_of< Protocol::Command, T >::value >::type sendResponse (T &&response)
 
QByteArray sessionId () const
 
void setContext (const CommandContext &context)
 
void setSessionId (const QByteArray &id)
 
void setState (ConnectionState state)
 
virtual DataStorestorageBackend ()
 
bool verifyCacheOnRetrieval () const
 

Protected Slots

void handleIncomingData ()
 
void init () override
 
void quit () override
 
void slotConnectionIdle ()
 
void slotSendHello ()
 
void slotSocketDisconnected ()
 

Protected Member Functions

 Connection (AkonadiServer &akonadi)
 
 Connection (quintptr socketDescriptor, AkonadiServer &akonadi)
 
qint64 currentTag () const
 
std::unique_ptr< HandlerfindHandlerForCommand (Protocol::Command::Type cmd)
 

Protected Attributes

AkonadiServer & m_akonadi
 
DataStorem_backend = nullptr
 
bool m_connectionClosing = false
 
ConnectionState m_connectionState = NonAuthenticated
 
CommandContext m_context
 
std::unique_ptr< Handlerm_currentHandler
 
QHash< QString, qint64 > m_executionsByHandler
 
QString m_identifier
 
std::unique_ptr< QTimerm_idleTimer
 
QByteArray m_sessionId
 
std::unique_ptr< QLocalSocketm_socket
 
quintptr m_socketDescriptor = {}
 
QList< QByteArraym_statusMessageQueue
 
QElapsedTimer m_time
 
qint64 m_totalTime = 0
 
QHash< QString, qint64 > m_totalTimeByHandler
 
bool m_verifyCacheOnRetrieval = false
 

Detailed Description

An Connection represents one connection of a client to the server.

Definition at line 38 of file connection.h.

Constructor & Destructor Documentation

◆ Connection() [1/2]

Connection::Connection ( quintptr socketDescriptor,
AkonadiServer & akonadi )
explicitprotected

Use AkThread::create() to construct and start a new connection thread.

Definition at line 44 of file server/connection.cpp.

◆ ~Connection()

Connection::~Connection ( )
override

Definition at line 53 of file core/connection.cpp.

◆ Connection() [2/2]

Connection::Connection ( AkonadiServer & akonadi)
protected

Definition at line 38 of file server/connection.cpp.

Member Function Documentation

◆ akonadi()

AkonadiServer & Akonadi::Server::Connection::akonadi ( ) const
inline

Definition at line 55 of file connection.h.

◆ context()

const CommandContext & Connection::context ( ) const

Definition at line 331 of file server/connection.cpp.

◆ currentTag()

qint64 Connection::currentTag ( ) const
protected

Definition at line 362 of file server/connection.cpp.

◆ findHandlerForCommand()

std::unique_ptr< Handler > Connection::findHandlerForCommand ( Protocol::Command::Type cmd)
protected

Definition at line 341 of file server/connection.cpp.

◆ handleIncomingData

void Connection::handleIncomingData ( )
protectedslot

Definition at line 223 of file core/connection.cpp.

◆ init

void Connection::init ( )
overrideprotectedslot

Definition at line 55 of file server/connection.cpp.

◆ isOwnerResource() [1/2]

bool Connection::isOwnerResource ( const Collection & collection) const

Definition at line 415 of file server/connection.cpp.

◆ isOwnerResource() [2/2]

bool Connection::isOwnerResource ( const PimItem & item) const

Returns true if this connection belongs to the owning resource of item.

Definition at line 403 of file server/connection.cpp.

◆ quit

void Connection::quit ( )
overrideprotectedslot

Definition at line 88 of file server/connection.cpp.

◆ readCommand()

Protocol::CommandPtr Connection::readCommand ( )

Definition at line 476 of file server/connection.cpp.

◆ sendResponse() [1/2]

void Connection::sendResponse ( qint64 tag,
const Protocol::CommandPtr & response )

Definition at line 457 of file server/connection.cpp.

◆ sendResponse() [2/2]

template<typename T >
std::enable_if< std::is_base_of< Protocol::Command, T >::value >::type Akonadi::Server::Connection::sendResponse ( T && response)
inline

Definition at line 138 of file connection.h.

◆ sessionId()

QByteArray Connection::sessionId ( ) const

Definition at line 398 of file server/connection.cpp.

◆ setContext()

void Connection::setContext ( const CommandContext & context)

Definition at line 336 of file server/connection.cpp.

◆ setSessionId()

void Connection::setSessionId ( const QByteArray & id)

Definition at line 385 of file server/connection.cpp.

◆ setState()

void Connection::setState ( ConnectionState state)

Definition at line 367 of file server/connection.cpp.

◆ slotConnectionIdle

void Connection::slotConnectionIdle ( )
protectedslot

Definition at line 133 of file server/connection.cpp.

◆ slotSendHello

void Connection::slotSendHello ( )
protectedslot

Definition at line 104 of file server/connection.cpp.

◆ slotSocketDisconnected

void Connection::slotSocketDisconnected ( )
protectedslot

Definition at line 149 of file server/connection.cpp.

◆ storageBackend()

DataStore * Connection::storageBackend ( )
virtual

Definition at line 116 of file server/connection.cpp.

◆ verifyCacheOnRetrieval()

bool Connection::verifyCacheOnRetrieval ( ) const

Returns true if permanent cache verification is enabled.

Definition at line 426 of file server/connection.cpp.

Member Data Documentation

◆ m_akonadi

AkonadiServer& Akonadi::Server::Connection::m_akonadi
protected

Definition at line 104 of file connection.h.

◆ m_backend

DataStore* Akonadi::Server::Connection::m_backend = nullptr
mutableprotected

Definition at line 111 of file connection.h.

◆ m_connectionClosing

bool Akonadi::Server::Connection::m_connectionClosing = false
protected

Definition at line 123 of file connection.h.

◆ m_connectionState

ConnectionState Akonadi::Server::Connection::m_connectionState = NonAuthenticated
protected

Definition at line 109 of file connection.h.

◆ m_context

CommandContext Akonadi::Server::Connection::m_context
protected

Definition at line 116 of file connection.h.

◆ m_currentHandler

std::unique_ptr<Handler> Akonadi::Server::Connection::m_currentHandler
protected

Definition at line 106 of file connection.h.

◆ m_executionsByHandler

QHash<QString, qint64> Akonadi::Server::Connection::m_executionsByHandler
protected

Definition at line 121 of file connection.h.

◆ m_identifier

QString Akonadi::Server::Connection::m_identifier
protected

Definition at line 113 of file connection.h.

◆ m_idleTimer

std::unique_ptr<QTimer> Akonadi::Server::Connection::m_idleTimer
protected

Definition at line 107 of file connection.h.

◆ m_sessionId

QByteArray Akonadi::Server::Connection::m_sessionId
protected

Definition at line 114 of file connection.h.

◆ m_socket

std::unique_ptr<QLocalSocket> Akonadi::Server::Connection::m_socket
protected

Definition at line 105 of file connection.h.

◆ m_socketDescriptor

quintptr Akonadi::Server::Connection::m_socketDescriptor = {}
protected

Definition at line 103 of file connection.h.

◆ m_statusMessageQueue

QList<QByteArray> Akonadi::Server::Connection::m_statusMessageQueue
protected

Definition at line 112 of file connection.h.

◆ m_time

QElapsedTimer Akonadi::Server::Connection::m_time
protected

Definition at line 118 of file connection.h.

◆ m_totalTime

qint64 Akonadi::Server::Connection::m_totalTime = 0
protected

Definition at line 119 of file connection.h.

◆ m_totalTimeByHandler

QHash<QString, qint64> Akonadi::Server::Connection::m_totalTimeByHandler
protected

Definition at line 120 of file connection.h.

◆ m_verifyCacheOnRetrieval

bool Akonadi::Server::Connection::m_verifyCacheOnRetrieval = false
protected

Definition at line 115 of file connection.h.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:31:59 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.