|
Sync Android SDK
1.0.3
|
Observer for all operations on a SyncDocument. More...
Public Member Functions | |
| SyncDocumentObserver () | |
| Keep default constructor, you don't need to override it. More... | |
| void | onOpened (SyncDocument doc) |
| This callback is invoked when SyncDocument object has been initialised and opened locally. More... | |
| void | onRemoved (EventContext context, JSONObject previousData) |
| This callback is invoked when entire SyncDocument has been removed by a local request. More... | |
| void | onUpdated (EventContext context, JSONObject data, JSONObject previousData) |
| This callback is invoked when a SyncDocument has been modified by a local request. More... | |
| void | onErrorOccurred (ErrorInfo error) |
| This callback is invoked when a SyncDocument operation has encountered an error. More... | |
Observer for all operations on a SyncDocument.
You should create your own subclass of DocumentObserver and override functions you are interested in.
Observer will receive callbacks for all operations on a SyncDocument. 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.SyncDocumentObserver.SyncDocumentObserver | ( | ) |
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.SyncDocumentObserver.onErrorOccurred | ( | ErrorInfo | error | ) |
This callback is invoked when a SyncDocument operation has encountered an error.
| error | Error description. |
| void com.twilio.sync.SyncDocumentObserver.onOpened | ( | SyncDocument | doc | ) |
This callback is invoked when SyncDocument object has been initialised and opened locally.
| doc | SyncDocument object that has been opened. This parameter you should take and use as your initialised instance of a document. |
| void com.twilio.sync.SyncDocumentObserver.onRemoved | ( | EventContext | context, |
| JSONObject | previousData | ||
| ) |
This callback is invoked when entire SyncDocument has been removed by a local request.
| context | Context indicating if change was local or remote. |
| previousData | Previous contents of the document. |
| void com.twilio.sync.SyncDocumentObserver.onUpdated | ( | EventContext | context, |
| JSONObject | data, | ||
| JSONObject | previousData | ||
| ) |
This callback is invoked when a SyncDocument has been modified by a local request.
| context | Context indicating if change was local or remote. |
| data | New contents of the document. |
| previousData | Previous contents of the document. |