|
|||||||||
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
com.funambol.syncml.client.FileSyncSource
public class FileSyncSource
An implementation of TrackableSyncSource, providing the ability sync briefcases (files)
Field Summary |
---|
Fields inherited from class com.funambol.syncml.client.TrackableSyncSource |
---|
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 | |
---|---|
FileSyncSource(SourceConfig config,
ChangesTracker tracker,
java.lang.String directory)
FileSyncSource constructor: initialize source config |
Method Summary | |
---|---|
int |
addItem(SyncItem item)
Add a new SyncItem to this source backend. |
void |
beginSync(int syncMode)
Called after SyncManager preparation and initialization just before start the synchronization of the SyncSource. |
int |
deleteItem(java.lang.String key)
Delete a SyncItem stored in the source backend. |
protected java.util.Enumeration |
getAllItemsKeys()
|
protected SyncItem |
getItemContent(SyncItem item)
This function gets the item content in the backend database and returns a complete item. |
SyncItem |
getNextItem()
Returns the next item of the store. |
SyncItem |
getNextNewItem()
Returns the next new item of the store (not yet sent to the server) |
SyncItem |
getNextUpdatedItem()
Returns the first/next updated item of the store (changed from the last sync) |
int |
updateItem(SyncItem item)
Update a given SyncItem stored in the source backend. |
Methods inherited from class com.funambol.syncml.client.TrackableSyncSource |
---|
endSync, initAllItems, initChangedItems, initDelItems, initNewItems, initUpdItems, setItemStatus |
Methods inherited from class com.funambol.syncml.client.BaseSyncSource |
---|
dataReceived, getClientAddNumber, getClientDeleteNumber, getClientItemsNumber, getClientReplaceNumber, getConfig, getEncoding, getFilter, getLastAnchor, getListener, getName, getNextAnchor, getNextDeletedItem, getServerItemsNumber, getSourceUri, getStatus, getSyncMode, getType, setConfig, setFilter, setLastAnchor, setListener, setNextAnchor, setServerItemsNumber |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileSyncSource(SourceConfig config, ChangesTracker tracker, java.lang.String directory)
Method Detail |
---|
public void beginSync(int syncMode) throws SyncException
BaseSyncSource
beginSync
in interface SyncSource
beginSync
in class TrackableSyncSource
syncMode
- the synchronization type: one of the values in
sync4j.framework.core.AlertCode
SyncException
- in case of error. This will stop the sync processprotected java.util.Enumeration getAllItemsKeys() throws SyncException
getAllItemsKeys
in class TrackableSyncSource
SyncException
public SyncItem getNextItem() throws SyncException
BaseSyncSource
getNextItem
in interface SyncSource
getNextItem
in class BaseSyncSource
SyncException
public SyncItem getNextNewItem() throws SyncException
BaseSyncSource
getNextNewItem
in interface SyncSource
getNextNewItem
in class BaseSyncSource
SyncException
public SyncItem getNextUpdatedItem() throws SyncException
BaseSyncSource
getNextUpdatedItem
in interface SyncSource
getNextUpdatedItem
in class BaseSyncSource
SyncException
public int addItem(SyncItem item) throws SyncException
BaseSyncSource
addItem
in interface SyncSource
addItem
in class BaseSyncSource
item
- the SyncItem to add, with the GUID sent by the server.
The source is resposible to set it to the LUID before
returning a successful status code.
SyncException
- if an unrecoverable error occur, to stop the syncpublic int updateItem(SyncItem item) throws SyncException
BaseSyncSource
updateItem
in interface SyncSource
updateItem
in class BaseSyncSource
item
- the SyncItem to update. The key of the item is already
the LUID.
SyncException
- if an unrecoverable error occur, to stop the syncpublic int deleteItem(java.lang.String key) throws SyncException
BaseSyncSource
deleteItem
in interface SyncSource
deleteItem
in class BaseSyncSource
key
- The key of the item to delete.
SyncException
- if an unrecoverable error occur, to stop the syncprotected SyncItem getItemContent(SyncItem item) throws SyncException
BaseSyncSource
The content of the item depends also from the encoding of this SyncSource:
getItemContent
in class BaseSyncSource
SyncException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |