at_client library

Classes

AndPredicate
Conjunction. All children must hold. Flattens on construction via Predicate.and so chains don't build a left-leaning tree.
AtBuffer<T>
Class holder for message of different data types(int, String etc.,)
AtBytes
Wrapper class for handling base64 encoded byte data
AtChainedException
AtClient
Interface for a client application that can communicate with a secondary server.
AtClientImpl
Implementation of the AtClient interface.
AtClientManager
Factory class for creating AtClient, SyncService and NotificationService instances
AtClientPreference
Class to hold attributes for client preferences. Set the preferences for your application and pass it to AtClientManager.setCurrentAtSign.
AtClientTelemetryConsumer
AtClientTelemetryService
Telemetry Service for an AtProtocol client (i.e. emitter of atProtocol verb commands)
AtClientUtil
AtCollection<T>
AtCollectionModel<T>
AtCollectionModelFactory<T extends AtCollectionModel>
AtCollectionModelFactoryManager
AtCollectionModelOperations<T>
Contains CRUD operations that can be performed on AtCollectionModel
AtCollectionModelStreamOperations
AtCollectionModel sets the base structure of the model that is used to interact with collection methods.
AtCollectionQueryOperations
Contains query methods on AtCollectionModel
AtConstants
AtExceptionManager
AtExceptionManager is responsible for creating instances of the appropriate exception classes for a given exception scenario.
AtExceptionStack
Class to maintain stack of exceptions to form a chained exception.
AtExceptionUtils
Utility class that returns instance of exception for the given error code.
AtJsonCollectionModel
AtJsonCollectionModelFactory
AtKey
AtKeyValidator
Validates String representation of a AtKey For example String representation of a public key PublicKey will be public:phone.wavi@bob
AtKeyValidators
Returns an instance of AtKeyValidator
AtNotification
AtOperationItemStatus
AtRootDomain
AtRpc
A simple rpc request-response abstraction which uses atProtocol notifications under the hood.
AtRpcCallbacks
The callbacks which the creator of the AtRpc object needs to provide
AtRpcClient
AtRpcReq
Simple data structure whose JSON is transmitted as the payload of the notification which is sent from the requester to the responder
AtRpcResp
Simple data structure whose JSON is transmitted as the payload of the notification which is sent by the responder back to the requester
AtServerEvent
Events which are generated by an atServer. Initial example is the AtSignPKChangedEvent but we want to allow for others in future.
AtServiceFactory
Abstraction over the construction of the core services managed by AtClientManager.
AtSignPKChangedEvent
This event is specific to when the 'public:publickey@alice' key changes.
AtTelemetryEvent
Concrete AtTelemetryItem subclass for Events - e.g. SyncStarted, NetworkUnavailable, MonitorUnavailable
AtTelemetryItem
Generic telemetry datum
AtTelemetrySample
Concrete AtTelemetryItem subclass for Samples - e.g. KeyStoreSize, DataReceived, DataTransmitted
AtTelemetryService
Simple software telemetry service. See https://en.wikipedia.org/wiki/Telemetry#Software
AtValue
BatchRequest
BatchResponse
ByteBuffer
CAncestor
A single link in a sub-item's parent chain.
CEvent
Base class for everything emitted on an AtCollection's event streams.
CItem<T>
A single typed record in an AtCollection. Wraps an application's domain object of type T together with Atsign Protocol object metadata:
CItemAvailable
Fires when a scheduled item's availableAt time passes — i.e. an item written with availableAt in the future has just become visible on the wire. Carries the item's owner + id so the listener can refetch it via AtCollection.getOrNull.
CItemDeleted
CItemExpiringSoon
Fires leadTime before an item's expiresAt. Useful for reminder / alarm UIs that need to nudge the user before a record disappears (the atServer expires items hard at expiresAt, so once that moment arrives the record is already gone).
CItemUpdated
CmpPredicate
Leaf comparison predicate produced by PathField operators. Carries the field, op, and value publicly so a future indexed executor can pattern-match.
ConflictInfo
ConnectivityListener
@Deprecated Will be removed in a future release. Please use a connectivity checker of your own choice in your application code
CReadReceipt
Fires when a remote atSign posts a receipt for an item we can observe. owner + id identify the PARENT item being read (the thing the receipt is about — not the receipt sub-item itself), so they match the owner + id of the corresponding CItem. from is the reader; readAt is the moment the notification was received (not the moment the reader wrote it).
CSubItemDeleted
CSubItemUpdated
DataDeleted
A keystore record was removed.
DataEvent
Event emitted on AtClient.dataEvents whenever a keystore mutation passes through LocalSecondary's chokepoint methods (_update / _delete). Subscribers see every change driven by this client — local app writes AND sync-applied remote changes — in a single uniform stream.
DataUpdated
A keystore record was created or updated. Carries the metadata constructed from the UpdateVerbBuilder that drove the write so listeners (e.g. an event-driven expiry timer) can read expiresAt without re-fetching the record.
DefaultAtServiceFactory
DeleteRequestOptions
Parameters that application code can optionally provide when calling AtClient.delete
EncryptionUtil
Enrollment
Class represents the enrollment details
EnrollmentConstants
EnrollmentListRequestParam
Class to store request parameters while fetching a list of enrollments
EnrollmentService
EnrollmentService contains methods to fetch the enrollment details and methods to perform operations on the enrollments.
EnrollParams
GetRequestOptions
Parameters that application code can optionally provide when calling AtClient.get
IterableKeyStream<T>
Class to expose a stream of Iterable<AtKey> based on the provided query parameters
KeyFormatValidation
Validates if the Key adheres to a format represented by a regex
KeyInfo
KeyLengthValidation
Validates key length of a key
KeyMaker
KeyOwnershipValidation
Validates if the ownership is right for a given key type
KeyShareValidation
Validates if key is rightly shared
KeyStream<T>
Class to expose a stream of AtKey based on the provided query parameters
ListKeyStream<T>
Class to expose a stream of List<AtKey> based on the provided query parameters
LocalKey
Represents a local key Local key are confined to the client(device)/server it is created. The key does not sync between the local-secondary and the cloud-secondary.
LocalSecondary
Contains methods to execute verb on local secondary storage using executeVerb Set AtClientPreference.isLocalStoreRequired to true and other preferences that your app needs. Delete and Update commands will be synced to the server
MapKeyStream<K, V>
Class to expose a stream of Map<AtKey> based on the provided query parameters
Metadata
NotificationConfig
The configurations for the Notification listeners
NotificationParams
NotificationParams represents a notification input params.
NotificationResult
NotificationResult encapsulates the notification response
NotificationService
NotPredicate
Negation. Double-negation collapses via Predicate.not.
ObjectLifeCycleOptions
OpFailure
OpResult
OpSuccess
OrPredicate
Disjunction. At least one child must hold. Flattens via Predicate.or.
PathField<V>
A typed, introspectable accessor for one field on a CItem<T>. Pair with Query.wherePath / PathField.eq etc. to build a Predicate the library can both evaluate and inspect.
Predicate
Root of the typed-predicate AST. Mint with the operator methods on PathField (e.g. field.eq(value)); compose with and / or / not. Pass to Query.wherePath to apply.
PrivateKey
Obsolete, was never used
PublicKey
Represents a public key.
PublicKeyHash
Represents hash of an atsign's public encryption key and the hashing algorithm used
PutRequestOptions
Parameters that application code can optionally provide when calling AtClient.put
Query<T>
A composable, value-typed query over an AtCollection<T>. Build up a query with where / orderBy / thenBy / limit / skip, then terminate with get (one-shot) or watch (live reactive).
Regexes
RegexesNonMandatoryNamespace
RegexesWithMandatoryNamespace
RegexUtil
RemoteSecondary
Contains methods used to execute verbs on remote secondary server of the atSign.
RequestOptions
Parameters that application code can optionally provide when calling AtClient.get, AtClient.put and AtClient.delete methods
ReservedEntityValidation
Verifies if the key belongs to reserved key list.
ResolutionContext
Response
SecureSocketConfig
class to store configuration to create a security context while creating secure sockets
SelfKey
Represents a Self key.
SetKeyStream<T>
Class to expose a stream of Set<AtKey> based on the provided query parameters
SharedKey
Represents a key shared to another atSign.
StringBuffer
SubSpec<U>
Immutable description of one level in a sub-collection tree. Used with Query.watchWithTree to declare a parent → children → ... shape that the library will live-orchestrate.
SyncEntry
SyncProgress
SyncProgressListener
SyncRequest
SyncResult
SyncService
SyncTelemetryEvent
TreeNode<T>
One node in the snapshot returned by Query.watchWithTree. Carries the parent CItem<T> and the per-sub-collection branches — each branch keyed by its SubSpec.subName and holding the current list of children at that level (which are themselves TreeNodes, recursing all the way down).
Tuple<T1, T2>
UpdateParams
Validation
Implement a validation on a key
ValidationContext
Represents context of a validation See AtKeyValidator
ValidationResult
Represents outcome of a key validation See AtKeyValidator and AtConcreteKeyValidator
VerbSyntax
VerbUtil
WithChildren<P, C>
One row in the snapshot returned by Query.watchWithSub — a parent CItem<P> alongside the current list of its children CItem<C> from a single named sub-collection.

Enums

AtMessage
AtRpcRespType
The types of responses which the responder can send back to the requester
CollectionOp
EnrollmentStatus
EnrollOperationEnum
EventSource
Selects which underlying source(s) an AtCollection consumes its CItemUpdated / CItemDeleted / CSubItemUpdated / CSubItemDeleted events from.
ExceptionScenario
Intent
KeyType
MessageTypeEnum
NotificationListenerState
NotificationStatusEnum
Operation
OperationEnum
PkamAuthMode
PredicateOp
Comparison operator carried by a CmpPredicate. Stored as a value (rather than encoded in the subclass) so switch over op stays exhaustive at evaluation time and indexed-executor pushdown can pattern-match on it.
PriorityEnum
RegexGroup
Represents groups with in Regexes See Regexes
RemoteLocalPref
Default preference on how to handle get, put and delete requests with regards to use of local storage vs the remote atServer.
ReservedKey
ResolutionStrategy
SharedKeyStatus
StrategyEnum
SyncDirection
SyncRequestSource
Identifies the origin of a SyncRequest. Every sync request is idempotent — "what to push" is owned by LocalSecondary's AtSyncQueue, so requests are just "please drain" triggers that can be coalesced wholesale at end-of-round.
SyncStatus
Enum to represent the sync status.
SyncStrategy
SyncType

Extension Types

Atsign
A fully qualified atSign (e.g. @alice)
AtsignWithoutAt
An atSign without the "@" (e.g. alice)

Extensions

AtMessageExtension on AtMessage
AtsignString on String
CItemPrettyString on CItem
Multi-line human-readable dump of a CItem — useful for example-app logging and debugging. Reads at the call site as item.prettyString.
ComparablePathField on PathField<V>
<, <=, >, >= for fields whose value is Comparable.
NullablePathField on PathField<V?>
Null checks for fields whose declared value type is nullable. Declare the field as PathField<Foo?> to opt in.
NullCheck on String?
Extending the String class to check null and empty.
NullOrEmptyCheck on String?
Extending the String class to check null and empty.
ParseEncodingTypeToString on EncodingType
Parse EncodingType to String
RegexGroupToString on RegexGroup
SyncServiceWaitUntilCaughtUp on SyncService
Adds waitUntilCaughtUp to every SyncService without forcing existing implementers to add a method to satisfy a new abstract member. Implemented as an extension (not a method on SyncService or a mixin) so:

Constants

error_codes → const Map
error_description → const Map
jsonPrettyPrinter → const JsonEncoder
readReceiptNamespacePart → const String
Constant for the read-receipt sub-collection's reserved namespace part. Tests assert against this when constructing expected envelope keys.

Functions

clearFactoriesForTest() → void
Clears the process-global factory registry so tests can start from a known empty state. The registry is a static cache on AtCollection used by registerFactory / setUpFromAtSign; tests call this in setUp/tearDown to avoid cross-test pollution.
clearMissingFactoryWarningsForTest() → void
Clears the warned-tag set used to suppress repeated missing factory for type tag log lines.
cmpPredicateForTest(PathField field, PredicateOp op, Object? value) CmpPredicate
Builds a CmpPredicate with the given parts, bypassing the PathField operator path. Tests use this to exercise reserved PredicateOp values that don't yet have a corresponding operator.
collectionWithInjectedBoth<T>(AtClient atClient, String namespace, Duration defaultExpiration, {required Stream<AtNotification> notifications, required Stream<DataEvent> dataEvents, T fromJson(Map<String, dynamic>)?, String? typeTag}) AtCollection<T>
Constructs an AtCollection<T> on the EventSource.both path with both source streams injected: tests drive each path independently and assert un-deduplicated dual emission.
collectionWithInjectedDataEvents<T>(AtClient atClient, String namespace, Duration defaultExpiration, {required Stream<DataEvent> dataEvents, T fromJson(Map<String, dynamic>)?, String? typeTag}) AtCollection<T>
Constructs an AtCollection<T> with an injected DataEvent stream — the data-events analogue of collectionWithInjectedNotifications. Lets tests drive the EventSource.data path without a live LocalSecondary stream subscription.
collectionWithInjectedNotifications<T>(AtClient atClient, String namespace, Duration defaultExpiration, {required Stream<AtNotification> notifications, T fromJson(Map<String, dynamic>)?, String? typeTag}) AtCollection<T>
Constructs an AtCollection<T> with an injected notification stream — required so tests drive notification events without an active server connection. Callers supply notifications (typically a StreamController.broadcast() they own); the produced collection subscribes to it as if it were the live monitor stream.
convertCommitOpSymbolToEnum(String commitOpSymbol) → CommitOp
getEnrollOperation(EnrollOperationEnum? enrollOperationEnum) String
getEnrollStatusFromString(String value) EnrollmentStatus
getMessageType(MessageTypeEnum? messageTypeEnum) String
getOperationName(OperationEnum? d) String
getPriority(PriorityEnum? priorityEnum) String
getSharedKeyName(SharedKeyStatus d) String
getStrategy(StrategyEnum? strategyEnum) String
handleDataEventForTest(AtCollection coll, DataEvent event) Future<void>
Routes event through coll's data-event handler — the same entry point the live LocalSecondary subscription uses on the EventSource.data path.
handleNotificationForTest(AtCollection coll, AtNotification n) Future<void>
Routes n through coll's top-level notification handler — the same entry point the live monitor subscription uses.
handleObjNotificationForTest(AtCollection coll, AtNotification n) Future<void>
Routes n through coll's value-event branch directly — bypasses the regex dispatcher; tests exercise the value-handler in isolation.
handleSubObjNotificationForTest(AtCollection coll, AtNotification n) Future<void>
Routes n through coll's sub-collection-event branch directly.
openSubSpecForTest<T, U>(SubSpec<U> spec, AtCollection<T> parentColl, CItem<T> parentItem) AtCollection<U>
Opens spec on parentItem using parentColl's context. Test-only because the production call-site is hidden behind AtCollection.subCollection — the spec object isn't directly constructed by app code.
subCollectionWithInjectedNotifications<T, U>(AtCollection<T> parent, {required CItem<T> parentItem, required String subName, required Duration defaultExpiration, required Stream<AtNotification> notifications, U fromJson(Map<String, dynamic>)?, String? typeTag}) AtCollection<U>
Constructs a sub-collection of parent with an injected notification stream. Same semantics as collectionWithInjectedNotifications but for nested collections.

Typedefs

RpcRequestHandler = Future<AtRpcResp> Function(AtRpcReq request, String fromAtSign)

Exceptions / Errors

AtBufferOverFlowException
AtCertificateValidationException
Exception thrown when security certification validation on root or secondary server fails
AtClientException
AtConnectException
The class AtConnectException and its subclasses represent any issues that prevents an connection to the root or the secondary server
AtDecryptionException
AtEncryptionException
AtEnrollmentException
Exception thrown for enrollment related exceptions
AtEnrollmentRevokeException
Exception thrown when a client tries to revoke its own enrollment
AtException
The class AtException and its subclasses represents various exceptions that can arise while using the @ protocol.
AtInvalidEnrollmentException
Exception thrown when an Enrollment_id is expired or invalid
AtIOException
Exception thrown when there is any issue related to socket operations e.g read/write
AtKeyException
AtKeyNotFoundException
AtPrivateKeyNotFoundException
AtPublicKeyChangeException
AtPublicKeyNotFoundException
AtServerException
AtSigningException
Exception thrown for issues occurring during data signing or pkam signing operations.
AtSigningVerificationException
Exception thrown for issues occurring during data signing verification or pkam signing verification operations.
AtThrottleLimitExceeded
Exception thrown when the enrollment requests exceed the limit in the given time window
AtTimeoutException
Exception thrown when no response is received before the timeout duration
AtValueException
BlockedConnectionException
BufferOverFlowException
Exception thrown when data size passed to the socket is greater than configured buffer size
CollectionOpException
Thrown by AtCollection.create / AtCollection.update / AtCollection.delete when any key-level op failed. Inspect results for the per-key breakdown, or failures / firstFailure for the subset that went wrong.
ConnectionInvalidException
Thrown when trying to perform a read/write on a connection which is invalid
HandShakeException
Exception thrown when from-pol handshake fails between two secondary servers
IllegalArgumentException
Exception thrown when any parameter in a verb command is invalid
IllegalStateException
Exception thrown when a verb fails due to some state being not as expected
InboundConnectionLimitException
Thrown when current server's inbound connection limit is reached
InternalServerError
Thrown for any unhandled server error
InternalServerException
Thrown for any unhandled server exception
InvalidAtKeyException
Exception thrown when a key is invalid
InvalidAtSignException
Exception thrown when an atsign name provided is invalid.
InvalidDataException
Exception thrown when data provided to a method is invalid.
InvalidPinException
InvalidRequestException
Exception thrown when request to secondary server is invalid
InvalidResponseException
Exception thrown when response from secondary server is invalid e.g invalid json format
InvalidSyntaxException
Exception thrown when an @ protocol verb has an invalid syntax.
KeyNotFoundException
Exception thrown when AtKey.key is not present in the keystore
LookupException
Thrown when lookup fails after handshake
OutBoundConnectionInvalidException
Thrown when trying to perform a read/write on an outbound connection which is invalid
OutboundConnectionLimitException
Thrown when current server's outbound connection limit is reached
RootServerConnectivityException
Exception thrown when there is an issue connecting to root server
SecondaryConnectException
Exception thrown when an atsign's secondary url cannot be reached or is unavailable Should this be extending AtConnectException?
SecondaryNotFoundException
Exception thrown when the requested atsign's secondary url is not present in Root server
SecondaryServerConnectivityException
Exception thrown when there is an issue connecting to secondary server
SelfKeyNotFoundException
ServerIsPausedException
Thrown when a request is received on a connection while the server is paused
SharedKeyNotFoundException
UnAuthenticatedException
Thrown when trying to perform a verb execution which requires authentication
UnAuthorizedException
Exception thrown when a client tries to execute a verb or establish a connection but doesn't have the required permissions