|
Sync Android SDK
1.1.0
|
Observer for all operations on a SyncMap. More...
Public Member Functions | |
| SyncMapObserver () | |
| Keep default constructor, you don't need to override it. More... | |
| void | onOpened (SyncMap syncMap) |
| This callback is invoked when SyncMap object has been initialised and opened locally. More... | |
| void | onItemAdded (EventContext context, SyncMap.Item item) |
| This callback is invoked when SyncMap item has been added. More... | |
| void | onItemUpdated (EventContext context, SyncMap.Item item, JSONObject previousItemData) |
| This callback is invoked when SyncMap item has been updated. More... | |
| void | onItemRemoved (EventContext context, String itemKey, JSONObject previousItemData) |
| This callback is invoked when SyncMap item has been removed. More... | |
| void | onCollectionRemoved (EventContext context) |
| This callback is invoked when the entire SyncMap has been removed. More... | |
| void | onErrorOccurred (ErrorInfo error) |
| This callback is invoked when a SyncMap operation has encountered a error in local request. More... | |
Observer for all operations on a SyncMap.
You should create your own subclass of MapObserver and override functions you are interested in.
Observer will receive callbacks for all operations on a SyncMap. 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.SyncMapObserver.SyncMapObserver | ( | ) |
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.SyncMapObserver.onCollectionRemoved | ( | EventContext | context | ) |
This callback is invoked when the entire SyncMap has been removed.
| context | Context indicating if change was local or remote. |
| void com.twilio.sync.SyncMapObserver.onErrorOccurred | ( | ErrorInfo | error | ) |
This callback is invoked when a SyncMap operation has encountered a error in local request.
| error | Error description. |
| void com.twilio.sync.SyncMapObserver.onItemAdded | ( | EventContext | context, |
| SyncMap.Item | item | ||
| ) |
This callback is invoked when SyncMap item has been added.
| context | Context indicating if change was local or remote. |
| item | The item that was added. |
| void com.twilio.sync.SyncMapObserver.onItemRemoved | ( | EventContext | context, |
| String | itemKey, | ||
| JSONObject | previousItemData | ||
| ) |
This callback is invoked when SyncMap item has been removed.
| 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. |
| void com.twilio.sync.SyncMapObserver.onItemUpdated | ( | EventContext | context, |
| SyncMap.Item | item, | ||
| JSONObject | previousItemData | ||
| ) |
This callback is invoked when SyncMap item has been updated.
| context | Context indicating if change was local or remote. |
| item | The item after the change. |
| previousItemData | Snapshot of the item before the change. |