24 #ifndef SYNCHRONIZER_H
25 #define SYNCHRONIZER_H
27 #include "SyncDBusInterface.h"
28 #include "SyncQueue.h"
29 #include "StorageBooker.h"
30 #include "SyncScheduler.h"
31 #include "SyncBackup.h"
32 #include "SyncOnChange.h"
33 #include "SyncOnChangeScheduler.h"
35 #include "SyncCommonDefs.h"
36 #include "ProfileManager.h"
37 #include "PluginManager.h"
38 #include "PluginCbInterface.h"
39 #include "ClientPlugin.h"
43 #include <QCoreApplication>
46 #include <QDBusInterface>
47 #include <QScopedPointer>
54 class ServerPluginRunner;
56 class TransportTracker;
57 class ServerActivator;
107 virtual QString
getValue(
const QString& aAddress,
const QString& aKey);
116 virtual bool startSync(QString aProfileName);
119 virtual void abortSync(QString aProfileName);
137 virtual bool setSyncSchedule(QString aProfileId , QString aScheduleAsXml);
167 virtual QString
syncProfile(
const QString &aProfileId);
168 virtual QStringList syncProfilesByKey(
const QString &aKey,
const QString &aValue);
169 virtual QStringList syncProfilesByType(
const QString &aType);
190 void start(
unsigned int aAccountId);
196 void stop(
unsigned int aAccountId);
217 int status(
unsigned int aAccountId,
int &aFailedReason, qlonglong &aPrevSyncTime, qlonglong &aNextSyncTime);
239 void syncDone(
const QString &aProfileName);
248 void onStorageReleased();
250 void onTransferProgress(
const QString &aProfileName,
251 Sync::TransferDatabase aDatabase, Sync::TransferType aType,
252 const QString &aMimeType,
int aCommittedItems );
254 void onSessionFinished(
const QString &aProfileName,
255 Sync::SyncStatus aStatus,
const QString &aMessage,
int aErrorCode );
257 void onStorageAccquired(
const QString &aProfileName,
const QString &aMimeType);
259 void onSyncProgressDetail(
const QString &aProfileName,
int aProgressDetail);
263 void onNewSession(
const QString &aDestination);
265 void slotProfileChanged(QString aProfileName,
int aChangeType , QString aProfileAsXml);
271 void startServer(
const QString &aProfileName);
277 void stopServer(
const QString &aProfileName);
279 void onNetworkStateChanged(
bool aState, Sync::InternetConnectionType type);
287 void enableSOCSlot(
const QString& aProfileName);
293 void reschedule(
const QString &aProfileName);
302 void slotSyncStatus(QString aProfileName,
int aStatus,
303 QString aMessage,
int aMoreDetails);
309 void removeScheduledSync(
const QString &aProfileName);
318 void externalSyncStatus(
const SyncProfile *aProfile,
bool aQuery=
false);
322 bool startSync(
const QString &aProfileName,
bool aScheduled);
337 bool startNextSync();
344 void cleanupSession(
SyncSession *aSession, Sync::SyncStatus aStatus);
350 void startServers(
bool resume =
false );
356 void stopServers(
bool suspend =
false );
361 void backupRestoreStarts ();
366 void backupRestoreFinished();
371 void initializeScheduler();
373 bool isBackupRestoreInProgress ();
380 bool cleanupProfile(
const QString &profileId);
382 bool clientProfileActive(
const QString &clientProfileName);
389 void removeExternalSyncStatus(
const SyncProfile *aProfile);
395 bool acceptScheduledSync(
bool aConnected, Sync::InternetConnectionType aType)
const;
439 void saveProfileCounter(
const SyncProfile* aProfile);
453 #ifdef SYNCFW_UNIT_TESTS
454 friend class SynchronizerTest;
457 QDBusInterface *iSyncUIInterface;
458 _GSettings *iSettings;
463 #endif // SYNCHRONIZER_H
virtual QStringList runningSyncs()
Definition: synchronizer.cpp:1026
virtual Profile * getSyncProfileByRemoteAddress(const QString &aAddress)
Definition: synchronizer.cpp:1974
void restoreFinished()
Called when backup is restored.
Definition: synchronizer.cpp:1700
This class represents a single profile, a collection of settings or data releated to some entity...
Definition: Profile.h:52
virtual bool startSync(QString aProfileName)
Definition: synchronizer.cpp:283
Definition: SyncOnChangeScheduler.h:15
Manages plugins.
Definition: PluginManager.h:91
void isSyncedExternally(unsigned int aAccountId, const QString aClientProfileName)
Queries the sync externally status of a given account, 'syncedExternallyStatus' signal is emitted wit...
Definition: synchronizer.cpp:2129
virtual void releaseStorages(QStringList aStorageNames)
Definition: synchronizer.cpp:1018
void close()
stops the daemon and unregisters the dbus object
Definition: synchronizer.cpp:235
this class initiates a sync if there are changes in storage(s) it's asked to monitor ...
Definition: SyncOnChange.h:19
virtual bool requestStorages(QStringList aStorageNames)
Definition: synchronizer.cpp:1011
int status(unsigned int aAccountId, int &aFailedReason, qlonglong &aPrevSyncTime, qlonglong &aNextSyncTime)
Returns the status of the sync for the given account Id.
Definition: synchronizer.cpp:1737
QList< unsigned int > syncingAccounts()
Returns the list of account IDs for which sync is ongoing.
Definition: synchronizer.cpp:1797
virtual QStringList allVisibleSyncProfiles()
Gets all visible sync profiles.
Definition: synchronizer.cpp:1858
Definition: AccountsHelper.h:31
Synchronizer(QCoreApplication *aApplication)
The contructor.
Definition: synchronizer.cpp:65
void storageReleased()
emitted by releaseStorages call
Definition: moc_synchronizer.cpp:413
Class for queuing sync sessions.
Definition: SyncQueue.h:37
void stop(unsigned int aAccountId)
Stops sync for all profiles matching the given account ID.
Definition: synchronizer.cpp:1725
virtual StoragePlugin * createStorage(const QString &aPluginName)
Definition: synchronizer.cpp:1110
virtual QString createSyncProfileForAccount(uint aAccountId)
Definition: synchronizer.cpp:343
Keeps track of which server plug-ins should be enabled.
Definition: ServerActivator.h:47
virtual bool setSyncSchedule(QString aProfileId, QString aScheduleAsXml)
Definition: synchronizer.cpp:319
virtual bool isConnectivityAvailable(Sync::ConnectivityType aType)
Definition: synchronizer.cpp:1156
void syncDone(const QString &aProfileName)
emit this signal when the sync session is completed, this is useful when the session status is not im...
Definition: moc_synchronizer.cpp:419
virtual bool requestStorage(const QString &aStorageName, const SyncPluginBase *aCaller)
Definition: synchronizer.cpp:1092
The main entry point to the synchronization framework.
Definition: synchronizer.h:64
Defines a D-Bus interface for the sync daemon.
Definition: msyncd/SyncDBusInterface.h:41
virtual ~Synchronizer()
Destructor.
Definition: synchronizer.cpp:81
Helper Class towards Accounts::Manager and various SSO related operations.
Definition: AccountsHelper.h:43
ProfileManager is responsible for storing and retrieving the profiles.
Definition: ProfileManager.h:45
virtual void releaseStorage(const QString &aStorageName, const SyncPluginBase *aCaller)
Definition: synchronizer.cpp:1101
virtual QString getLastSyncResult(const QString &aProfileId)
To get lastSyncResult.
Definition: synchronizer.cpp:1832
Class representing a single sync session.
Definition: SyncSession.h:43
virtual bool saveSyncResults(QString aProfileId, QString aSyncResults)
Definition: synchronizer.cpp:329
SyncScheduler Object to be used to set Schedule via the framework.
Definition: SyncScheduler.h:52
Interface which client and server plugins can use to communicate with synchronization daemon...
Definition: PluginCbInterface.h:38
virtual bool getBackUpRestoreState()
Called to get the current backup/restore state.
Definition: synchronizer.cpp:1707
Handles Sync requirements towards Backup.
Definition: SyncBackup.h:37
virtual QString syncProfile(const QString &aProfileId)
Gets a sync profile.
Definition: synchronizer.cpp:1879
virtual bool updateProfile(QString aProfileAsXml)
Definition: synchronizer.cpp:959
virtual void destroyStorage(StoragePlugin *aStorage)
Definition: synchronizer.cpp:1149
void backupFinished()
Called when backup is completed.
Definition: synchronizer.cpp:1686
Class for managing network sessions.
Definition: NetworkManager.h:43
void restoreStarts()
Called when starting to restore a backup.
Definition: synchronizer.cpp:1693
Base class for client and server plugins.
Definition: SyncPluginBase.h:45
A top level synchronization profile.
Definition: SyncProfile.h:47
bool initialize()
registers the dbus service and creates handlers for various tasks of the synchronizer ...
Definition: synchronizer.cpp:92
Class for tracking transport states.
Definition: TransportTracker.h:47
A helper class for managing storage reservations.
Definition: StorageBooker.h:36
Base class for storage plugins.
Definition: StoragePlugin.h:38
virtual bool removeProfile(QString aProfileAsXml)
Definition: synchronizer.cpp:938
bool startScheduledSync(QString aProfileName)
Called starts a schedule sync.
Definition: synchronizer.cpp:291
virtual void abortSync(QString aProfileName)
Definition: synchronizer.cpp:840
Definition: SyncBackupAdaptor.h:41
void backupStarts()
Called when backup starts.
Definition: synchronizer.cpp:1679
Definition: SyncBackupAdaptor.h:40
virtual QString getValue(const QString &aAddress, const QString &aKey)
Definition: synchronizer.cpp:2010