Buteo Synchronization Framework
|
Class representing a single sync session. More...
#include <SyncSession.h>
Signals | |
void | transferProgress (const QString &aProfileName, Sync::TransferDatabase aDatabase, Sync::TransferType aType, const QString &aMimeType, int aCommittedItems) |
void | storageAccquired (const QString &aProfileName, const QString &aMimeType) |
Signal sent when a storage is accquired. More... | |
void | finished (const QString &aProfileName, Sync::SyncStatus aStatus, const QString &aMessage, SyncResults::MinorCode aErrorCode) |
Signal sent when the session has finished. More... | |
void | syncProgressDetail (const QString &aProfileName, int aProgressDetail) |
Signal sent when the sync is in progress to indicate the detail of the progress. More... | |
Public Member Functions | |
SyncSession (SyncProfile *aProfile, QObject *aParent=0) | |
Constructor. More... | |
virtual | ~SyncSession () |
Destructor. | |
void | setPluginRunner (PluginRunner *aPluginRunner, bool aTransferOwnership) |
Associates a plug-in runner with this session. More... | |
PluginRunner * | pluginRunner () |
Gets the plug-in runner associated with this session. More... | |
bool | isFinished () |
Returns if the sync session is finished or in process. More... | |
bool | isAborted () |
Returns if the sync session was aborted. More... | |
bool | start () |
Starts the session using the associated plug-in runner. More... | |
void | abort (Sync::SyncStatus aStatus=Sync::SYNC_ABORTED) |
Aborts the session. Returns when the abort request is sent. More... | |
void | stop () |
Stops the session. Returns when the session is stopped. | |
SyncProfile * | profile () const |
Gets the sync profile used by this session. More... | |
QString | profileName () const |
Gets the name of the profile used by this session. More... | |
SyncResults | results () const |
Gets the results of the finished session. More... | |
void | setScheduled (bool aScheduled) |
Sets if the session was started by the scheduler. More... | |
bool | isScheduled () const |
Checks if the session was started by the scheduler. More... | |
void | updateResults (const SyncResults &aResults) |
Sets the results for this session. More... | |
void | setFailureResult (SyncResults::MajorCode aMajorCode, SyncResults::MinorCode aMinorCode) |
Sets the results for this session using the provided error code. More... | |
bool | reserveStorages (StorageBooker *aStorageBooker) |
Tries to reserve storages needed by the session. More... | |
void | releaseStorages () |
Releases storages that were reserved earlier with reserveStorages. | |
QMap< QString, bool > | getStorageMap () |
returns the StorageMap used for this session | |
void | setStorageMap (QMap< QString, bool > &aStorageMap) |
sets the storage map for this session More... | |
bool | isProfileCreated () |
returns the returns the status of the profile creation for this session | |
void | setProfileCreated (bool aProfileCreated) |
sets Profile Created flag to true | |
Sync::SyncStatus | mapToSyncStatusError (int aErrorCode) |
Maps sync failure error code from stack to SyncStatus. | |
Class representing a single sync session.
The session can be initiated by a client or server plug-in
|
explicit |
Constructor.
aProfile | SyncProfile associated with the session. With server plug-in initiated sessions this can be null, if there is no profile with a matching destination address. |
aParent | Parent object |
void SyncSession::abort | ( | Sync::SyncStatus | aStatus = Sync::SYNC_ABORTED | ) |
Aborts the session. Returns when the abort request is sent.
- | Status. |
|
signal |
Signal sent when the session has finished.
aProfileName | Name of the profile used by the session |
aStatus | Status of the finished session |
aMessage | Possible textual message |
aErrorCode | Error code, if the status is error |
bool SyncSession::isAborted | ( | ) |
Returns if the sync session was aborted.
bool SyncSession::isFinished | ( | ) |
Returns if the sync session is finished or in process.
bool SyncSession::isScheduled | ( | ) | const |
Checks if the session was started by the scheduler.
PluginRunner * SyncSession::pluginRunner | ( | ) |
Gets the plug-in runner associated with this session.
SyncProfile * SyncSession::profile | ( | ) | const |
Gets the sync profile used by this session.
QString SyncSession::profileName | ( | ) | const |
Gets the name of the profile used by this session.
bool SyncSession::reserveStorages | ( | StorageBooker * | aStorageBooker | ) |
Tries to reserve storages needed by the session.
Successfully reserved storages are automatically released when the session is deleted.
aStorageBooker | Storake booker to use for reserving the storages. If reserving is successfull, this booker is saved internally and used later to release the storages when the session is deleted. |
SyncResults SyncSession::results | ( | ) | const |
Gets the results of the finished session.
This function should be called only after the finished signal is received from the session.
void SyncSession::setFailureResult | ( | SyncResults::MajorCode | aMajorCode, |
SyncResults::MinorCode | aMinorCode | ||
) |
Sets the results for this session using the provided error code.
This function can be used in error situations to set the results to this session, even if the session has failed to run. Time stamp for the results is set to current time.
aMajorCode | Error code |
aMinorCode | failed reason |
void SyncSession::setPluginRunner | ( | PluginRunner * | aPluginRunner, |
bool | aTransferOwnership | ||
) |
Associates a plug-in runner with this session.
aPluginRunner | The plug-in runner to use for this session |
aTransferOwnership | Does this session become the owner of the plug-in runner instance. If so, the plug-in runner is deleted when the session is deleted. |
void SyncSession::setScheduled | ( | bool | aScheduled | ) |
Sets if the session was started by the scheduler.
aScheduled | True if scheduled, false otherwise |
void SyncSession::setStorageMap | ( | QMap< QString, bool > & | aStorageMap | ) |
sets the storage map for this session
aStorageMap | - storage map to set |
bool SyncSession::start | ( | ) |
Starts the session using the associated plug-in runner.
|
signal |
Signal sent when a storage is accquired.
aProfileName | Name of the profile used by the session |
aMimeType | Mimetype of the storage accquired. |
|
signal |
Signal sent when the sync is in progress to indicate the detail of the progress.
aProfileName | Name of the profile used by the session |
aProgressDetail | Detail of the progress. |
|
signal |
void SyncSession::updateResults | ( | const SyncResults & | aResults | ) |
Sets the results for this session.
This function can be used in error situations to set the results to this session, even if the session has failed to run.
aResults | The results to set |