#include <BriefcaseCacheSyncSource.h>
Inheritance diagram for BriefcaseCacheSyncSource:
Public Member Functions | |
BriefcaseCacheSyncSource (const WCHAR *name, AbstractSyncSourceConfig *sc) | |
void | assign (BriefcaseCacheSyncSource &s) |
void | setDir (const char *p) |
set/get the directory where to sync the files | |
const StringBuffer & | getDir () |
int | saveFileData (FileData &file) |
Save the file inside the filesystem. | |
int | saveFileData (SyncItem &item, bool isUpdate) |
Save the file inside the filesystem. | |
int | parseFileData (FileData &file, SyncItem &item) |
Parse the file object Return 0 is success otherwise failure. | |
Enumeration * | getAllItemList () |
Get the list of all the keys stored in a StringBuffer. | |
int | removeAllItems () |
Removes all the item of the sync source. | |
int | insertItem (SyncItem &item) |
Called by the sync engine to add an item that the server has sent. | |
int | modifyItem (SyncItem &item) |
Called by the sync engine to update an item that the source already should have. | |
int | removeItem (SyncItem &item) |
Called by the sync engine to update an item that the source already should have. | |
void * | getItemContent (StringBuffer &key, size_t *size) |
Get the content of an item given the key. |
int BriefcaseCacheSyncSource::saveFileData | ( | FileData & | file | ) |
Save the file inside the filesystem.
Return 0 is success otherwise failure
int BriefcaseCacheSyncSource::saveFileData | ( | SyncItem & | item, | |
bool | isUpdate | |||
) |
Save the file inside the filesystem.
It doesn't use the FileData SyncMLobject but it uses only the data as inside
item | the item from which get the data | |
isUpdate | it says if the item must to be add (false) or updated (true) |
Enumeration* BriefcaseCacheSyncSource::getAllItemList | ( | ) | [virtual] |
Get the list of all the keys stored in a StringBuffer.
It reads all the files name in the directory. The directory is set in the sync source.
Implements CacheSyncSource.
int BriefcaseCacheSyncSource::removeAllItems | ( | ) | [virtual] |
Removes all the item of the sync source.
It is called by the engine in the case of a refresh from server to clean all the client items before receiving the server ones.
Implements SyncSource.
int BriefcaseCacheSyncSource::insertItem | ( | SyncItem & | item | ) | [virtual] |
Called by the sync engine to add an item that the server has sent.
The sync source is expected to add it to its database, then set the key to the local key assigned to the new item. Alternatively the sync source can match the new item against one of the existing items and return that key.
item | the item as sent by the server |
Implements CacheSyncSource.
int BriefcaseCacheSyncSource::modifyItem | ( | SyncItem & | item | ) | [virtual] |
Called by the sync engine to update an item that the source already should have.
The item's key is the local key of that item.
item | the item as sent by the server |
Implements CacheSyncSource.
int BriefcaseCacheSyncSource::removeItem | ( | SyncItem & | item | ) | [virtual] |
Called by the sync engine to update an item that the source already should have.
The item's key is the local key of that item, no data is provided.
item | the item as sent by the server |
Implements CacheSyncSource.
void* BriefcaseCacheSyncSource::getItemContent | ( | StringBuffer & | key, | |
size_t * | size | |||
) | [virtual] |
Get the content of an item given the key.
It is used to populate the SyncItem before the engine uses it in the usual flow of the sync. It is used also by the itemHandler if needed (i.e. in the cache implementation)
key | the local key of the item | |
size | OUT: the size of the content |
Implements CacheSyncSource.