HiveAtClientStorage class
The default storage: a Hive keystore and sync queue under storagePath.
Opening one also takes in this atSign's sync queue from where an earlier release may have left it: those releases opened the queue on Hive's global instance, which put it in whichever directory that instance last pointed at, another atSign's store or a directory the app gave Hive. A stray queue is found in a directory this process has opened a store in, or the one Hive's global instance pointed at before this store opened; a store that opens holding another atSign's stray queue hands it to that atSign's open store. One that cannot be read is left where it is, with a warning, and the store opens without it.
- Inheritance
-
- Object
- AtClientStorageBase
- HiveAtClientStorage
Constructors
- HiveAtClientStorage({required String atSign, required String storagePath, bool closedByClient = false})
Properties
- atSign → String
-
final
- bundle → AtPersistenceBundle?
-
The persistence bundle, or
nullbefore the first attach.no setter - closedByClient → bool
-
Whether the client that attaches to this storage closes it on AtClient.stop.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isAttached → bool
-
no setterinherited
-
keyStore
→ AtKeyValueStore<
String, AtData, AtMetaData?> -
no setteroverride
- location → String
-
The store this points at: the canonical directory
HiveInstances.forPathresolves the instance by, plus the atSign the box is named from. Both halves are needed — two atSigns under one directory are two boxes and share nothing, while one atSign under one directory is a single box however many of these point at it. Resolved on first use and kept, so a close after the directory has gone writes nothing.no setteroverride - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- storagePath → String
-
final
- syncQueue → AtSyncQueue
-
no setteroverride
Methods
-
adoptStrayQueueIn(
String directory) → Future< void> -
Takes in this atSign's stray queue in
directory, as opening does. -
attach(
AtClient owner) → Future< void> -
Claims this storage for
owner.inherited -
clear(
) → Future< void> -
Empties keystore and queue and forgets the last principal. Idempotent.
inherited
-
clearData(
) → Future< void> -
Empties keystore and queue.
override
-
close(
) → Future< void> -
Closes the backend. Idempotent.
inherited
-
closeBackend(
) → Future< void> -
Closes the backend. Called at most once, by close.
override
-
detach(
AtClient owner) → Future< void> -
Drops
owner's claim, keeping the backend open.inherited -
forgetPrincipal(
) → Future< void> -
Forgets which principal last held this storage, keeping the data.
inherited
-
isHeldBy(
AtClient client) → bool -
Whether
clientis the one currently holding this storage.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
openBackend(
) → Future< void> -
Opens the backend. Idempotent.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited