|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.funambol.syncml.client.BaseSyncSource
com.funambol.syncml.client.TrackableSyncSource
public abstract class TrackableSyncSource
An abstract implementation of BaseSyncSource, providing the ability to use a ChangesTracker to automatically trace changes. This class needs a ChangesTracker to be able to track changes and it provides initNewItems, initUpdItems, initDelItems and initAllItems.
Field Summary | |
---|---|
protected ChangesTracker |
tracker
|
Fields inherited from class com.funambol.syncml.client.BaseSyncSource |
---|
allIndex, allItems, config, delIndex, delItems, filter, globalStatus, newIndex, newItems, syncMode, updIndex, updItems |
Fields inherited from interface com.funambol.syncml.spds.SyncSource |
---|
ENCODING_B64, ENCODING_NONE, STATUS_CONNECTION_ERROR, STATUS_RECV_ERROR, STATUS_SEND_ERROR, STATUS_SERVER_ERROR, STATUS_SUCCESS |
Constructor Summary | |
---|---|
TrackableSyncSource(SourceConfig config,
ChangesTracker tracker)
TrackableSyncSource constructor: initialize source config |
Method Summary | |
---|---|
void |
beginSync(int syncMode)
Called after SyncManager preparation and initialization just before start the synchronization of the SyncSource. |
void |
endSync()
Called just before committing the synchronization process by the SyncManager. |
protected abstract java.util.Enumeration |
getAllItemsKeys()
|
protected void |
initAllItems()
In a concrete implementation, this function should search the database for all the items present and store their keys. |
protected SyncItem[] |
initChangedItems(java.util.Enumeration itemsEnum,
int itemsCount)
|
protected void |
initDelItems()
In a real implementation, this function should search the database for the deleted items present and store their keys. |
protected void |
initNewItems()
In a concrete implementation, this function should search the database for the new items present and store their keys. |
protected void |
initUpdItems()
In a real implementation, this function should search the database for the modified items present and store their keys. |
void |
setItemStatus(java.lang.String key,
int status)
Tell the SyncSource the status returned by the server for an Item previously sent. |
Methods inherited from class com.funambol.syncml.client.BaseSyncSource |
---|
addItem, dataReceived, deleteItem, getClientAddNumber, getClientDeleteNumber, getClientItemsNumber, getClientReplaceNumber, getConfig, getEncoding, getFilter, getItemContent, getLastAnchor, getListener, getName, getNextAnchor, getNextDeletedItem, getNextItem, getNextNewItem, getNextUpdatedItem, getServerItemsNumber, getSourceUri, getStatus, getSyncMode, getType, setConfig, setFilter, setLastAnchor, setListener, setNextAnchor, setServerItemsNumber, updateItem |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ChangesTracker tracker
Constructor Detail |
---|
public TrackableSyncSource(SourceConfig config, ChangesTracker tracker)
Method Detail |
---|
public void beginSync(int syncMode) throws SyncException
BaseSyncSource
beginSync
in interface SyncSource
beginSync
in class BaseSyncSource
syncMode
- the synchronization type: one of the values in
sync4j.framework.core.AlertCode
SyncException
- in case of error. This will stop the sync processpublic void endSync() throws SyncException
BaseSyncSource
endSync
in interface SyncSource
endSync
in class BaseSyncSource
SyncException
- in case of error, to stop the commit.protected void initAllItems() throws SyncException
BaseSyncSource
initAllItems
in class BaseSyncSource
SyncException
- implementation can throw a SyncException
to stop the sync on fatal errors.protected void initNewItems() throws SyncException
BaseSyncSource
initNewItems
in class BaseSyncSource
SyncException
- implementation can throw a SyncException
to stop the sync on fatal errors.protected void initUpdItems() throws SyncException
BaseSyncSource
initUpdItems
in class BaseSyncSource
SyncException
- implementation can throw a SyncException
to stop the sync on fatal errors.protected void initDelItems() throws SyncException
BaseSyncSource
initDelItems
in class BaseSyncSource
SyncException
- implementation can throw a SyncException
to stop the sync on fatal errors.protected SyncItem[] initChangedItems(java.util.Enumeration itemsEnum, int itemsCount)
public void setItemStatus(java.lang.String key, int status) throws SyncException
BaseSyncSource
setItemStatus
in interface SyncSource
setItemStatus
in class BaseSyncSource
key
- the key of the itemstatus
- the status code received for that item
SyncException
- if the SyncSource wants to stop the syncprotected abstract java.util.Enumeration getAllItemsKeys()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |