AtClientImpl class
Implementation of the AtClient interface.
- Implemented types
Properties
- atChops ↔ AtChops?
-
Set an instance of
AtChopsfor data encryption and signing operationsgetter/setter pairoverride - atSign → Atsign
-
no setteroverride
-
dataEvents
→ Stream<
DataEvent> -
Stream of
DataEvents —DataUpdatedfor every successful local keystore mutation that passes through the update path,DataDeletedfor every successful one that passes through the delete path. Subscribers see local app writes AND sync-applied remote changes via a single uniform stream. Internal-bookkeeping writes (e.g.putValue) intentionally do NOT emit — see theDataEventdartdoc.no setteroverride - encryptionService → EncryptionService?
-
no setteroverride
- enrollmentId ↔ String?
-
getter/setter pairoverride
- enrollmentService ↔ EnrollmentService?
-
getter/setter pairoverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- isStopped → bool
-
Whether this client has been stopped via AtClientManager.
no setteroverride
- localSecondary ↔ LocalSecondary?
-
getter/setter pair
- notificationService ↔ NotificationService
-
getter/setter pairoverride
-
pendingEmissions
→ Future<
void> -
Resolves once every event currently in-flight on dataEvents
has been delivered to all listeners. Useful for callers that
just performed a write and want to observe the resulting event
before continuing —
await atClient.pendingEmissionsgives "watch streams up-to-date" semantics without sync-emission's re-entrancy / listener-stalls-writer hazards.no setteroverride - persistenceBundle → AtPersistenceBundle?
-
The local persistence bundle backing this client, or
nullwhen local storage is not required or has not yet been initialised. Commit-log-free:persistenceBundle.keyValueStore.commitLogis alwaysnullon the client. Owned and torn down by the client; callers must not close it.no setteroverride - preference → AtClientPreference?
-
no setter
- putRequestTransformer ↔ PutRequestTransformer
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- syncService ↔ SyncService
-
getter/setter pairoverride
- telemetry ↔ AtTelemetryService?
-
getter/setter pairoverride
Methods
-
collection<
T> (String namespace, Duration defaultExpiration, {EventSource eventSource = EventSource.both, T fromJson(Map< String, dynamic> )?, String? typeTag, bool cleanupOrphansOnCreation = false}) → Future<AtCollection< T> > -
Returns an AtCollection of CItems for the given
namespace.override -
delete(
AtKey atKey, {bool isDedicated = false, DeleteRequestOptions? deleteRequestOptions}) → Future< bool> -
Delete the
keyfrom user's local secondary and syncs the delete to cloud secondary if client's sync preference is immediate. By default namespace that is used to create the AtClient instance will be appended to the key. phone@alice translates to phone.persona@alice where 'persona' is the namespace. If you want to ignoring the namespace setAtKey.metadata.namespaceAwareto false.override -
downloadFile(
String transferId, String? downloadPath}) → Future< List< File> > -
Downloads the list of files for a given
transferIdshared bysharedByAtSignOptionally you can passdownloadPathto download the files.override -
ensureLowerCase(
AtKey atKey) → dynamic -
executeUpdateOrDelete(
VerbBuilder builder, RemoteLocalPref prefForOp) → Future< String?> -
get(
AtKey atKey, {bool isDedicated = false, GetRequestOptions? getRequestOptions}) → Future< AtValue> -
Get the value of AtKey.key from user's cloud secondary if AtKey.sharedBy is set. Otherwise looks up the key from local secondary.
If the key was stored with public access, set
AtKey.metadata.isPublicto true. If the key was shared with another atSign set AtKey.sharedWithoverride -
getAtKeys(
{String? regex, bool showHiddenKeys = false, bool? useRemoteAtServer}) → Future< List< AtKey> > -
Get all the keys stored in user's secondary in AtKey format. If
regexis specified only matching keys are returned. IfsharedByis specified, then gets the keys fromsharedByuser shared with current atClient user. IfsharedWithis specified, then gets the keys shared tosharedWithuser from the current atClient user.override -
getCurrentAtSign(
) → String? -
Note - this method name is misleading as 'current' implies the atSign
could change - but an AtClient should only ever have one atSign.
override
-
getKeys(
{String? regex, bool showHiddenKeys = false, bool? useRemoteAtServer}) → Future< List< String> > -
Get all the keys stored in user's secondary in string format. If
regexis specified only matching keys are returned. IfsharedByis specified, then gets the keys fromsharedByuser shared with current atClient user. IfsharedWithis specified, then gets the keys shared tosharedWithuser from the current atClient user.override -
getLocalSecondary(
) → LocalSecondary? -
override
-
getMeta(
AtKey atKey, {bool isDedicated = false}) → Future< Metadata?> -
Gets the metadata of AtKey.key
override
-
getOperation(
dynamic value, Metadata? data) → String? -
getOTP(
) → Future< AtResponse> -
Returns an OTP (One-Time Password) from the secondary server.
override
-
getPreferences(
) → AtClientPreference? -
override
-
getPrivateKey(
String atSign) → Future< String?> -
getRemoteSecondary(
) → RemoteSecondary? -
Returns a RemoteSecondary to communicate with user's cloud secondary server.
override
-
keyExists(
AtKey key, bool? useRemoteAtServer) → Future< bool> -
Does a key exist
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notify(
AtKey atKey, String value, OperationEnum operation, {MessageTypeEnum? messageType, PriorityEnum? priority, StrategyEnum? strategy, int? latestN, String? notifier = AtConstants.system, bool isDedicated = false}) → Future< bool> -
Notifies the AtKey with the
sharedWithuser of the atsign. Optionally, operation, value and metadata can be set along with key to notify.override -
notifyAll(
AtKey atKey, String value, OperationEnum operation, {bool isDedicated = false}) → Future< String> -
Notifies the AtKey with the list of
sharedWithuser's of the atsign. Optionally, operation, value and metadata can be set along with the key to notify.override -
notifyChange(
NotificationParams notificationParams) → Future< String?> -
Deprecated Use NotificationService.notify
override
-
notifyList(
{String? fromDate, String? toDate, String? regex, bool isDedicated = false}) → Future< String> -
Returns the list of received notifications of an atsign, Optionally, notifications can be filtered on from date, to date and regular expression
override
-
notifyStatus(
String notificationId) → Future< String> -
Returns the status of the notification
override
-
persistPrivateKey(
String privateKey) → Future< bool> -
persistPublicKey(
String publicKey) → Future< bool> -
put(
AtKey atKey, dynamic value, {bool isDedicated = false, PutRequestOptions? putRequestOptions}) → Future< bool> -
Updates value of AtKey.key is if it is already present. Otherwise creates a new key. Set AtKey.sharedWith if the key
has to be shared with another atSign. Set
AtKey.metadata.isBinaryif you are updating binary value e.g image,file. By default namespace that is used to create the AtClient instance will be appended to the key. phone@alice will be saved as phone.persona@alice where 'persona' is the namespace. If you want to save by ignoring the namespace setAtKey.metadata.namespaceAwareto false. Additional metadata can be set using AtKey.metadataoverride -
putBinary(
AtKey atKey, List< int> value, {PutRequestOptions? putRequestOptions}) → Future<AtResponse> -
Puts binary data (e.g. images, files etc.) into the keystore.
override
-
putMeta(
AtKey atKey, {PutRequestOptions? putRequestOptions}) → Future< bool> -
Updates the metadata of AtKey.key if it is already present. Otherwise creates a new key without a value.
By default namespace that is used to create the AtClient instance will be appended to the key. phone@alice will be saved as
phone.persona@alice where 'persona' is the namespace. If you want to save by ignoring the namespace set
AtKey.metadata.namespaceAwareto false.override -
putText(
AtKey atKey, String value, {PutRequestOptions? putRequestOptions}) → Future< AtResponse> -
Puts text data into the keystore.
override
-
reuploadFiles(
List< File> files, FileTransferObject fileTransferObject) → Future<List< FileStatus> > -
re uploads file in
fileTransferObject.fileUrlreturns list ofFileStatuswhich contains upload status of each file.override -
sendStreamAck(
String streamId, String fileName, int fileLength, String senderAtSign, Function streamCompletionCallBack, Function streamReceiveCallBack) → Future< void> -
Sends stream acknowledgement
override
-
setPreferences(
AtClientPreference preference) → void -
Sets the preferences such as sync strategy, storage path etc., for the client.
override
-
setSPP(
String spp, {Duration? expiry}) → Future< AtResponse> -
Sets a Semi Permanent Passcode (SPP) in the secondary server
key-store. An SPP is a 6-character alphanumeric code used when
submitting an enrollment request. Only connections with access
to the "__manage" namespace are allowed to set an SPP.
override
-
re sends file notifications to
sharedWithAtSignsreturns Map<String, FileTransferObject> which contains transfer status for each atsign.override -
start(
) → Future< void> -
startCompactionJob(
{Duration? commitLogCompactionDuration}) → Future< void> -
No longer does anything; retained for source compatibility.
override
-
startMonitor(
String privateKey, Function? notificationCallback, {String? regex}) → Future< void> -
Deprecated Use AtClient.notificationService
override
-
stop(
) → Future< void> -
Stops all background services for this atSign: cancels the
keystore-event timers, closes the data-event stream, and stops the sync
and notification services and the remote secondary connection.
override
-
stopCompactionJob(
) → Future< void> -
No longer does anything; retained for source compatibility.
override
-
stream(
String filePath, {String? namespace}) → Future< AtStreamResponse> -
Streams the file in
filePathtosharedWithatSign.override -
toString(
) → String -
A string representation of this object.
inherited
-
uploadFile(
List< File> files, ) → Future<Map< String, FileTransferObject> > -
Uploads list of
filesto filebin and shares the file download url withsharedWithAtSignsreturns map containing key of each sharedWithAtSign and value ofFileTransferObjectoverride
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- atClientInstanceMap → Map
-
final
- upperCaseRegex → RegExp
-
final
Static Methods
-
create(
String currentAtSign, String? namespace, AtClientPreference preferences, {AtClientManager? atClientManager, RemoteSecondary? remoteSecondary, EncryptionService? encryptionService, AtKeyValueStore< String, AtData, AtMetaData?> ? localSecondaryKeyStore, AtChops? atChops, AtLookUp? atLookUp, String? enrollmentId}) → Future<AtClient>