SyncManager Class Reference
[Client]

This is the core class which encodes the flow of messages between client and server throughout a session. More...

#include <SyncManager.h>

Collaboration diagram for SyncManager:

Collaboration graph
[legend]
List of all members.

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
SyncManagerConfigconfig
SyncReportsyncReport
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 []

Detailed Description

This is the core class which encodes the flow of messages between client and server throughout a session.

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.


Constructor & Destructor Documentation

SyncManager::SyncManager ( SyncManagerConfig config,
SyncReport report 
)

Initialize a new sync manager.

Parameters provided to it have to remain valid while this sync manager exists.

Parameters:
config required configuration
report sync report reference to store sync results


Member Function Documentation

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.

Returns:
device infos, to be deleted by caller, or NULL if unavailable

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.


The documentation for this class was generated from the following file:
Generated on Fri Nov 9 12:21:34 2007 for Funambol Outlook Plug-in Library by  doxygen 1.5.2