|
| 1 | +<!-- Generated automatically, DO NOT EDIT! --> |
| 2 | +<a name="head.StorageManager_Plugin"></a> |
| 3 | +# StorageManager Plugin |
| 4 | + |
| 5 | +A org.rdk.StorageManager plugin for Thunder framework. |
| 6 | + |
| 7 | +### Table of Contents |
| 8 | + |
| 9 | +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) |
| 10 | +- [Description](#head.Description) |
| 11 | +- [Configuration](#head.Configuration) |
| 12 | +- [Methods](#head.Methods) |
| 13 | + |
| 14 | +<a name="head.Abbreviation,_Acronyms_and_Terms"></a> |
| 15 | +# Abbreviation, Acronyms and Terms |
| 16 | + |
| 17 | +[[Refer to this link](overview/aat.md)] |
| 18 | + |
| 19 | +<a name="head.Description"></a> |
| 20 | +# Description |
| 21 | + |
| 22 | +The StorageManager is responsible for maintaining the space on the flash disk needed for Web Applications to store Browser functions such as Cookies and Local Storage. It is a Thunder plugin that exposes a single Thunder interface(s) called IStorageManager. |
| 23 | + |
| 24 | +Note: This document only describes the JSON-RPC methods exposed by the plugin, it does not cover COM-RPC interfaces or usage. |
| 25 | + |
| 26 | +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. |
| 27 | + |
| 28 | +<a name="head.Configuration"></a> |
| 29 | +# Configuration |
| 30 | + |
| 31 | +The table below lists configuration options of the plugin. |
| 32 | + |
| 33 | +| Name | Type | Description | |
| 34 | +| :-------- | :-------- | :-------- | |
| 35 | +| callsign | string | Plugin instance name (default: *org.rdk.StorageManager*) | |
| 36 | +| classname | string | Class name: *org.rdk.StorageManager* | |
| 37 | +| locator | string | Library name: *libWPEFrameworkStorageManager.so* | |
| 38 | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | |
| 39 | + |
| 40 | +<a name="head.Methods"></a> |
| 41 | +# Methods |
| 42 | + |
| 43 | +The following methods are provided by the org.rdk.StorageManager plugin: |
| 44 | + |
| 45 | +StorageManager interface methods: |
| 46 | + |
| 47 | +| Method | Description | |
| 48 | +| :-------- | :-------- | |
| 49 | +| [clear](#method.clear) | Clears app data for a given app id | |
| 50 | +| [clearAll](#method.clearAll) | Clears all app data except for the exempt app ids | |
| 51 | + |
| 52 | + |
| 53 | +<a name="method.clear"></a> |
| 54 | +## *clear [<sup>method</sup>](#head.Methods)* |
| 55 | + |
| 56 | +Clears app data for a given app id. |
| 57 | + |
| 58 | +### Events |
| 59 | + |
| 60 | +No Events |
| 61 | + |
| 62 | +### Parameters |
| 63 | + |
| 64 | +| Name | Type | Description | |
| 65 | +| :-------- | :-------- | :-------- | |
| 66 | +| params | object | | |
| 67 | +| params.appId | string | Application Identifier | |
| 68 | + |
| 69 | +### Result |
| 70 | + |
| 71 | +| Name | Type | Description | |
| 72 | +| :-------- | :-------- | :-------- | |
| 73 | +| result | object | Returns success or error status | |
| 74 | +| result.error | string | Error message, if any | |
| 75 | + |
| 76 | +### Errors |
| 77 | + |
| 78 | +| Code | Message | Description | |
| 79 | +| :-------- | :-------- | :-------- | |
| 80 | +| 0 | ```Core::ERROR_NONE``` | Success | |
| 81 | +| 1 | ```Core::ERROR_GENERAL``` | General error | |
| 82 | + |
| 83 | +### Example |
| 84 | + |
| 85 | +#### Request |
| 86 | + |
| 87 | +```json |
| 88 | +{ |
| 89 | + "jsonrpc": "2.0", |
| 90 | + "id": 42, |
| 91 | + "method": "org.rdk.StorageManager.clear", |
| 92 | + "params": { |
| 93 | + "appId": "com.example.myapp" |
| 94 | + } |
| 95 | +} |
| 96 | +``` |
| 97 | + |
| 98 | +#### Response |
| 99 | + |
| 100 | +```json |
| 101 | +{ |
| 102 | + "jsonrpc": "2.0", |
| 103 | + "id": 42, |
| 104 | + "result": { |
| 105 | + "error": "null" |
| 106 | + } |
| 107 | +} |
| 108 | +``` |
| 109 | + |
| 110 | +<a name="method.clearAll"></a> |
| 111 | +## *clearAll [<sup>method</sup>](#head.Methods)* |
| 112 | + |
| 113 | +Clears all app data except for the exempt app ids. |
| 114 | + |
| 115 | +### Events |
| 116 | + |
| 117 | +No Events |
| 118 | + |
| 119 | +### Parameters |
| 120 | + |
| 121 | +| Name | Type | Description | |
| 122 | +| :-------- | :-------- | :-------- | |
| 123 | +| params | object | | |
| 124 | +| params?.exemptionAppIds | string | <sup>*(optional)*</sup> A JSON-formatted string listing app IDs exempt from clearing | |
| 125 | + |
| 126 | +### Result |
| 127 | + |
| 128 | +| Name | Type | Description | |
| 129 | +| :-------- | :-------- | :-------- | |
| 130 | +| result | object | Returns success or error status | |
| 131 | +| result.error | string | Error message, if any | |
| 132 | + |
| 133 | +### Errors |
| 134 | + |
| 135 | +| Code | Message | Description | |
| 136 | +| :-------- | :-------- | :-------- | |
| 137 | +| 0 | ```Core::ERROR_NONE``` | Success | |
| 138 | +| 1 | ```Core::ERROR_GENERAL``` | General error | |
| 139 | + |
| 140 | +### Example |
| 141 | + |
| 142 | +#### Request |
| 143 | + |
| 144 | +```json |
| 145 | +{ |
| 146 | + "jsonrpc": "2.0", |
| 147 | + "id": 42, |
| 148 | + "method": "org.rdk.StorageManager.clearAll", |
| 149 | + "params": { |
| 150 | + "exemptionAppIds": "{\"exemptionAppIds\":[\"com.example.app1\", \"com.example.app2\"]}" |
| 151 | + } |
| 152 | +} |
| 153 | +``` |
| 154 | + |
| 155 | +#### Response |
| 156 | + |
| 157 | +```json |
| 158 | +{ |
| 159 | + "jsonrpc": "2.0", |
| 160 | + "id": 42, |
| 161 | + "result": { |
| 162 | + "error": "null" |
| 163 | + } |
| 164 | +} |
| 165 | +``` |
| 166 | + |
0 commit comments