#include <SyncManager.h>
Collaboration diagram for SyncManager:
Public Member Functions | |
SyncManager (SyncManagerConfig &config, SyncReport &report) | |
Initialize a new sync manager. | |
int | prepareSync (SyncSource **sources) |
int | sync () |
int | endSync () |
virtual DevInf * | createDeviceInfo () |
Gathers the various bits and pieces known about the client and its sources and builds a SyncML devinfo 1.1 instance. | |
Private Member Functions | |
void | encodeItemKey (SyncItem *syncItem) |
void | decodeItemKey (SyncItem *syncItem) |
void | initialize () |
BOOL | readSyncSourceDefinition (SyncSource &source) |
BOOL | commitChanges (SyncSource &source) |
int | assignSources (SyncSource **sources) |
Status * | processSyncItem (Item *item, const CommandInfo &cmdInfo, SyncMLBuilder &syncMLBuilder) |
BOOL | checkForServerChanges (SyncML *syncml, ArrayList &statusList) |
const char * | getUserAgent (SyncManagerConfig &config) |
bool | isToExit () |
void | setSourceStateAndError (unsigned int index, SourceState state, unsigned int code, const char *msg) |
long | getToleranceDataSize (long size) |
bool | testIfDataSizeMismatch (long allocatedSize, long receivedSize) |
SyncItem * | getItem (SyncSource &source, SyncItem *(SyncSource::*getItem)()) |
A wrapper around the sync source's first/next iterator functions. | |
Private Attributes | |
DevInf * | devInf |
SyncManagerConfig & | config |
SyncReport & | syncReport |
CredentialHandler | credentialHandler |
SyncMLBuilder | syncMLBuilder |
SyncMLProcessor | syncMLProcessor |
TransportAgent * | transportAgent |
SyncManagerState | currentState |
SyncSource ** | sources |
ArrayList * | commands |
ArrayList ** | mappings |
int | sourcesNumber |
int | count |
char ** | sortedSourcesFromServer |
ArrayList ** | allItemsList |
StringBuffer | syncURL |
StringBuffer | deviceId |
int | responseTimeout |
int | maxMsgSize |
int | maxObjSize |
BOOL | loSupport |
unsigned int | readBufferSize |
char | credentialInfo [1024] |
SyncManager::IncomingSyncItem * | incomingItem |
Static Private Attributes | |
static const char | encodedKeyPrefix [] |
It is configured via the DMTClientConfig with which it is constructed by the SyncClient::setDMConfig() and the (optional) DevInf provided to it by the client.
SyncManager::SyncManager | ( | SyncManagerConfig & | config, | |
SyncReport & | report | |||
) |
Initialize a new sync manager.
Parameters provided to it have to remain valid while this sync manager exists.
config | required configuration | |
report | sync report reference to store sync results |
virtual DevInf* SyncManager::createDeviceInfo | ( | ) | [virtual] |
Gathers the various bits and pieces known about the client and its sources and builds a SyncML devinfo 1.1 instance.
For simplicity reasons this function is called for the currently active sync sources, changing them between runs thus causes a (valid!) retransmission of the device info.
SyncItem* SyncManager::getItem | ( | SyncSource & | source, | |
SyncItem *(SyncSource::*)() | getItem | |||
) | [private] |
A wrapper around the sync source's first/next iterator functions.
By default the data is encoded according to the "encoding" SyncSourceConfig property, unless the SyncSource already set an encoding.
In case of an error the error is logged and the item is set to NULL, just as if the source itself had returned NULL.