DMTClientConfig Class Reference
[Client]

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...

#include <DMTClientConfig.h>

Inheritance diagram for DMTClientConfig:
[legend]
Collaboration diagram for DMTClientConfig:
[legend]

List of all members.

Public Member Functions

 DMTClientConfig (const char *root)
 Initialize a DMTClientConfig with the given application context.
 DMTClientConfig ()
 Initialize a DMTClientConfig.
SyncSourceConfiggetSyncSourceConfig (const char *name, bool refresh=false)
SyncSourceConfiggetSyncSourceConfig (unsigned int i, bool refresh=false)
virtual bool read ()
virtual bool save ()
virtual bool open ()
 Opens the configuration backend associated with the root context.
virtual ManagementNode * getSyncMLNode ()
 Provides access to the "syncml" configuration node, can be used to read/write custom configuration options.
virtual int getNumSources ()
 Gets number of sync source configurations, -1 if not open.
virtual ManagementNode * getSyncSourceNode (int index)
 Get the specified sync source configuration.
virtual ManagementNode * getSyncSourceNode (const char *name)
 Get the specified sync source configuration by name.
virtual void close ()
 Closes the configuration backend.

Protected Member Functions

void initialize ()
virtual bool readRootConfig ()
virtual void saveRootConfig ()
virtual bool readAccessConfig (ManagementNode &n)
virtual void saveAccessConfig (ManagementNode &n)
virtual bool readDeviceConfig (ManagementNode &n, bool server=false)
virtual void saveDeviceConfig (ManagementNode &n, bool server=false)
virtual bool readSourceConfig (int i, ManagementNode &n)
virtual void saveSourceConfig (int i, ManagementNode &n)
virtual bool readAuthConfig (ManagementNode &syncMLNode, ManagementNode &authNode)
 Called by readAccessConfig() to save authentication settings.
virtual void saveAuthConfig (ManagementNode &syncMLNode, ManagementNode &authNode)
 Same as readAccessConfig() for saving the settings.
virtual bool readConnConfig (ManagementNode &syncMLNode, ManagementNode &connNode)
 Same as readAccessConfig() for reading connection information.
virtual void saveConnConfig (ManagementNode &syncMLNode, ManagementNode &connNode)
 Same as readAccessConfig() for saving connection information.
virtual bool readExtAccessConfig (ManagementNode &syncMLNode, ManagementNode &extNode)
 Same as readAccessConfig() for reading additional access information.
virtual void saveExtAccessConfig (ManagementNode &syncMLNode, ManagementNode &extNode)
 Same as readAccessConfig() for saving additional access information.
virtual bool readDevInfoConfig (ManagementNode &syncMLNode, ManagementNode &devInfoNode, bool server=false)
 Same as readAccessConfig() for reading device information.
virtual void saveDevInfoConfig (ManagementNode &syncMLNode, ManagementNode &devInfoNode, bool server=false)
 Same as readAccessConfig() for saving device information.
virtual bool readDevDetailConfig (ManagementNode &syncMLNode, ManagementNode &devDetailNode, bool server=false)
 Same as readAccessConfig() for reading additional device information.
virtual void saveDevDetailConfig (ManagementNode &syncMLNode, ManagementNode &devDetailNode, bool server=false)
 Same as readAccessConfig() for saving additional device information.
virtual bool readExtDevConfig (ManagementNode &syncMLNode, ManagementNode &extNode, bool server=false)
 Same as readAccessConfig() for reading some more additional device information.
virtual void saveExtDevConfig (ManagementNode &syncMLNode, ManagementNode &extNode, bool server=false)
 Same as readAccessConfig() for saving some more additional device information.
virtual bool readSourceVars (int i, ManagementNode &sourcesNode, ManagementNode &sourceNode)
 Same as readAccessConfig() for reading variables that the library uses internally, like anchors.
virtual void saveSourceVars (int i, ManagementNode &sourcesNode, ManagementNode &sourceNode)
 Same as readAccessConfig() for saveing variables that the library uses internally, like anchors.
virtual bool readSourceConfig (int i, ManagementNode &sourcesNode, ManagementNode &sourceNode)
 Same as readAccessConfig() for reading the normal properties of a sync source, i.e.
virtual void saveSourceConfig (int i, ManagementNode &sourcesNode, ManagementNode &sourceNode)
 Same as readAccessConfig() for reading the normal properties of a sync source, i.e.
bool readDataStoresConfig (ManagementNode &dataStoresNode)
 Reads the dataStores tree and sets values in serverConfig::dataStores arrayList of DataStores.
DataStore * readDataStoreConfig (ManagementNode &dataStoreNode)
 Reads a single dataStore and returns a DataStore object populated.
void saveDataStoresConfig (ManagementNode &dataStoresNode)
 Saves the dataStores tree from serverConfig::dataStores arrayList into the passed config node.
void saveDataStoreConfig (ManagementNode &dataStoreNode, DataStore *dataStore)
 Saves a single dataStore into the passed config node.

Protected Attributes

char * rootContext
DMTree * dmt
ManagementNode * syncMLNode
ManagementNode * sourcesNode
ManagementNode * serverNode


Detailed Description

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.

Todo:
describe the properties of the DM tree and how they are grouped into device info, additional device info, extended device info, etc.

Constructor & Destructor Documentation

DMTClientConfig::DMTClientConfig ( const char *  root  ) 

Initialize a DMTClientConfig with the given application context.

It's deprecated, use PlatformAdapter::init(appContext) and DMTClientConfig() instead.

Parameters:
root the application context

DMTClientConfig::DMTClientConfig (  ) 

Initialize a DMTClientConfig.

You must call PlatformAdapter::init(appContext) before.


Member Function Documentation

virtual void DMTClientConfig::close (  )  [virtual]

Closes the configuration backend.

Frees all resources associated with and invalidates all ManagementNode pointers returned by this config.

virtual ManagementNode* DMTClientConfig::getSyncMLNode (  )  [virtual]

Provides access to the "syncml" configuration node, can be used to read/write custom configuration options.

Config must have been opened before.

Returns:
node pointer owned by config and valid while the config is open

virtual ManagementNode* DMTClientConfig::getSyncSourceNode ( int  index  )  [virtual]

Get the specified sync source configuration.

Parameters:
index number of the requested sync source configuration
Returns:
node pointer owned by config and valid while the config is open

virtual bool DMTClientConfig::open (  )  [virtual]

Opens the configuration backend associated with the root context.

Calling on an open config does nothing.

Returns:
true for success

Referenced by OutlookConfig::read(), OutlookConfig::readSourcesTimestamps(), OutlookConfig::readWinSourceConfig(), OutlookConfig::save(), OutlookConfig::saveSyncModes(), and OutlookConfig::saveWinSourceConfig().

virtual bool DMTClientConfig::readAuthConfig ( ManagementNode &  syncMLNode,
ManagementNode &  authNode 
) [protected, virtual]

Called by readAccessConfig() to save authentication settings.

The purpose of making this function virtual is that a derived class can override it and then to read the settings from a different than the default "spds/syncml/auth" node by calling the base function with a different authNode parameter or generate the settings in some other way.

Parameters:
syncMLNode the "spds/syncml" node
authNode the "spds/syncml/auth" node

virtual bool DMTClientConfig::readConnConfig ( ManagementNode &  syncMLNode,
ManagementNode &  connNode 
) [protected, virtual]

Same as readAccessConfig() for reading connection information.

Parameters:
syncMLNode the "spds/syncml" node
connNode the "spds/syncml/conn" node

DataStore* DMTClientConfig::readDataStoreConfig ( ManagementNode &  dataStoreNode  )  [protected]

Reads a single dataStore and returns a DataStore object populated.

Only for Server config.

Parameters:
dataStoreNode the "server/DataStores/<datastore-name>" node to read from
Returns:
a new allocated DataStore

bool DMTClientConfig::readDataStoresConfig ( ManagementNode &  dataStoresNode  )  [protected]

Reads the dataStores tree and sets values in serverConfig::dataStores arrayList of DataStores.

Only for Server config.

Parameters:
dataStoresNode the "server/DataStores" node to read from
Returns:
true if operation succeded

virtual bool DMTClientConfig::readDevDetailConfig ( ManagementNode &  syncMLNode,
ManagementNode &  devDetailNode,
bool  server = false 
) [protected, virtual]

Same as readAccessConfig() for reading additional device information.

Parameters:
syncMLNode the "spds/syncml" node
devDetailNode the "spds/syncml/devdetail" node

virtual bool DMTClientConfig::readDevInfoConfig ( ManagementNode &  syncMLNode,
ManagementNode &  devInfoNode,
bool  server = false 
) [protected, virtual]

Same as readAccessConfig() for reading device information.

Parameters:
syncMLNode the "spds/syncml" node
devInfoNode the "spds/syncml/devinfo" node

virtual bool DMTClientConfig::readExtAccessConfig ( ManagementNode &  syncMLNode,
ManagementNode &  extNode 
) [protected, virtual]

Same as readAccessConfig() for reading additional access information.

Parameters:
syncMLNode the "spds/syncml" node
extNode the "spds/syncml/ext" node

virtual bool DMTClientConfig::readExtDevConfig ( ManagementNode &  syncMLNode,
ManagementNode &  extNode,
bool  server = false 
) [protected, virtual]

Same as readAccessConfig() for reading some more additional device information.

Parameters:
syncMLNode the "spds/syncml" node
extNode the "spds/syncml/ext" node

virtual bool DMTClientConfig::readSourceConfig ( int  i,
ManagementNode &  sourcesNode,
ManagementNode &  sourceNode 
) [protected, virtual]

Same as readAccessConfig() for reading the normal properties of a sync source, i.e.

excluding variables like anchors.

Parameters:
i index of the source
sourcesNode the "spds/sources" node
sourceNode the "spds/sources/<source name>" node

virtual bool DMTClientConfig::readSourceVars ( int  i,
ManagementNode &  sourcesNode,
ManagementNode &  sourceNode 
) [protected, virtual]

Same as readAccessConfig() for reading variables that the library uses internally, like anchors.

Parameters:
i index of the source
sourcesNode the "spds/sources" node
sourceNode the "spds/sources/<source name>" node

Referenced by OutlookConfig::readSourcesTimestamps().

virtual void DMTClientConfig::saveAuthConfig ( ManagementNode &  syncMLNode,
ManagementNode &  authNode 
) [protected, virtual]

Same as readAccessConfig() for saving the settings.

Parameters:
syncMLNode the "spds/syncml" node
authNode the "spds/syncml/auth" node

virtual void DMTClientConfig::saveConnConfig ( ManagementNode &  syncMLNode,
ManagementNode &  connNode 
) [protected, virtual]

Same as readAccessConfig() for saving connection information.

Parameters:
syncMLNode the "spds/syncml" node
connNode the "spds/syncml/conn" node

void DMTClientConfig::saveDataStoreConfig ( ManagementNode &  dataStoreNode,
DataStore *  dataStore 
) [protected]

Saves a single dataStore into the passed config node.

Only for Server config.

Parameters:
dataStoreNode the "server/DataStores/<datastore-name>" node to write into
dataStore the DataStore object with params to read

void DMTClientConfig::saveDataStoresConfig ( ManagementNode &  dataStoresNode  )  [protected]

Saves the dataStores tree from serverConfig::dataStores arrayList into the passed config node.

Only for Server config. Cleans up the existing nodes, then calls saveDataStoreConfig() for each datastore in the array.

Parameters:
dataStoresNode the "server/DataStores" node to write into

virtual void DMTClientConfig::saveDevDetailConfig ( ManagementNode &  syncMLNode,
ManagementNode &  devDetailNode,
bool  server = false 
) [protected, virtual]

Same as readAccessConfig() for saving additional device information.

Parameters:
syncMLNode the "spds/syncml" node
devDetailNode the "spds/syncml/devdetail" node

virtual void DMTClientConfig::saveDevInfoConfig ( ManagementNode &  syncMLNode,
ManagementNode &  devInfoNode,
bool  server = false 
) [protected, virtual]

Same as readAccessConfig() for saving device information.

Parameters:
syncMLNode the "spds/syncml" node
devInfoNode the "spds/syncml/devinfo" node

virtual void DMTClientConfig::saveExtAccessConfig ( ManagementNode &  syncMLNode,
ManagementNode &  extNode 
) [protected, virtual]

Same as readAccessConfig() for saving additional access information.

Parameters:
syncMLNode the "spds/syncml" node
extNode the "spds/syncml/ext" node

virtual void DMTClientConfig::saveExtDevConfig ( ManagementNode &  syncMLNode,
ManagementNode &  extNode,
bool  server = false 
) [protected, virtual]

Same as readAccessConfig() for saving some more additional device information.

Parameters:
syncMLNode the "spds/syncml" node
extNode the "spds/syncml/ext" node

virtual void DMTClientConfig::saveSourceConfig ( int  i,
ManagementNode &  sourcesNode,
ManagementNode &  sourceNode 
) [protected, virtual]

Same as readAccessConfig() for reading the normal properties of a sync source, i.e.

excluding variables like anchors.

Parameters:
i index of the source
sourcesNode the "spds/sources" node
sourceNode the "spds/sources/<source name>" node

virtual void DMTClientConfig::saveSourceVars ( int  i,
ManagementNode &  sourcesNode,
ManagementNode &  sourceNode 
) [protected, virtual]

Same as readAccessConfig() for saveing variables that the library uses internally, like anchors.

Parameters:
i index of the source
sourcesNode the "spds/sources" node
sourceNode the "spds/sources/<source name>" node


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

Generated on Tue Apr 6 13:00:42 2010 for Funambol Outlook Plug-in Library by  doxygen 1.5.7.1