|
Sync Android SDK
0.8.7
|
Observer for all operations on a Map. More...
Public Member Functions | |
| MapObserver () | |
| Keep default constructor, you don't need to override it. More... | |
| void | onOpened (Map map) |
| This callback is invoked when Map object has been initialised and opened locally. More... | |
| void | onItemAdded (EventContext context, Map.Item itemSnapshot) |
| This callback is invoked when Map item has been added. More... | |
| void | onItemUpdated (EventContext context, Map.Item itemSnapshot, JSONObject prevItemSnapshot) |
| This callback is invoked when Map item has been updated. More... | |
| void | onItemRemoved (EventContext context, String itemKey, JSONObject prevDataSnapshot) |
| This callback is invoked when Map item has been removed. More... | |
| void | onCollectionRemoved (EventContext context) |
| This callback is invoked when the entire Map has been removed. More... | |
| void | onErrorOccurred (ErrorInfo error) |
| This callback is invoked when a Map operation has encountered a error in local request. More... | |
Observer for all operations on a Map.
You should create your own subclass of MapObserver and override functions you are interested in.
Observer will receive callbacks for all operations on a Map. To distinguish parallel streams of local operations your application could use 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.
| com.twilio.sync.MapObserver.MapObserver | ( | ) |
Keep default constructor, you don't need to override it.
If you do override make sure to call the inherited constructor.
| void com.twilio.sync.MapObserver.onCollectionRemoved | ( | EventContext | context | ) |
This callback is invoked when the entire Map has been removed.
| context | Context indicating if change was local or remote. |
| void com.twilio.sync.MapObserver.onErrorOccurred | ( | ErrorInfo | error | ) |
This callback is invoked when a Map operation has encountered a error in local request.
| error | Error description. |
| void com.twilio.sync.MapObserver.onItemAdded | ( | EventContext | context, |
| Map.Item | itemSnapshot | ||
| ) |
This callback is invoked when Map item has been added.
| context | Context indicating if change was local or remote. |
| itemSnapshot | Snapshot of the item that was added. |
| void com.twilio.sync.MapObserver.onItemRemoved | ( | EventContext | context, |
| String | itemKey, | ||
| JSONObject | prevDataSnapshot | ||
| ) |
This callback is invoked when Map item has been removed.
| 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. |
| void com.twilio.sync.MapObserver.onItemUpdated | ( | EventContext | context, |
| Map.Item | itemSnapshot, | ||
| JSONObject | prevItemSnapshot | ||
| ) |
This callback is invoked when Map item has been updated.
| 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. |