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