|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectTrackableSyncSource
com.funambol.common.pim.PIMSyncSource
public abstract class PIMSyncSource
Basic sync source for PIM sync management. This class is the base class for all classes manipulating JSR75 PIM data (such as Contact, Calendar and so on). The class is a TrackableSyncSource, so that the tracking mechanism can be easily customized by clients (default is CacheTracking, based on items finger prints).
Field Summary | |
---|---|
protected int |
globalStatus
Status of the sync source summarized in an integer value. |
protected javax.microedition.pim.PIMList |
list
|
protected int |
totalAdded
|
protected int |
totalDeleted
|
protected int |
totalDeletedSent
|
protected int |
totalNewSent
|
protected int |
totalUpdated
|
protected int |
totalUpdatedSent
|
Constructor Summary | |
---|---|
PIMSyncSource(SourceConfig config,
javax.microedition.pim.PIMList list,
ChangesTracker tracker)
|
Method Summary | |
---|---|
int |
addItem(SyncItem item)
|
void |
beginSync(int syncMode)
|
protected void |
clearItem(javax.microedition.pim.PIMItem item)
|
protected abstract javax.microedition.pim.PIMItem |
createItem(java.lang.String content)
Creates a single item in the proper PIMList |
void |
dataReceived(java.lang.String date,
int size)
|
void |
deleteAllItems()
|
protected abstract boolean |
deleteItem(javax.microedition.pim.PIMItem item)
Delete an item from the store |
int |
deleteItem(java.lang.String key)
|
void |
endSync()
Called just before committing the synchronization process by the SyncManager. |
protected abstract void |
fillItem(javax.microedition.pim.PIMItem pitem,
java.lang.String content)
Fills an item according to a textual representation of the same item. |
protected javax.microedition.pim.PIMItem |
findItem(java.lang.String key)
Finds an item in the source. |
protected abstract byte[] |
formatItem(javax.microedition.pim.PIMItem item)
Formats an item according to the format supported by the sync source. |
protected java.util.Enumeration |
getAllItemsKeys()
|
protected SyncItem |
getItemContent(SyncItem item)
|
protected java.lang.String |
getLuidFromUID(java.lang.String uid)
By default UID and Luid are the same. |
protected abstract int[] |
getSupportedFields()
Get the list of supported fields. |
protected java.lang.String |
getUID(javax.microedition.pim.PIMItem item)
|
protected abstract int |
getUIDField()
Get the value of the UID field. |
int |
updateItem(SyncItem item)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int totalAdded
protected int totalUpdated
protected int totalDeleted
protected int totalNewSent
protected int totalUpdatedSent
protected int totalDeletedSent
protected int globalStatus
protected javax.microedition.pim.PIMList list
Constructor Detail |
---|
public PIMSyncSource(SourceConfig config, javax.microedition.pim.PIMList list, ChangesTracker tracker)
Method Detail |
---|
public void beginSync(int syncMode) throws SyncException
SyncException
public void endSync() throws SyncException
SyncException
- in case of error, to stop the commit.public void dataReceived(java.lang.String date, int size)
public int addItem(SyncItem item) throws SyncException
SyncException
public int updateItem(SyncItem item) throws SyncException
SyncException
public int deleteItem(java.lang.String key) throws SyncException
SyncException
public void deleteAllItems() throws SyncException
SyncException
protected SyncItem getItemContent(SyncItem item) throws SyncException
SyncException
protected java.util.Enumeration getAllItemsKeys() throws SyncException
SyncException
protected void clearItem(javax.microedition.pim.PIMItem item) throws javax.microedition.pim.PIMException
javax.microedition.pim.PIMException
protected javax.microedition.pim.PIMItem findItem(java.lang.String key) throws javax.microedition.pim.PIMException
javax.microedition.pim.PIMException
- on error, for example if the list of items cannot be
accessedprotected java.lang.String getLuidFromUID(java.lang.String uid)
protected java.lang.String getUID(javax.microedition.pim.PIMItem item) throws javax.microedition.pim.PIMException
javax.microedition.pim.PIMException
protected abstract javax.microedition.pim.PIMItem createItem(java.lang.String content) throws javax.microedition.pim.PIMException
content
- is the item in the sync source standard format (could be a
vCard, SIF-C or any other valid format).
javax.microedition.pim.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)protected abstract int[] getSupportedFields()
protected abstract int getUIDField()
protected abstract boolean deleteItem(javax.microedition.pim.PIMItem item) throws javax.microedition.pim.PIMException
item
- the item to be removed (the key is the only relevant field)
javax.microedition.pim.PIMException
- if the item cannot be removedprotected abstract byte[] formatItem(javax.microedition.pim.PIMItem item) throws javax.microedition.pim.PIMException
item
- the item (cannot be null)
javax.microedition.pim.PIMException
- if the item cannot be formattedprotected abstract void fillItem(javax.microedition.pim.PIMItem pitem, java.lang.String content) throws javax.microedition.pim.PIMException
pitem
- is the object to be filledcontent
- is the item textual representation
javax.microedition.pim.PIMException
- if the item cannot be parsed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |