public abstract class SyncListObserver
extends java.lang.Object
local flow identifier.
Callbacks in the observer will be called from a background thread. You will need to repost
your work to UI thread if you do any UI-related operations in the callback.| Constructor and Description |
|---|
SyncListObserver()
Keep default constructor, you don't need to override it.
|
| Modifier and Type | Method and Description |
|---|---|
void |
dispose() |
void |
onCollectionRemoved(EventContext context)
This callback is invoked when an entire SyncList has been removed by a local request.
|
void |
onErrorOccurred(ErrorInfo error)
This callback is invoked when a SyncList operation has encountered an error.
|
void |
onItemAdded(EventContext context,
SyncList.Item item)
This callback is invoked when SyncList item has been added by a local request.
|
void |
onItemRemoved(EventContext context,
long itemIndex,
org.json.JSONObject previousItemData)
This callback is invoked when SyncList item has been removed by a local request.
|
void |
onItemUpdated(EventContext context,
SyncList.Item item,
org.json.JSONObject previousItemData)
This callback is invoked when SyncList item has been updated by a local request.
|
void |
onOpened(SyncList syncList)
This callback is invoked when SyncList object has been initialised and opened locally.
|
public SyncListObserver()
public void onOpened(SyncList syncList)
syncList - SyncList object that has been opened. This parameter you should take and use as
your initialised instance of a list.public void onItemAdded(EventContext context, SyncList.Item item)
context - Context indicating if change was local or remote.item - The item that was added.public void onItemUpdated(EventContext context, SyncList.Item item, org.json.JSONObject previousItemData)
context - Context indicating if change was local or remote.item - The current list item.previousItemData - Snapshot of the previous list item data.public void onItemRemoved(EventContext context, long itemIndex, org.json.JSONObject previousItemData)
context - Context indicating if change was local or remote.itemIndex - List index of the item that has been removed.previousItemData - Snapshot of the deleted list item in the state immediately prior
to deleteion.public void onCollectionRemoved(EventContext context)
context - Context indicating if change was local or remote.public void onErrorOccurred(ErrorInfo error)
error - Error description.public void dispose()