Sync Client

The "common/client" directory contains classes related to writing sync clients and some specific client implementations. More...

Classes

class  ArrayListKeyValueStore
 This is the interface for the handling of the key/value that has to be written in the storage. More...
class  KeyValueStore
 This is the interface for the handling of key/value pairs. More...
class  PropertyFile
 This is the implementation of the keyValueStore on filesystem. More...
class  CacheSyncSource
 This is an extension of the basic SyncSource that a SyncML client developer could implement to let the sync engine access the client's data. More...
class  DMTClientConfig
 This class is an extension of SyncManagerConfig that is DM tree aware; this means that configuration properties are read/stored from/to the DM tree. More...
class  FileSyncSource
 Synchronizes the content of files in a certain directory and the file attributes using a certain XML format. More...
class  ODBCKeyValueStore
class  RawFileSyncSource
 In contrast to the FileSyncSource this class does not wrap the file content and attributes in an XML format when exchanging it with the server. More...
class  SQLiteKeyValueStore
class  SQLKeyValueStore
 This abstract class represent an implementation of KeyValueStore based on a generic SQL database. More...
class  SyncClient
 This class wraps the common operations executed by a typical client. More...
class  BriefcaseCacheSyncSource
 Synchronizes the content of files in a certain directory and handles the modification and cache or listener structure. More...
class  AbstractSyncConfig
 This class provides access to all attributes of the client and its sources which the sync engine needs to read and (in a few cases) also write. More...
class  AbstractSyncSourceConfig
 This class is the API expected by SyncClient/SyncManager for each sync source. More...
class  SyncManager
 This is the core class which encodes the flow of messages between client and server throughout a session. More...
class  SyncManagerConfig
 This implementation is just a transient configuration information repository; persisting configuration settings is delegated to subclasses. More...
class  SyncReport
 The SyncReport class is used to summarize all results of a single synchronization. More...
class  SyncSource
 This is the main API that a SyncML client developer needs to implement to let the sync engine access the client's data. More...
class  SyncSourceConfig
 This class is one possible implementation of the AbstractSyncSourceConfig API: it implements all attributes as read/write members. More...
class  SyncSourceReport
 SyncSourceReport class rapresents the report of each SyncSource synchronized. More...
class  CheckSyncReport
 This class encapsulates logging and checking of a SyncReport. More...
class  ClientTest
 This is the interface expected by the testing framework for sync clients. More...
class  CreateSource
 helper class to encapsulate ClientTest::Config::createsource_t pointer and the corresponding parameters More...
class  LocalTests
 local test of one sync source and utility functions also used by sync tests More...
class  SyncTests
 Tests synchronization with one or more sync sources enabled. More...

Defines

#define CACHE_FILE_NAME   "cache_items.dat"
#define APPLICATION_URI   "Funambol/SyncclientFILE"
#define LOG_TITLE   "Funambol FILEClient Log"
#define LOG_PATH   "."
#define LOG_LEVEL   LOG_LEVEL_DEBUG
#define SOURCE_NAME   "briefcase"
#define WSOURCE_NAME   TEXT("briefcase")
#define DEVICE_ID   "Funambol FILEClient"
#define SW_VERSION   "1.0"
#define ERR_FILE_SYSTEM   1
#define ERR_NO_FILES_TO_SYNC   2
#define ERR_BAD_FILE_CONTENT   3
#define DEFAULT_BRIEFCASE_DIR   "."
#define DATA_SIZE_TOLERANCE   1.06
#define CLIENT   "Client"
#define SERVER   "Server"
#define CLIENT_TEST_EQUAL(_prefix, _expected, _actual)
 assert equality, include string in message if unequal
#define SOURCE_ASSERT_NO_FAILURE(_source, _x)
 execute _x and then check the status of the _source pointer
#define SOURCE_ASSERT(_source, _x)
 check _x for true and then the status of the _source pointer
#define SOURCE_ASSERT_EQUAL(_source, _value, _x)
 check that _x evaluates to a specific value and then the status of the _source pointer
#define SOURCE_ASSERT_MESSAGE(_message, _source, _x)
 same as SOURCE_ASSERT() with a specific failure message
#define ADD_TEST(_class, _function)   addTest(new CppUnit::TestCaller<_class>(getName() + "::" #_function, &_class::_function, *this))
 convenience macro for adding a test name like a function, to be used inside addTests() of an instance of that class

Typedefs

typedef std::list< std::string > UIDList

Enumerations

enum  SyncManagerState {
  STATE_START = 0, STATE_PKG1_SENDING = 1, STATE_PKG1_SENT = 2, STATE_PKG3_SENDING = 3,
  STATE_PKG3_SENT = 4, STATE_PKG5_SENDING = 5, STATE_PKG5_SENT = 6
}
enum  SourceState { SOURCE_ACTIVE = 0, SOURCE_INACTIVE = 1, SOURCE_ERROR = 2 }
 Possible states of syncsource (state member). More...
enum  itemType { NEW_ITEMS, UPDATED_ITEMS, DELETED_ITEMS, TOTAL_ITEMS }

Functions

void createConfig (DMTClientConfig &config)
int countItemsOfType (SyncSource *source, itemType type)
 utility function which counts items of a certain kind known to the sync source
UIDList listItemsOfType (SyncSource *source, itemType type)
 generates list of UIDs in the specified kind of items

Detailed Description

The "common/client" directory contains classes related to writing sync clients and some specific client implementations.

Using these classes is optional. Alternatively one can use the sync engine directly via the SyncManager, but beware that this is more complex.


Define Documentation

#define ADD_TEST ( _class,
_function   )     addTest(new CppUnit::TestCaller<_class>(getName() + "::" #_function, &_class::_function, *this))

convenience macro for adding a test name like a function, to be used inside addTests() of an instance of that class

Parameters:
_class class which contains the function
_function a function without parameters in that class

#define CLIENT_TEST_EQUAL ( _prefix,
_expected,
_actual   ) 

Value:

CPPUNIT_ASSERT_EQUAL_MESSAGE( std::string(_prefix) + ": " + #_expected + " == " + #_actual, \
                                  _expected, \
                                  _actual )
assert equality, include string in message if unequal

#define SOURCE_ASSERT ( _source,
_x   ) 

Value:

{ \
    CPPUNIT_ASSERT(_x); \
    CPPUNIT_ASSERT((_source) && (!(_source)->getReport() || (_source)->getReport()->getState() != SOURCE_ERROR)); \
}
check _x for true and then the status of the _source pointer

#define SOURCE_ASSERT_EQUAL ( _source,
_value,
_x   ) 

Value:

{ \
    CPPUNIT_ASSERT_EQUAL(_value, _x); \
    CPPUNIT_ASSERT((_source) && (!(_source)->getReport() || (_source)->getReport()->getState() != SOURCE_ERROR)); \
}
check that _x evaluates to a specific value and then the status of the _source pointer

#define SOURCE_ASSERT_MESSAGE ( _message,
_source,
_x   ) 

Value:

{ \
    CPPUNIT_ASSERT_MESSAGE((_message), (_x)); \
    CPPUNIT_ASSERT((_source) && (!(_source)->getReport() || (_source)->getReport()->getState() != SOURCE_ERROR)); \
}
same as SOURCE_ASSERT() with a specific failure message

#define SOURCE_ASSERT_NO_FAILURE ( _source,
_x   ) 

Value:

{ \
    CPPUNIT_ASSERT_NO_THROW(_x); \
    CPPUNIT_ASSERT((_source) && (!(_source)->getReport() || (_source)->getReport()->getState() != SOURCE_ERROR)); \
}
execute _x and then check the status of the _source pointer


Enumeration Type Documentation

enum SourceState

Possible states of syncsource (state member).

Enumerator:
SOURCE_ACTIVE  source is part of the current sync and in a sane state
SOURCE_INACTIVE  source was excluded from the current sync before starting it
SOURCE_ERROR  source encountered and error sometime during the sync


Function Documentation

int countItemsOfType ( SyncSource source,
itemType  type 
)

utility function which counts items of a certain kind known to the sync source

Parameters:
source valid source ready to iterate; NULL triggers an assert
itemType determines which iterator functions are used
Returns:
number of valid items iterated over


Generated on Tue Jun 10 17:20:22 2008 for Funambol C++ Client Library by  doxygen 1.5.2