Initiates and controls the data synchronization capability via the HTTP maps replication process, as well as enables initialization of the Store and Forward process.
Chunking capability is enabled which permits to send large files in several smaller chunks during data synchronization. This capability also handles failures due to a user interaction or a network failure.
Certain methods in this API can be called no earlier than after the getOfflineStorageCount
method's onSuccess
callback is invoked during the first application start. Otherwise, they fail with
onFailure
callback invoked.
The object can be accessed using the launchbox.PRPC.ClientStore
reference.
One of the following constants is passed in the errorCode
parameter
for the onStatusUpdate
callback method to define the type of error that
has occurred - see addListener.
Name | Description |
---|---|
Error.ALREADY_STARTED | Denotes that the operation is already in progress. |
Error.AUTHENTICATION_FAILURE | Denotes that the authentication process has failed. |
Error.CLIENT_DB_FAILURE | Denotes that an error related to the client database has occurred. |
Error.CLIENT_PARSING_FAILURE | Denotes that a parsing failure has occurred for the client. |
Error.INTERNAL | Denotes that an internal error has occurred. |
Error.NETWORK_FAILURE | Denotes that a network error has occurred. |
Error.NOT_CONFIGURED | Denotes that the ClientStore object has not yet been
configured. |
Error.SERVER_FAILURE | Denotes that an error has occurred related to the server. |
One of the following constants is passed in the event
parameter for
the onStatusUpdate
callback method to define the type of event that has
occurred - see addListener.
Name | Description |
---|---|
Event.FAILED | Denotes that the data synchronization operation has failed. |
Event.STARTED | Denotes that the data synchronization has started or has been resumed manually. |
Event.STOPPED | Denotes that the data synchronization has stopped or has been paused manually. |
Event.SUCCEEDED | Denotes that the data synchronization has successfully completed. |
One of the following constants is passed in the phase
parameter for
the onProgress
callback method to define the type of event that has
occurred - see addListener.
Name | Description |
---|---|
Progress.REQUEST_SENT | Denotes that the first request to the server was sent successfully. |
Progress.RESPONSE_INCOMING | Denotes that the first command from the server was received. |
Progress.RESPONSE_CONSUMED | Denotes that the response was consumed in total. |
Name | Return type | Description |
---|---|---|
configure | undefined |
Configures the Client Store process. Calling this method during the first application start is required for all other methods to work. |
start | undefined |
Starts or resumes the Client Store process. |
addListener | undefined |
Adds a listener to the Client Store service. |
removeListener | undefined |
Removes a listener previously added to the Client Store service. |
stop | undefined |
On Android, it pauses the Client Store process. On iOS, it stops the process. |
Name | Return type | Description |
---|---|---|
batchExecute | undefined |
Enables grouping |
customTableSizes | undefined |
Retrieves the sizes of custom tables, based on a list passed in the
|
getItems | undefined |
Gets a list of items selected by specifying their |
getItemStats | undefined |
Returns statistics for all currently stored data items which are not being sychronized at this time. |
writeItem | undefined |
Adds or updates an item within local storage. |
getItemTypes | undefined |
Retrieves a list of item types for currently stored data items. |
getOfflineStorageCount | undefined |
Retrieves a number of currently stored items. |
deleteItem | undefined |
Deletes a specific item selected by specifying its |
clearItems | undefined |
Clears all items in local storage if data synchronization is not working. |
runQuery | undefined |
This method provides access (with single record granularity) to data saved in the Client Store. |
Name | Return type | Description |
---|---|---|
addAction | undefined |
Adds an action to the action queue. |
listActions | undefined |
Retrieves a map of currently stored actions. |
getQueuedActionsCount | undefined |
Retrieves a number of actions in the actions queue. |
removeAction | undefined |
Removes a specified action from the action queue. |