public abstract class SyncMapObserver
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 |
|---|
SyncMapObserver()
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 the entire SyncMap has been removed.
|
void |
onErrorOccurred(ErrorInfo error)
This callback is invoked when a SyncMap operation has encountered a error in local request.
|
void |
onItemAdded(EventContext context,
SyncMap.Item item)
This callback is invoked when SyncMap item has been added.
|
void |
onItemRemoved(EventContext context,
java.lang.String itemKey,
org.json.JSONObject previousItemData)
This callback is invoked when SyncMap item has been removed.
|
void |
onItemUpdated(EventContext context,
SyncMap.Item item,
org.json.JSONObject previousItemData)
This callback is invoked when SyncMap item has been updated.
|
void |
onOpened(SyncMap syncMap)
This callback is invoked when SyncMap object has been initialised and opened locally.
|
public SyncMapObserver()
public void onOpened(SyncMap syncMap)
syncMap - SyncMap object that has been opened. This parameter you should take and use as
your initialised instance of a map.public void onItemAdded(EventContext context, SyncMap.Item item)
context - Context indicating if change was local or remote.item - The item that was added.public void onItemUpdated(EventContext context, SyncMap.Item item, org.json.JSONObject previousItemData)
context - Context indicating if change was local or remote.item - The item after the change.previousItemData - Snapshot of the item before the change.public void onItemRemoved(EventContext context, java.lang.String itemKey, org.json.JSONObject previousItemData)
context - Context indicating if change was local or remote.itemKey - Key of the item that has been removed.previousItemData - Snapshot of the item immediately prior deletion.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()