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 | setRemoteCollections (const Collection::List &remoteCollections) |
void | setRemoteCollections (const Collection::List &changedCollections, const Collection::List &removedCollections) |
void | setStreamingEnabled (bool streaming) |
Public Member Functions inherited from Akonadi::Job | |
Job (QObject *parent=0) | |
virtual | ~Job () |
virtual QString | errorString () const |
void | start () |
Protected Member Functions | |
void | doStart () |
Protected Member Functions inherited from Akonadi::Job | |
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 | |
Public Types inherited from Akonadi::Job | |
enum | Error { ConnectionFailed = UserDefinedError, ProtocolVersionMismatch, UserCanceled, Unknown, UserError = UserDefinedError + 42 } |
typedef QList< Job * > | List |
Signals inherited from Akonadi::Job | |
void | aboutToStart (Akonadi::Job *job) |
void | writeFinished (Akonadi::Job *job) |
Protected Slots inherited from Akonadi::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
|
explicit |
Creates a new collection synchronzier.
- Parameters
-
resourceId The identifier of the resource we are syncing. parent The parent object.
Definition at line 757 of file collectionsync.cpp.
CollectionSync::~CollectionSync | ( | ) |
Destroys this job.
Definition at line 765 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 798 of file collectionsync.cpp.
void CollectionSync::retrievalDone | ( | ) |
Indicate that all collections have been retrieved in streaming mode.
Definition at line 816 of file collectionsync.cpp.
void CollectionSync::rollback | ( | ) |
Do a rollback operation if needed.
In read only cases this is a noop.
Definition at line 827 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 822 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 770 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 783 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 811 of file collectionsync.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:28 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.