Loading...
Searching...
No Matches
com.navigine.idl.java.StorageManager Class Referenceabstract

Interface for managing multiple key-value storages, providing access and lifecycle control. More...

Public Member Functions

abstract ArrayList< String > getStorageList ()
 
abstract KeyValueStorage getStorage (String name)
 
abstract void removeStorage (String name)
 

Detailed Description

Interface for managing multiple key-value storages, providing access and lifecycle control.

Referenced from NavigineSdk.

Definition at line 17 of file StorageManager.java.

Member Function Documentation

◆ 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
nameStorage name (case-sensitive).
Returns
Key–value storage instance KeyValueStorage

Java code snippet:

// Get or create different storage instances
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:

// Get list of all existing storages
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
nameStorage name (case-sensitive).
Note
Existing handles to this storage become invalid after removal and further operations may fail.

Java code snippet:

// Remove storage and all its data
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: