ProteusClientProviderImpl

internal class ProteusClientProviderImpl(rootProteusPath: String, userId: UserId, passphraseStorage: PassphraseStorage, currentClientIdProvider: CurrentClientIdProvider, dispatcher: KaliumDispatcher = KaliumDispatcherImpl, proteusMigrationRecoveryHandler: ProteusMigrationRecoveryHandler, coreCryptoCentralFactory: suspend (String, ByteArray) -> CoreCryptoCentral = { root, key -> coreCryptoCentral(root, key) }) : ProteusClientProvider, CryptoBackupExporter

Constructors

Link copied to clipboard
constructor(rootProteusPath: String, userId: UserId, passphraseStorage: PassphraseStorage, currentClientIdProvider: CurrentClientIdProvider, dispatcher: KaliumDispatcher = KaliumDispatcherImpl, proteusMigrationRecoveryHandler: ProteusMigrationRecoveryHandler, coreCryptoCentralFactory: suspend (String, ByteArray) -> CoreCryptoCentral = { root, key -> coreCryptoCentral(root, key) })

Functions

Link copied to clipboard
open suspend override fun clearLocalFiles()
Link copied to clipboard
open suspend override fun close()
Link copied to clipboard
open suspend override fun exportCryptoDB(exportPath: String): Either<CoreFailure, CryptoBackupMetadata>

Exports the cryptographic database to the specified path and returns the metadata required for backup restoration.

Link copied to clipboard
open suspend override fun getOrCreate(): ProteusClient

Returns the ProteusClient or creates new one if doesn't exists.

Link copied to clipboard
open suspend override fun getOrError(): Either<CoreFailure, ProteusClient>

Returns the ProteusClient, retrieves it from local files or returns a failure if local files doesn't exist.

Link copied to clipboard
internal fun ProteusClientProvider.guardedBy(access: AccountResourceAccess?): ProteusClientProvider

Admit before taking provider mutexes, so handoff never waits on a caller queued behind it.