SyncSourceReport Class Reference
[Client]

SyncSourceReport class rapresents the report of each SyncSource synchronized. More...

#include <SyncSourceReport.h>

List of all members.

Public Member Functions

 SyncSourceReport (const char *name=NULL)
 SyncSourceReport (SyncSourceReport &ssr)
const int getLastErrorCode () const
 source specific error code, see also SyncReport::getLastErrorCode()
const SourceState getState () const
 the current state of the source, see SourceState
const char * getLastErrorMsg () const
 source specific error message, see also SyncReport::getLastErrorMsg()
const char * getSourceName () const
 the unique name of the source that this report is about
void setLastErrorCode (const int code)
void setState (const SourceState s)
void setLastErrorMsg (const char *msg)
void setSourceName (const char *name)
bool checkState ()
 Check the state of this source.
ItemReport * getItemReport (const char *target, const char *command, int index)
 Get internal pointer to a specific ItemReport.
int getItemReportCount (const char *target, const char *command)
 Return the total number of ItemReport for a specific list.
int getItemReportSuccessfulCount (const char *target, const char *command)
int getItemReportFailedCount (const char *target, const char *command)
int getItemReportAlreadyExistCount (const char *target, const char *command)
int getTotalSuccessfulCount ()
 Returns the total number of items succesfully synced, both Server and Client side.
void addItem (const char *target, const char *command, const WCHAR *ID, const int status, const WCHAR *statusMessage)
 Used to add an ItemReport to a specific list.
ArrayList * getList (const char *target, const char *command) const
 Utility to switch on the right list, based on target and command.
SyncSourceReportoperator= (const SyncSourceReport &ssr)
 Assign operator.

Static Public Attributes

static const char *const targets []
 all valid strings for "target", NULL terminated
static const char *const commands []
 all valid strings for "command", NULL terminated

Private Member Functions

bool isSuccessful (const int status)
void initialize ()
void assign (const SyncSourceReport &ssr)

Private Attributes

int lastErrorCode
char * lastErrorMsg
char * sourceName
SourceState state
ArrayList * clientAddItems
ArrayList * clientModItems
ArrayList * clientDelItems
ArrayList * serverAddItems
ArrayList * serverModItems
ArrayList * serverDelItems


Detailed Description

SyncSourceReport class rapresents the report of each SyncSource synchronized.

It is used to store the sync results for a specific syncsource, its state (active/inactive/error) and the status of each item synchronized (both on client and server side).


Member Function Documentation

void SyncSourceReport::addItem ( const char *  target,
const char *  command,
const WCHAR *  ID,
const int  status,
const WCHAR *  statusMessage 
)

Used to add an ItemReport to a specific list.

This function is called inside API to store the status of each item added/modified/deleted on client and on server.

Parameters:
target to select if client/server side (values = CLIENT - SERVER)
command to select the desired list of ItemReport (values = Add - Replace - Delete)
ID the LUID of item (used to create the ItemReport element)
status the status code of the operation (used to create the ItemReport element)
statusMessage the status message associated to the operation (used to create the ItemReport element)

Referenced by WindowsSyncSource::removeAllItems().

bool SyncSourceReport::checkState (  ) 

ItemReport* SyncSourceReport::getItemReport ( const char *  target,
const char *  command,
int  index 
)

Get internal pointer to a specific ItemReport.

Parameters:
target to select if client/server side (values = CLIENT - SERVER)
command to select the desired list of ItemReport (values = Add - Replace - Delete)
index the index of desired item inside the list

Referenced by WindowsSyncSource::createOldItems().

int SyncSourceReport::getItemReportCount ( const char *  target,
const char *  command 
)

Return the total number of ItemReport for a specific list.

Parameters:
target to select if client/server side (values = CLIENT - SERVER)
command to select the desired list of ItemReport (values = Add - Replace - Delete)

Referenced by WindowsSyncSource::createOldItems(), and printReport().

ArrayList* SyncSourceReport::getList ( const char *  target,
const char *  command 
) const

Utility to switch on the right list, based on target and command.

Parameters:
target to select if client/server side (values = CLIENT - SERVER)
command to select the desired list of ItemReport (values = Add - Replace - Delete)
Returns:
a pointer to the desired ArrayList


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