PageStorage interface
API for implementing a custom image storage.
Most common scenarios will work with the default page storage. PageStorage interface is intended for advanced users and specific scenarios.
PageStorage can be represented as a collection of pages, where each page is assigned with a unique identifier (GUID) and is itself a key-value collection with string keys and arbitrary data values (byte[]). Key-value relationship is to be maintained on the client side. An example of a key is an image or a thumbnail.
The default implementation of the PageStorage is file-based. By default it has a root folder located in application's internal storage. Each page is stored in a subfolder of the root folder named with page's identifier. All page-related data, such as captured image and its properties, is stored in files inside the corresponding subfolder.
Methods can be used for creation and managing pages of the image storage.
This logic is also used in the custom image storage implementation with the PageStorage interface and its methods.
To use the implemented custom storage instead of the default one, use the corresponding Builder.
This interface and its methods are to be implemented on the client side.
interface PageStorage
Methods
Important! Methods below should be called from the Worker Thread only.
Name | Description |
---|---|
clear | Removes all the pages from the storage. |
create | Creates an empty page with a string identifier and adds it to the storage. |
delete | Removes the page with specified identifier. |
getPages | Returns all the pages identifiers in the storage. |
load | Returns the data of the certain page, associated with the specified key. |
store | Adds, removes or edits data, associated with the key of the page with the specified identifier. |
02.03.2022 12:59:15