android-components / mozilla.components.service.sync.logins / AsyncLoginsStorage

# AsyncLoginsStorage

`interface AsyncLoginsStorage : AutoCloseable` (source)

An interface equivalent to the LoginsStorage interface, but where operations are asynchronous.

### Functions

add | `abstract fun add(login: ServerPassword): Deferred<String>` Inserts the provided login into the database, returning it's id.
delete | `abstract fun delete(id: String): Deferred<Boolean>` Deletes the password with the given ID.
get | `abstract fun get(id: String): Deferred<ServerPassword?>` Fetches a password from the underlying storage layer by ID.
isLocked | `abstract fun isLocked(): Boolean` Returns `true` if the storage is locked, false otherwise.
list | `abstract fun list(): Deferred<List<ServerPassword>>` Fetches the full list of passwords from the underlying storage layer.
lock | `abstract fun lock(): Deferred<Unit>` Locks the logins storage.
reset | `abstract fun reset(): Deferred<Unit>` Deletes all locally stored login sync metadata.
sync | `abstract fun sync(syncInfo: SyncUnlockInfo): Deferred<Unit>` Synchronizes the logins storage layer with a remote layer.
touch | `abstract fun touch(id: String): Deferred<Unit>` Marks the login with the given ID as `in-use`.
unlock | `abstract fun unlock(encryptionKey: String): Deferred<Unit>` Unlocks the logins storage using the provided key.
update | `abstract fun update(login: ServerPassword): Deferred<Unit>` Updates the fields in the provided record.
wipe | `abstract fun wipe(): Deferred<Unit>` Deletes all locally stored login data. It is unlikely you need to use this.

### Inheritors

AsyncLoginsStorageAdapter | `open class AsyncLoginsStorageAdapter<T : LoginsStorage> : AsyncLoginsStorage, AutoCloseable` A helper class to wrap a synchronous LoginsStorage implementation and make it asynchronous.