Client Store


Purpose

Initiates and controls the data synchronization capability by means of the HTTP maps replication process, as well as enables initialization, pausing and restarting of the Store and Forward process.

Data chunking capability is supported which permits the client to receive large amounts of data in several smaller chunks during data synchronization. This capability also handles failures due to a user interaction or a network failure.

You can access the object using the launchbox.PRPC.ClientStore reference.

Module

This object belongs to the PRPC Client Store product module.

Constants

One of the following constants is passed in the errorCode parameter for the onStatusUpdate callback method of the addListener method, as well in the parameter of the onFailure callback method of various other methods of the ClientStore object.

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.ILLEGAL_ARGUMENTS Denotes that illegal arguments have been passed.
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.
Error.SESSION_EXPIRED Denotes that network connectivity has been restored but session cookies have expired.
Error.ITEM_NOT_FOUND Denotes that an item could not be found in the storage.

One of the following constants is passed in the event parameter for the onStatusUpdate callback method of the 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.

Management methods

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

The stop method pauses the Client Store process.

Session management methods

Name Return type Description
keepAliveSessionTimeout undefined

Resets the inactivity timeout to indicate when the last user action happened.

addSessionTimeoutListener undefined

Adds a session timeout listener to the Client Store service.

removeSessionTimeoutListener undefined

Removes a session timeout listener added by using the addSessionTimeoutListener method.

Replicated storage methods

Name Return type Description
batchExecute undefined

Enables executing a batch of writeItem, writeBinaryItem, deleteItemWithAction, addAction, addActionWithItemReference, getItems and runQuery calls to the Client Store API on the local storage.

customTableSizes undefined

Retrieves the sizes of custom tables, based on a list passed in the tableNames object.

getItem undefined

Gets an item selected by specifying their type and handle, together witn an URL of an attachment.

getItems undefined

Gets a list of items selected by specifying their type and handle.

getItemsStats 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.

writeBinaryItem undefined

Adds or updates an item with reference to a binary file.

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 type and handle.

deleteItemWithAction undefined

Deletes a specific item from storage, and adds a corresponding action to the queue.

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.

Forwardable storage methods

Name Return type Description
addActionQueueListener undefined

Adds an action queue listener to the Client Store service.

removeActionQueueListener undefined

Removes an action queue listener added by using the addActionQueueListener method.

addAction undefined

Adds an action to the action queue.

addActionWithItemReference undefined

Adds an action with reference to an offline storage item 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.

getFileForwardingState undefined

Retrieves a state of the file forwarding process.

setFileForwardingState undefined

Sets the state of the file forwarding process.

Related topic

Public API reference
Legal notice | Copyright © 2018 and Confidential to Pegasystems Inc. All rights reserved
PDN | Feedback
Advanced...