akonadi
#include <collectionsync_p.h>

Public Member Functions | |
CollectionSync (const QString &resourceId, QObject *parent=0) | |
~CollectionSync () | |
void | retrievalDone () |
void | rollback () |
void | setHierarchicalRemoteIds (bool hierarchical) |
void | setKeepLocalChanges (const QSet< QByteArray > &parts) |
void | setRemoteCollections (const Collection::List &remoteCollections) |
void | setRemoteCollections (const Collection::List &changedCollections, const Collection::List &removedCollections) |
void | setStreamingEnabled (bool streaming) |
![]() | |
Job (QObject *parent=0) | |
virtual | ~Job () |
virtual QString | errorString () const |
void | start () |
Protected Member Functions | |
void | doStart () |
![]() | |
virtual bool | addSubjob (KJob *job) |
virtual void | doHandleResponse (const QByteArray &tag, const QByteArray &data) |
virtual bool | doKill () |
void | emitWriteFinished () |
virtual bool | removeSubjob (KJob *job) |
Additional Inherited Members | |
![]() | |
enum | Error { ConnectionFailed = UserDefinedError, ProtocolVersionMismatch, UserCanceled, Unknown, UserError = UserDefinedError + 42 } |
typedef QList< Job * > | List |
![]() | |
void | aboutToStart (Akonadi::Job *job) |
void | writeFinished (Akonadi::Job *job) |
![]() | |
virtual void | slotResult (KJob *job) |
Detailed Description
Syncs remote and local collections.
Basic terminology:
- "local": The current state in the Akonadi server
- "remote": The state in the backend, which is also the state the Akonadi server is supposed to have afterwards.
There are three options to influence the way syncing is done:
- Streaming vs. complete delivery: If streaming is enabled remote collections do not need to be delivered in a single batch but can be delivered in multiple chunks. This improves performance but requires an explicit notification when delivery has been completed.
- Incremental vs. non-incremental: In the incremental case only remote changes since the last sync have to be delivered, in the non-incremental mode the full remote state has to be provided. The first is obviously the preferred way, but requires support by the backend.
- Hierarchical vs. global RIDs: The first requires RIDs to be unique per parent collection, the second one requires globally unique RIDs (per resource). Those have different advantages and disadvantages, esp. regarding moving. Which one to chose mostly depends on what the backend provides in this regard.
Definition at line 53 of file collectionsync_p.h.
Constructor & Destructor Documentation
Creates a new collection synchronzier.
- Parameters
-
resourceId The identifier of the resource we are syncing. parent The parent object.
Definition at line 773 of file collectionsync.cpp.
CollectionSync::~CollectionSync | ( | ) |
Destroys this job.
Definition at line 781 of file collectionsync.cpp.
Member Function Documentation
|
protectedvirtual |
This method must be reimplemented in the concrete jobs.
It will be called after the job has been started and a connection to the Akonadi backend has been established.
Implements Akonadi::Job.
Definition at line 814 of file collectionsync.cpp.
void CollectionSync::retrievalDone | ( | ) |
Indicate that all collections have been retrieved in streaming mode.
Definition at line 832 of file collectionsync.cpp.
void CollectionSync::rollback | ( | ) |
Do a rollback operation if needed.
In read only cases this is a noop.
Definition at line 843 of file collectionsync.cpp.
void CollectionSync::setHierarchicalRemoteIds | ( | bool | hierarchical | ) |
Indicate whether the resource supplies collections with hierarchical or global remote identifiers.
false
by default. Must be called before the first call to setRemoteCollections().
- Parameters
-
hierarchical true
if collection remote IDs are relative to their parents' remote IDs
Definition at line 838 of file collectionsync.cpp.
void CollectionSync::setKeepLocalChanges | ( | const QSet< QByteArray > & | parts | ) |
Allows to specify parts of the collection that should not be changed if locally available.
This is useful for resources to provide default values during the collection sync, while preserving more up-to date values if available.
Use CONTENTMIMETYPES as identifier to not overwrite the content mimetypes.
- Since
- 4.14
Definition at line 850 of file collectionsync.cpp.
void CollectionSync::setRemoteCollections | ( | const Collection::List & | remoteCollections | ) |
Sets the result of a full remote collection listing.
- Parameters
-
remoteCollections A list of collections. Important: All of these need a unique remote identifier and parent remote identifier.
Definition at line 786 of file collectionsync.cpp.
void CollectionSync::setRemoteCollections | ( | const Collection::List & | changedCollections, |
const Collection::List & | removedCollections | ||
) |
Sets the result of an incremental remote collection listing.
- Parameters
-
changedCollections A list of remotely added or changed collections. removedCollections A list of remotely deleted collections.
Definition at line 799 of file collectionsync.cpp.
void CollectionSync::setStreamingEnabled | ( | bool | streaming | ) |
Enables streaming, that is not all collections are delivered at once.
Use setRemoteCollections() multiple times when streaming is enabled and call retrievalDone() when all collections have been retrieved. Must be called before the first call to setRemoteCollections().
- Parameters
-
streaming enables streaming if set as true
Definition at line 827 of file collectionsync.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:04 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.