OpenAB  1.0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
OpenAB_Sync::Sync Class Referenceabstract

Documentation for class Sync plugin interface. More...

#include <Sync.hpp>

Inheritance diagram for OpenAB_Sync::Sync:
Collaboration diagram for OpenAB_Sync::Sync:

Classes

struct  Phase
 
class  SyncCallback
 Virtual class that provide all the callback routines to control the synchronization. More...
 

Public Types

enum  eInit { eInitOk, eInitFail }
 
enum  eSync {
  eSyncOkWithDataChange, eSyncOkWithoutDataChange, eSyncCancelled, eSyncAlreadyInProgress,
  eSyncFail
}
 
enum  eCancel { eCancelOk, eCancelNotInProgress, eCancelFail }
 
enum  eSuspend { eSuspendOk, eSuspendNotInProgress, eSuspendFail }
 
enum  eResume { eResumeOk, eResumeNotSuspended, eResumeFail }
 

Public Member Functions

 Sync ()
 Constructor. More...
 
virtual ~Sync ()
 Destructor, virtual by default. More...
 
virtual enum eInit init ()=0
 Initializes Sync. More...
 
virtual void synchronize ()=0
 Synchronizes data. More...
 
virtual enum eCancel cancel ()=0
 Cancels synchronization. More...
 
virtual enum eSuspend suspend ()=0
 Suspends synchronization (if used OpenAB_Source::Source plugin supports it) More...
 
virtual enum eResume resume ()=0
 Resumes synchronization (if used OpenAB_Source::Source plugin supports it) More...
 
virtual void getStats (unsigned int &locallyAdded, unsigned int &locallyModified, unsigned int &locallyRemoved, unsigned int &remotelyAdded, unsigned int &remotelyModified, unsigned int &remotelyRemoved)=0
 Returns statistics of synchronization. More...
 
bool addPhase (const std::string &name, const std::vector< std::string > &ignoreFields)
 Adds new phase to synchronization process. More...
 
void clearPhases ()
 Removes all previously defined synchronization phases. More...
 

Protected Attributes

std::vector< Phasephases
 

Detailed Description

Documentation for class Sync plugin interface.

Member Enumeration Documentation

Enumerator
eCancelOk 
eCancelNotInProgress 
eCancelFail 
Enumerator
eInitOk 

Sync successfully initialized

eInitFail 

Failure during the Sync initialization

Enumerator
eResumeOk 
eResumeNotSuspended 
eResumeFail 
Enumerator
eSuspendOk 
eSuspendNotInProgress 
eSuspendFail 
Enumerator
eSyncOkWithDataChange 

Synchronization finished successfully with data change in OpenAB_Storage::Storage

eSyncOkWithoutDataChange 

Synchronization finished successfully without any data change in OpenAB_Storage::Storage

eSyncCancelled 

Synchronization was cancelled

eSyncAlreadyInProgress 

Synchronization is already in progress

eSyncFail 

Synchronization failed

Constructor & Destructor Documentation

OpenAB_Sync::Sync::Sync ( )
inline

Constructor.

virtual OpenAB_Sync::Sync::~Sync ( )
inlinevirtual

Destructor, virtual by default.

Member Function Documentation

bool OpenAB_Sync::Sync::addPhase ( const std::string &  name,
const std::vector< std::string > &  ignoreFields 
)

Adds new phase to synchronization process.

Parameters
[in]namename of phase
[in]ignoreFieldsvector of OpenAB::PIMItem fields that should be ignored by OpenAB_Source::Source plugin.
Note
Purpose of phases is to allow more efficient synchronization.
Each phase can ignore some OpenAB::PIMItem fields provided by OpenAB_Source::Source plugin (if it supports ignore feature).
As an example during contacts synchronization one phase can download only textual information and second one also photo data.
Returns
true if phase was added successfully, false if phase with the same name already exists.
virtual enum eCancel OpenAB_Sync::Sync::cancel ( )
pure virtual

Cancels synchronization.

Returns
the status code

Implemented in OneWaySync, and TwoWaySync.

void OpenAB_Sync::Sync::clearPhases ( )

Removes all previously defined synchronization phases.

virtual void OpenAB_Sync::Sync::getStats ( unsigned int &  locallyAdded,
unsigned int &  locallyModified,
unsigned int &  locallyRemoved,
unsigned int &  remotelyAdded,
unsigned int &  remotelyModified,
unsigned int &  remotelyRemoved 
)
pure virtual

Returns statistics of synchronization.

Parameters
[out]locallyAddednumber of items added during synchronization in local storage
[out]locallyModifiednumber of items modified during synchronization in local storage
[out]locallyRemovednumber of items removed during synchronization from local storage
[out]remotelyAddednumber of items added during synchronization in remote storage
[out]remotelyModifiednumber of items modified during synchronization in remote storage
[out]remotyleRemovednumber of items removed during synchronization from remote storage

Implemented in OneWaySync, and TwoWaySync.

virtual enum eInit OpenAB_Sync::Sync::init ( )
pure virtual

Initializes Sync.

Returns
the status code

Implemented in OneWaySync, and TwoWaySync.

virtual enum eResume OpenAB_Sync::Sync::resume ( )
pure virtual

Resumes synchronization (if used OpenAB_Source::Source plugin supports it)

Returns
the status code

Implemented in OneWaySync, and TwoWaySync.

virtual enum eSuspend OpenAB_Sync::Sync::suspend ( )
pure virtual

Suspends synchronization (if used OpenAB_Source::Source plugin supports it)

Returns
the status code

Implemented in OneWaySync, and TwoWaySync.

virtual void OpenAB_Sync::Sync::synchronize ( )
pure virtual

Synchronizes data.

Implemented in OneWaySync, and TwoWaySync.

Member Data Documentation

std::vector<Phase> OpenAB_Sync::Sync::phases
protected

The documentation for this class was generated from the following files: