AtClientImpl class
Implementation of AtClient interface
- Implemented types
Constructors
- AtClientImpl(String _atSign, String? namespace, AtClientPreference preference)
Properties
- currentAtSign ↔ String?
-
getter/setter pair
- encryptionService → EncryptionService?
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- logger ↔ AtSignLogger
-
getter/setter pair
- preference → AtClientPreference?
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
delete(
AtKey atKey, {bool isDedicated = false}) → Future< bool> -
Delete the
key
from 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.namespaceAware
to false.isDedicated
need to be set to true to create a dedicated connectionoverride -
downloadFile(
String transferId, String? downloadPath}) → Future< List< File> > -
Downloads the list of files for a given
transferId
shared bysharedByAtSign
Optionally you can passdownloadPath
to download the files.override -
encryptUnEncryptedData(
) → Future< void> -
get(
AtKey atKey, {bool isDedicated = false}) → Future< AtValue> -
Get the value of
AtKey.key
from user's cloud secondary ifAtKey.sharedBy
is set. Otherwise looks up the key from local secondary. If the key was stored with public access, setAtKey.metadata.isPublic
to true. If the key was shared with another atSign setAtKey.sharedWith
isDedicated
need to be set to true to create a dedicated connectionoverride -
getAtKeys(
{String? regex, bool isDedicated = false}) → Future< List< AtKey> > -
Get all the keys stored in user's secondary in
AtKey
format. Ifregex
is specified only matching keys are returned. IfsharedBy
is specified, then gets the keys fromsharedBy
user shared with current atClient user. IfsharedWith
is specified, then gets the keys shared tosharedWith
user from the current atClient user.override -
getCurrentAtSign(
) → String? -
override
-
getKeys(
{String? regex, bool isDedicated = false}) → Future< List< String> > -
Get all the keys stored in user's secondary in string format. If
regex
is specified only matching keys are returned. IfsharedBy
is specified, then gets the keys fromsharedBy
user shared with current atClient user. IfsharedWith
is specified, then gets the keys shared tosharedWith
user 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? -
getPreferences(
) → AtClientPreference? -
override
-
getPrivateKey(
String atSign) → Future< String?> -
getRemoteSecondary(
{bool isDedicated = false}) → RemoteSecondary? -
Returns a singleton instance of RemoteSecondary to communicate with user's secondary server.
override
-
getSecondary(
{bool isDedicated = false}) → Secondary -
getSyncManager(
) → SyncManager? -
Returns a singleton instance of
SyncManager
that is responsible for syncing data between local secondary server and remote secondary server.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 = SYSTEM, bool isDedicated = false}) → Future< bool> -
Notifies the
AtKey
with thesharedWith
user of the atsign. Optionally, operation, value and metadata can be set along with key to notify.isDedicated
need to be set to true to create a dedicated connectionoverride -
notifyAll(
AtKey atKey, String value, OperationEnum operation, {bool isDedicated = false}) → Future< String> -
Notifies the
AtKey
with the list ofsharedWith
user's of the atsign. Optionally, operation, value and metadata can be set along with the key to notify.override -
notifyChange(
NotificationParams notificationParams) → Future< String?> -
Notifies the
NotificationParams.atKey
tonotificationParams.atKey.sharedWith
user of the atSign. Optionally, operation, value and metadata can be set along with key to 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}) → Future< bool> -
Updates value of
AtKey.key
is if it is already present. Otherwise creates a new key. SetAtKey.sharedWith
if the key has to be shared with another atSign. SetAtKey.metadata.isBinary
if 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.namespaceAware
to false. Additional metadata can be set usingAtKey.metadata
isDedicated
need to be set to true to create a dedicated connectionoverride -
putMeta(
AtKey atKey) → 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 setAtKey.metadata.namespaceAware
to false.override -
reuploadFiles(
List< File> files, FileTransferObject fileTransferObject) → Future<List< FileStatus> > -
sendStreamAck(
String streamId, String fileName, int fileLength, String senderAtSign, Function streamCompletionCallBack, Function streamReceiveCallBack) → Future< void> -
setPreferences(
AtClientPreference preference) → void -
Sets the preferences such as sync strategy, storage path etc., for the client.
override
-
startMonitor(
String privateKey, Function? notificationCallback, {String? regex}) → Future< void> -
Creates a monitor connection to atSign's cloud secondary server.Whenever a notification is created on the server, monitor receives
the notification on the client.
Optionally a regular expression and be passed to filter the notifications
override
-
stream(
String filePath, {String? namespace}) → Future< AtStreamResponse> -
Streams the file in
filePath
tosharedWith
atSign.override -
toString(
) → String -
A string representation of this object.
inherited
-
uploadFile(
List< File> files, ) → Future<Map< String, FileTransferObject> > -
Uploads list of
files
to filebin and shares the file download url withsharedWithAtSigns
returns map containing key of each sharedWithAtSign and value ofFileTransferObject
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
createClient(
String currentAtSign, String? namespace, AtClientPreference preferences) → Future< void> -
getClient(
String? currentAtSign) → Future< AtClient?> - Returns a new instance of AtClient. App has to pass the current user atSign and the client preference.