DefaultStorageClient

Data Access Object which implements StorageClient interface and uses SecureSharedPreferences from forgerock-core SDK to store and load Accounts, Mechanisms and Notifications.

Constructors

Link copied to clipboard
constructor(context: Context)

Properties

Link copied to clipboard
private open var accountData: SharedPreferences
Link copied to clipboard
Link copied to clipboard
private val ORG_FORGEROCK_SHARED_PREFERENCES_DATA_ACCOUNT: String = "org.forgerock.android.authenticator.DATA.ACCOUNT"
private val ORG_FORGEROCK_SHARED_PREFERENCES_DATA_MECHANISM: String = "org.forgerock.android.authenticator.DATA.MECHANISM"
private val ORG_FORGEROCK_SHARED_PREFERENCES_DATA_NOTIFICATIONS: String = "org.forgerock.android.authenticator.DATA.NOTIFICATIONS"
Link copied to clipboard
private val ORG_FORGEROCK_SHARED_PREFERENCES_KEYS: String = "org.forgerock.android.authenticator.KEYS"
Link copied to clipboard
private val TAG: String

Functions

Link copied to clipboard
open fun getAccount(accountId: String): Account
Get the Account object with its id
Link copied to clipboard
Get all accounts stored in the system.
Link copied to clipboard
private open fun getAllMechanisms(): List<Mechanism>
Get all mechanisms stored in the system.
Link copied to clipboard
Get all notifications from the storage system.
Link copied to clipboard
Get all notifications for within the mechanism.
Link copied to clipboard
open fun getMechanismByUUID(mechanismUID: String): Mechanism
Get the mechanism by UUID.
Link copied to clipboard
Get the mechanisms associated with an account.
Link copied to clipboard
open fun getNotification(notificationId: String): PushNotification
Get the PushNotification object with its id
Link copied to clipboard
open fun isEmpty(): Boolean
Whether the storage system currently contains any data.
Link copied to clipboard
open fun removeAccount(account: Account): Boolean
Delete the Account that was passed in.
Link copied to clipboard
open fun removeAll()
Remove all the stored Account, Mechanism and PushNotification
Link copied to clipboard
open fun removeMechanism(mechanism: Mechanism): Boolean
Delete the mechanism uniquely identified by an id.
Link copied to clipboard
open fun removeNotification(pushNotification: PushNotification): Boolean
Delete the pushNotification uniquely identified by an id.
Link copied to clipboard
open fun setAccount(account: Account): Boolean
Add or Update the Account to the storage system.
Link copied to clipboard
open fun setAccountData(sharedPreferences: SharedPreferences)
Link copied to clipboard
open fun setMechanism(mechanism: Mechanism): Boolean
Add or update the mechanism to the storage system.
Link copied to clipboard
open fun setMechanismData(sharedPreferences: SharedPreferences)
Link copied to clipboard
open fun setNotification(pushNotification: PushNotification): Boolean
Add or update the pushNotification to the storage system.
Link copied to clipboard
open fun setNotificationData(sharedPreferences: SharedPreferences)