com.funambol.common.pim.icalendar
Class EventSyncSource

java.lang.Object
  extended by TrackableSyncSource
      extended by com.funambol.common.pim.PIMSyncSource
          extended by com.funambol.common.pim.icalendar.EventSyncSource

public class EventSyncSource
extends PIMSyncSource


Field Summary
protected static int[] SUPPORTED_FIELDS
           
 
Fields inherited from class com.funambol.common.pim.PIMSyncSource
globalStatus, list, totalAdded, totalDeleted, totalDeletedSent, totalNewSent, totalUpdated, totalUpdatedSent
 
Constructor Summary
EventSyncSource(SourceConfig config, PIMList list, ChangesTracker tracker)
           
 
Method Summary
protected  PIMItem createItem(java.lang.String content)
          Creates a single item in the proper PIMList
protected  boolean deleteItem(PIMItem item)
          Delete an item from the store
protected  void fillItem(PIMItem pitem, java.lang.String content)
          Fills an item according to a textual representation of the same item.
protected  byte[] formatItem(PIMItem item)
          Formats an item according to the format supported by the sync source.
protected  int[] getSupportedFields()
          Get the list of supported fields.
protected  int getUIDField()
          Get the value of the UID field.
 
Methods inherited from class com.funambol.common.pim.PIMSyncSource
addItem, beginSync, clearItem, dataReceived, deleteAllItems, endSync, findItem, getAllItemsKeys, getItemContent, getLuidFromUID, getUID, updateItem
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUPPORTED_FIELDS

protected static final int[] SUPPORTED_FIELDS
Constructor Detail

EventSyncSource

public EventSyncSource(SourceConfig config,
                       PIMList list,
                       ChangesTracker tracker)
Method Detail

createItem

protected PIMItem createItem(java.lang.String content)
                      throws PIMException
Creates a single item in the proper PIMList

Specified by:
createItem in class PIMSyncSource
Parameters:
content - is the item in the sync source standard format (could be a vCard, SIF-C or any other valid format).
Returns:
a PIMItem representing the given item
Throws:
PIMException - if the PIMItem cannot be created (for example if the textual representation is invalid, or no new items can be added to the list)

getSupportedFields

protected int[] getSupportedFields()
Get the list of supported fields. This method is needed by the clearItem method. If a derived class redefines the clearItem, then it does not need to give a meaningful implementation of this method (may return null).

Specified by:
getSupportedFields in class PIMSyncSource

getUIDField

protected int getUIDField()
Get the value of the UID field. Each PIM Item has the concept of UID which distinguish each PIMItem. This method returns the UID field id. This method is needed by the clearItem method. If a derived class redefines the clearItem, then it does not need to give a meaningful implementation of this method (may return null).

Specified by:
getUIDField in class PIMSyncSource

deleteItem

protected boolean deleteItem(PIMItem item)
                      throws PIMException
Delete an item from the store

Parameters:
item - the item to be removed (the key is the only relevant field)
Returns:
true iff the item was successfully removed
Throws:
PIMException - if the item cannot be removed

formatItem

protected byte[] formatItem(PIMItem item)
                     throws PIMException
Formats an item according to the format supported by the sync source. The item is formatted as a stream of bytes ready to be exchanged with the DS server.

Specified by:
formatItem in class PIMSyncSource
Parameters:
item - the item (cannot be null)
Returns:
an array of byte representing the incoming item
Throws:
PIMException - if the item cannot be formatted

fillItem

protected void fillItem(PIMItem pitem,
                        java.lang.String content)
                 throws PIMException
Fills an item according to a textual representation of the same item. The actual format depends on the sync source. A contact could be for example represented as a vCard and thus parsed to geneate a Contact object.

Specified by:
fillItem in class PIMSyncSource
Parameters:
pitem - is the object to be filled
content - is the item textual representation
Throws:
PIMException - if the item cannot be parsed


Copyright © 2001-2009 Funambol.