An asynchronous RPC model for interacting with the Whispersync server.
Each method on an RPC class makes a single request of the Whispersync server, including
The Whispersync data store is fundamentally hierarchical. A user has multiple apps, each of which has multiple datasets, each of which has multiple records. The entry point to the Whispersync RPC layer, {@link com.amazon.device.sync.rpc.DatasetListRPC}, provides access to the list of datasets for the calling app in one user's account. Use methods on {@link com.amazon.device.sync.rpc.DatasetRPC} to drill into datasets and records.
This component is intended for use internally to the Whispersync client. Therefore, all methods are expected to be called on background threads.
Some methods initiate asynchronous operations. Their names end in Async, and they offer two ways of
obtaining the result of the operation:
In order to avoid having to re-enumerate datasets using {@link com.amazon.device.sync.rpc.DatasetListRPC} each time your app starts up, keep track of the URIs returned by {@link com.amazon.device.sync.rpc.DatasetRPC#getSelfUri()} and use them to instantiate {@link com.amazon.device.sync.rpc.DatasetRPC} objects directly.
Any request that returns a large amount of data will do so in multiple pages. Such methods in the API return a {@link com.amazon.device.sync.rpc.PaginatedUpdateableResponse} to provide access to the pages. If your application fails to retrieve a given page (for example, due to lost connectivity), keep track of the URI returned by {@link com.amazon.device.sync.rpc.PaginatedUpdateableResponse#getNextPageUri()} and use it to resume your pagination later.
After the initial enumeration of data, applications should download changes incrementally. The URI returned by {@link com.amazon.device.sync.rpc.PaginatedUpdateableResponse#getUpdatesUri()} allows that.
The RPC layer takes care of retrying failed requests with proper jittered exponential backoff. It will only
throw exceptions or issue onError callbacks after these retries have failed to achieve success.
Therefore, any errors coming from this API should be considered non-retryable. Typically the right handling is to
tell the user to try again later.