Interface for managing multiple key-value storages, providing access and lifecycle control.
More...
Interface for managing multiple key-value storages, providing access and lifecycle control.
Referenced from NavigineSdk.
Definition at line 17 of file StorageManager.java.
◆ getStorage()
| abstract KeyValueStorage com.navigine.idl.java.StorageManager.getStorage |
( |
String | name | ) |
|
|
abstract |
Returns a handle to a storage by name, creating it if it does not exist.
- Parameters
-
| name | Storage name (case-sensitive). |
- Returns
- Key–value storage instance KeyValueStorage
Java code snippet:
userStorage = storageManager.getStorage("user_preferences");
appStorage = storageManager.getStorage("app_settings");
cacheStorage = storageManager.getStorage("cache");
Kotlin code snippet:
// Get or create different storage instances
userStorage = storageManager!!.getStorage("user_preferences")
appStorage = storageManager!!.getStorage("app_settings")
cacheStorage = storageManager!!.getStorage("cache")
◆ getStorageList()
| abstract ArrayList< String > com.navigine.idl.java.StorageManager.getStorageList |
( |
| ) |
|
|
abstract |
Returns the list of all existing user storages.
- Returns
- List of storage names (implementation currently returns them in alphabetical order).
Java code snippet:
List<String> storageList = storageManager.getStorageList();
System.out.println("Existing storages: " + storageList);
Kotlin code snippet:
// Get list of all existing storages
val storageList: List<String> = storageManager!!.getStorageList()
println("Existing storages: $storageList")
◆ removeStorage()
| abstract void com.navigine.idl.java.StorageManager.removeStorage |
( |
String | name | ) |
|
|
abstract |
Removes the storage and all its persisted data. If the storage does not exist, this is a no-op.
- Parameters
-
| name | Storage name (case-sensitive). |
- Note
- Existing handles to this storage become invalid after removal and further operations may fail.
Java code snippet:
storageManager.removeStorage("test_storage");
System.out.println("Removed test storage");
Kotlin code snippet:
// Remove storage and all its data
storageManager!!.removeStorage("test_storage")
println("Removed test storage")
The documentation for this class was generated from the following file: