SyncSourceConfig Class Reference
[Client]

This class is one possible implementation of the AbstractSyncSourceConfig API: it implements all attributes as read/write members. More...

#include <SyncSourceConfig.h>

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

List of all members.

Public Member Functions

 SyncSourceConfig ()
 Constructs a new SyncSourceConfig object.
 ~SyncSourceConfig ()
 Destructor.
const char * getName () const
 Returns the SyncSource name.
void setName (const char *n)
 Sets the SyncSource name.
const char * getURI () const
 Returns the SyncSource URI (used in SyncML addressing).
void setURI (const char *u)
 Sets the SyncSource URI (used in SyncML addressing).
const char * getSyncModes () const
 Returns a comma separated list of the possible syncModes for the SyncSource.
void setSyncModes (const char *s)
 Sets the available syncModes for the SyncSource as comma separated values.
const char * getType () const
 Returns the mime type of the items handled by the sync source.
void setType (const char *t)
 Sets the mime type of the items handled by the sync source.
const char * getSync () const
 Gets the default syncMode as one of the strings listed in setSyncModes.
void setSync (const char *s)
 Returns the default syncMode as one of the strings above.
const char * getEncoding () const
 Specifies how the content of an outgoing item should be encoded by the client library if the sync source does not set an encoding on the item that it created.
void setEncoding (const char *s)
const char * getVersion () const
 Returns the version of the source type used by client.
void setVersion (const char *n)
 Sets the SyncSource version.
const char * getSupportedTypes () const
 A string representing the source types (with versions) supported by the SyncSource.
void setSupportedTypes (const char *s)
 Sets the supported source types for this source.
const bool isEnabled () const
 Checks if the source is enabled.
void setIsEnabled (const bool s)
 Sets the flag 'enabled' for this source.
const int getLastSourceError () const
 Returns the sync source's error code on the last sync.
void setLastSourceError (const int errorCode)
 Sets the sync source's last error code.
void setLast (unsigned long timestamp)
 Sets the last sync timestamp.
unsigned long getLast () const
 Returns the last sync timestamp.
const char * getEncryption () const
 Specifies if the content of an outgoing item should be encrypted.
void setEncryption (const char *n)
 Sets the encryption type.
const ArrayList & getCtCaps () const
 Sets the list of properties to use in the CTCap sent to the server in the DevInfo.
ArrayList & getCtCaps ()
void addCtCap (ArrayList *props, const char *ct_Type=0, const char *ver_CT=0, int fLevel=FLEVEL_UNDEFINED)
 add a CTCap to the ArrayList.
void assign (const SyncSourceConfig &sc)
 Initialize this object with the given SyncSourceConfig.
bool getFieldLevel ()
 Return fieldLevel param.
SyncSourceConfigoperator= (const SyncSourceConfig &sc)
 Assign operator.

Protected Member Functions

CTCap * createCtCap (ArrayList *props, const char *ct_Type, const char *ver_CT, bool fLevel)
 Create a new CTCap object, based on the current source configuration.

Protected Attributes

char * name
char * uri
char * syncModes
char * type
char * sync
char * encodings
char * version
char * supportedTypes
char * encryption
unsigned long last
bool fieldLevel
ArrayList ctCaps
bool enabled
 If false, the source exists but is disabled.
int lastSourceError
 The last error code, for this source (0 means "last sync successfull").


Detailed Description

This class is one possible implementation of the AbstractSyncSourceConfig API: it implements all attributes as read/write members.

Member Function Documentation

void SyncSourceConfig::addCtCap ( ArrayList *  props,
const char *  ct_Type = 0,
const char *  ver_CT = 0,
int  fLevel = FLEVEL_UNDEFINED 
)

add a CTCap to the ArrayList.

If ctType, verCT and FieldLevel are null we set a CTCap with the default verCT, fieldLevel and ctType taken from the config

the fieldLevel param has three status FLEVEL_DISABLED - to disable the FieldLevel param in the CtCap FLEVEL_ENABLED - to enable the FieldLevel param in the CtCap FLEVEL_UNDEFINED - not set. In this case the code sets the param to the value in the config. Now setted to disable the FieldLevel param

Parameters:
ArrayList* props - the arrayList with the properties
const char* ct_Type - optional
const char* ver_CT - optional
int fieldLevel - three different status

void SyncSourceConfig::assign ( const SyncSourceConfig sc  ) 

Initialize this object with the given SyncSourceConfig.

Parameters:
sc the source config object

Referenced by operator=().

CTCap* SyncSourceConfig::createCtCap ( ArrayList *  props,
const char *  ct_Type,
const char *  ver_CT,
bool  fLevel 
) [protected]

Create a new CTCap object, based on the current source configuration.

To obtain a complete CTCap, the client must have set previously the list of CTCap properties with the method setCtCapProperties().

const ArrayList& SyncSourceConfig::getCtCaps (  )  const [inline, virtual]

Sets the list of properties to use in the CTCap sent to the server in the DevInfo.

Parameters:
props an ArrayList of Property Returns the list of properties to use in the CTCap sent to the server in the DevInfo.
Returns:
an ArrayList of Property Returns an array of CtCap with all the capabilities for this Source

an ArrayList of CTCap

Implements AbstractSyncSourceConfig.

const char* SyncSourceConfig::getEncoding (  )  const [virtual]

Specifies how the content of an outgoing item should be encoded by the client library if the sync source does not set an encoding on the item that it created.

Valid values are listed in SyncItem::encodings.

Implements AbstractSyncSourceConfig.

const char* SyncSourceConfig::getEncryption (  )  const [virtual]

Specifies if the content of an outgoing item should be encrypted.

If this property is not empty and valid, the 'encodings' value is ignored for outgoing items. The only valid value is "des".

Implements AbstractSyncSourceConfig.

bool SyncSourceConfig::getFieldLevel (  )  [inline]

Return fieldLevel param.

Not implemented yet. Now just returns false

Returns:
bool fieldLevel

const char* SyncSourceConfig::getSupportedTypes (  )  const [virtual]

A string representing the source types (with versions) supported by the SyncSource.

The string must be formatted as a sequence of "type:version" separated by commas ','. For example: "text/x-vcard:2.1,text/vcard:3.0". The version can be left empty, for example: "text/x-s4j-sifc:". Supported types will be sent as part of the DevInf.

Implements AbstractSyncSourceConfig.

const char* SyncSourceConfig::getSyncModes (  )  const [virtual]

Returns a comma separated list of the possible syncModes for the SyncSource.

Sync modes can be one of

  • slow
  • two-way
  • one-way-from-server
  • one-way-from-client
  • refresh-from-server
  • refresh-from-client
  • one-way-from-server
  • one-way-from-client
  • addrchange
  • smart-one-way-from-client
  • smart-one-way-from-server
  • incremental-smart-one-way-from-client
  • incremental-smart-one-way-from-server

Implements AbstractSyncSourceConfig.

const bool SyncSourceConfig::isEnabled (  )  const

Checks if the source is enabled.

Returns:
true if the source is enabled

void SyncSourceConfig::setEncryption ( const char *  n  ) 

Sets the encryption type.

Parameters:
n the encryption type

Referenced by DefaultWinConfigFactory::getSyncSourceConfig().

void SyncSourceConfig::setIsEnabled ( const bool  s  ) 

Sets the flag 'enabled' for this source.

Parameters:
s true to enable this source, false to disable it

Referenced by DefaultWinConfigFactory::getSyncSourceConfig(), and SyncManagerTest::testLargeObject2().

void SyncSourceConfig::setLast ( unsigned long  timestamp  )  [virtual]

Sets the last sync timestamp.

Parameters:
timestamp the last sync timestamp

Implements AbstractSyncSourceConfig.

Referenced by DefaultWinConfigFactory::getSyncSourceConfig().

void SyncSourceConfig::setName ( const char *  n  ) 

Sets the SyncSource name.

Parameters:
n the new name

Referenced by DefaultWinConfigFactory::getSyncSourceConfig().

void SyncSourceConfig::setSupportedTypes ( const char *  s  ) 

Sets the supported source types for this source.

Parameters:
s the supported types string

Referenced by DefaultWinConfigFactory::getSyncSourceConfig().

void SyncSourceConfig::setSyncModes ( const char *  s  ) 

Sets the available syncModes for the SyncSource as comma separated values.

Parameters:
s the new list

Referenced by DefaultWinConfigFactory::getSyncSourceConfig().

void SyncSourceConfig::setType ( const char *  t  ) 

Sets the mime type of the items handled by the sync source.

Parameters:
t the mime type

Referenced by DefaultWinConfigFactory::getSyncSourceConfig(), and TestFileSource::TestFileSource().

void SyncSourceConfig::setURI ( const char *  u  ) 

Sets the SyncSource URI (used in SyncML addressing).

Parameters:
u the new uri

Referenced by DefaultWinConfigFactory::getSyncSourceConfig(), and TestFileSource::TestFileSource().

void SyncSourceConfig::setVersion ( const char *  n  ) 

Sets the SyncSource version.

Parameters:
n the new version

Referenced by DefaultWinConfigFactory::getSyncSourceConfig().


Member Data Documentation

bool SyncSourceConfig::enabled [protected]

If false, the source exists but is disabled.

Usually a source can be disabled by the user from Client's UI, to avoid syncing it. By default it's true.

The last error code, for this source (0 means "last sync successfull").

If using the SyncClient object to trigger the sync, the last sync result code of the corresponding source is set at the end of the sync. This way the information will be available even after the sync ended.


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

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