10 #ifndef TWO_WAY_SYNC_HPP
11 #define TWO_WAY_SYNC_HPP
101 void getStats(
unsigned int& locallyAdded,
102 unsigned int& locallyModified,
103 unsigned int& locallyRemoved,
104 unsigned int& remotelyAdded,
105 unsigned int& remotelyModified,
106 unsigned int& remotelyRemoved);
119 void buildLocalIndexDB();
120 void cleanLocalIndexDB();
126 bool checkRemoteChanges();
127 bool checkLocalChanges();
129 void firstTimeSync();
134 void removeLocalItem(
const std::string&
id);
138 void removeRemoteItem(
const std::string&
id);
140 bool flushLocalInsertions();
141 bool flushLocalModifications();
142 bool flushLocalRemovals();
144 bool flushRemoteInsertions();
145 bool flushRemoteModifications();
146 bool flushRemoteRemovals();
148 enum eSync doSynchronize();
149 static void* threadSync(
void*);
158 remotelyModified = 0;
161 unsigned int locallyAdded;
162 unsigned int locallyModified;
163 unsigned int locallyRemoved;
165 unsigned int remotelyAdded;
166 unsigned int remotelyModified;
167 unsigned int remotelyRemoved;
169 pthread_mutex_t mutex;
173 SyncStats globalStats;
181 typedef std::vector< OpenAB::SmartPtr<OpenAB_Storage::StorageItem> > vectorElem;
182 typedef std::map< OpenAB::SmartPtr<OpenAB::PIMItemIndex> , vectorElem > dbIndexElem;
199 std::vector<ItemDesc> localItemsToBeAdded;
200 std::vector<ItemDesc> localItemsToBeModified;
201 std::vector<std::string> localItemsToBeRemoved;
203 std::vector<ItemDesc> remoteItemsToBeAdded;
204 std::vector<ItemDesc> remoteItemsToBeModified;
205 std::vector<std::string> remoteItemsToBeRemoved;
207 std::vector<OpenAB::SmartPtr<OpenAB::PIMItem> > localyAddedItems;
208 std::map<std::string, OpenAB::SmartPtr<OpenAB::PIMItem> > localyModifiedItems;
210 std::vector<OpenAB::SmartPtr<OpenAB::PIMItem> > remotelyAddedItems;
211 std::map<std::string, OpenAB::SmartPtr<OpenAB::PIMItem> > remotelyModifiedItems;
216 pthread_t syncThread;
217 pthread_mutex_t syncMutex;
220 eSync lastSyncResult;
eInit
Definition: Sync.hpp:142
Definition: OneWaySync.hpp:114
std::string local_plugin
The name of the Input plugin.
Definition: TwoWaySync.hpp:62
Definition: OneWaySync.hpp:112
enum OpenAB_Sync::Sync::eSuspend suspend()
Suspends synchronization (if used OpenAB_Source::Source plugin supports it)
Definition: TwoWaySync.cpp:178
OpenAB_Source::Parameters remote_input_params
The parameters required by the Input plugin used.
Definition: TwoWaySync.hpp:67
float sync_progress_time
Definition: OneWaySync.hpp:116
OpenAB_Storage::Parameters local_storage_params
The parameters required by the Input plugin used.
Definition: TwoWaySync.hpp:64
std::string metadata
Definition: TwoWaySync.hpp:79
enum OpenAB_Sync_params::SyncType sync_type
enum OpenAB_Sync::Sync::eCancel cancel()
Cancels synchronization.
Definition: TwoWaySync.cpp:158
SyncType
Definition: OneWaySync.hpp:110
enum OpenAB_Sync::Sync::eResume resume()
Resumes synchronization (if used OpenAB_Source::Source plugin supports it)
Definition: TwoWaySync.cpp:198
Documentation for Storage plugin interface. Generic interface is modeled over Sync Plugin specific re...
Definition: Storage.hpp:106
eCancel
Definition: Sync.hpp:172
unsigned int batch_size
Definition: OneWaySync.hpp:117
void getStats(unsigned int &locallyAdded, unsigned int &locallyModified, unsigned int &locallyRemoved, unsigned int &remotelyAdded, unsigned int &remotelyModified, unsigned int &remotelyRemoved)
Returns statistics of synchronization.
Definition: TwoWaySync.cpp:218
~TwoWaySync()
Definition: TwoWaySync.cpp:56
Set of parameters required to perform the synchronization.
Definition: OneWaySync.hpp:103
eResume
Definition: Sync.hpp:202
TwoWaySync(OpenAB_Sync_params &)
Definition: TwoWaySync.cpp:39
Virtual class that provide all the callback routines to control the synchronization.
Definition: Sync.hpp:249
OpenAB_Sync::Sync::SyncCallback * cb
The Callback object.
Definition: OneWaySync.hpp:109
enum OpenAB_Sync::Sync::eInit init()
Initializes Sync.
Definition: TwoWaySync.cpp:82
OpenAB_Source::Parameters local_input_params
The parameters required by the Input plugin used.
Definition: TwoWaySync.hpp:63
OpenAB_Storage::Parameters remote_storage_params
The parameters required by the Input plugin used.
Definition: TwoWaySync.hpp:68
Definition: OneWaySync.hpp:113
Documentation for class Sync plugin interface.
Definition: Sync.hpp:126
eSuspend
Definition: Sync.hpp:187
std::string remote_plugin
The name of the AB (Address Book) plugin.
Definition: TwoWaySync.hpp:66
void synchronize()
Synchronizes data.
Definition: TwoWaySync.cpp:125
Generic storage for plugin parameters. Allows to store map of parameters with different types (OpenAB...
Definition: GenericParameters.hpp:25
eSync
Definition: Sync.hpp:156
Sync Class providing all the Sync controls.
Definition: TwoWaySync.hpp:85