Package live. ditto
Types
Ditto
is the entry point for accessing Ditto-related functionality in the Android SDK.
Represents an attachment and can be used to insert the associated attachment into a document at a specific key.
These objects are returned by calls to fetchAttachment
on DittoCollections.
The different events that can occur in relation to an attachment fetch.
Typically this will only be used if interacting with the SDK from Java. You can call fetchAttachment
with an attachment token and an object that implements this interface.
The different types of DittoAttachmentFetchEvent.
Serves as a token for a specific attachment that you can pass to a call to fetchAttachment
on a DittoCollection.
Provides feedback to the developer about Ditto authentication status.
Provides info about the authentication status.
Typically this will only be used if interacting with the SDK from Java. You can call observeStatus()
with an object that implements this interface.
Log in to a remote authentication service, using an OnlineWithAuthentication
or an Online
identity.
Base class for accessing Ditto-related functionality in the Android and Java SDKs. Use the Ditto
class for your platform to create an instance.
The callback
property of Ditto instances can be set to be an object that implements this interface.
A reference to a collection in a DittoStore.
Typically this will only be used if interacting with the SDK from Java. You can call observe
or observeLocal
with an object that implements this interface.
Provides information about the changes that have occurred in relation to an event delivered when observing the collections in a DittoStore
. It contains information about the collections that are known as well as the collections that were previously known in the previous event, along with information about what collections have been inserted, deleted, updated, or moved since the last event.
Typically this will only be used if interacting with the SDK from Java. You can call observeWithNextSignal
or observeLocalWithNextSignal
with an object that implements this interface.
The priority with which the local device should reach out to particular remote peers in the Ditto mesh.
Container for a number. See DittoMutableCounter which can be incremented and decremented.
An interface describing the dependencies required to initialise a Ditto instance.
A document belonging to a DittoCollection with an inner value.
An identifier for a DittoDocument.
Provides an interface to specify a path to a key in a document ID that you can then call a function on to get the value at the specified key as a specific type. You obtain a DittoDocumentIDPath by subscripting a DittoDocumentID and you can then further subscript a DittoDocumentIDPath to further specify the key of the document ID that you want to get the value of.
Provides an interface to specify a path to a key in a document that you can then call a function on to get the value at the specified key as a specific type. You obtain a DittoDocumentPath by subscripting a DittoDocument and you can then further subscript a DittoDocumentPath to further specify the key of the document that you want to get the value of.
All errors that are thrown by the Ditto SDK are wrapped as a DittoError
. It wraps multiple different types of error that each have an associated reason.
Upcoming SDK features made available for prototyping.
The various identity configurations that you can use when initializing a Ditto instance.
The type that is returned when calling observe
on a DittoCollection object. It handles the logic for calling the event handler that is provided to the observe
call.
Typically this will only be used if interacting with the SDK from Java. You can call observe
or observeLocal
with an object that implements this interface.
Describes the different types of event that you can receive when dealing with live queries.
Describes the index in a list of documents that a document was previously found at (from
) and the index that it can now be found at (to
).
Typically this will only be used if interacting with the SDK from Java. You can call observeWithNextSignal
or observeLocalWithNextSignal
with an object that implements this interface.
Typically this will only be used if interacting with the SDK from Java. You can call setCustomLogCallback
with an object that implements this interface.
This is an interface allowing to shim / wrap a call to ditto_log
from the dittoffi
.
Main singleton (global instance) to tweak the behavior of Ditto's logging infrastructure.
Typically this will only be used if interacting with the SDK from Java. You can call loginWithToken
or loginWithCredentials
with an object that implements this interface.
Typically this will only be used if interacting with the SDK from Java. You can call logout
with an object that implements this interface.
Container for a number that can be incremented and decremented.
This is used as part of update operations for documents. It provides access to updating a document through a subscript-based API. A subscript operation returns a DittoMutableDocumentPath that you can then use to chain further subscript operations to in order to access nested values in a document. Once you've defined the path to a key in a document that you'd like to update, by using subscripts, then you can use the functionality defined on DittoMutableDocumentPath to perform the desired document update(s). Note that objects of this type should only be used within the scope of the update closure that they are provided in.
Provides an interface to specify a path to a key in a document that you can then call various update functions on. You obtain a DittoMutableDocumentPath by subscripting a DittoMutableDocument and you can then further subscript a DittoMutableDocumentPath to further specify the key of the document that you want to update.
Typically this will only be used if interacting with the SDK from Java. You can call update
with an object that implements this interface.
Represents a mutable CRDT register that can be updated while updating a document. This class can't be instantiated directly, it's returned automatically for any register property within an update block. See also the register
properties of DittoDocumentPath and DittoMutableDocumentPath.
Represents a mutable CRDT Replicated Growable Array (DittoRGA) that can be updated as part of updating a document.
Provides feedback to the developer about Ditto authentication status.
A token returned by observePeers()
and observePeersV2()
. Call close()
to unsubscribe this handler.
Typically this will only be used if interacting with the SDK from Java. You can call observePeers
on a Ditto instance with an object that implements this interface.
A token returned by observePeers()
. Call close()
to unsubscribe this handler.
A token returned by observePeersV2()
. Call close()
to unsubscribe this handler.
Typically this will only be used if interacting with the SDK from Java. You can call observePeersV2
on a Ditto instance with an object that implements this interface.
These objects are returned when calling collections()
on DittoStore
.
These objects are returned when using find
-like functionality on DittoCollections. They allow chaining of further query-related functions to do things like add a limit to the number of documents you want returned or specify how you want the documents to be sorted and ordered. You can either call exec
on the object to get an array of DittoDocuments as an immediate return value, or you can establish either a live query or a subscription, which both work over time. A live query, established by calling observe
, will notify you every time there's an update to a document that matches the query you provided in the preceding find
-like call. A subscription, established by calling subscribe
, will act as a signal to other peers that the device connects to that you would like to receive updates from them about documents that match the query you provided in the preceding find
-like call. Calling observe
will generate both a subscription and a live query at the same time. If you'd like to only observe local changes then you can call observeLocal
. Update and remove functionality is also exposed through this object.
These objects are returned when using findByID
functionality on DittoCollections. You can either call exec
on the object to get an immediate return value, or you can establish either a live query or a subscription, which both work over time. A live query, established by calling observe
, will notify you every time there's an update to the document with the ID you provided in the preceding findByID
call. A subscription, established by calling subscribe
, will act as a signal to other peers that you would like to receive updates from them about the document with the ID you provided in the preceding findByID
call. Calling observe
will generate both a subscription and a live query at the same time. If you'd like to only observe local changes then you can call observeLocal
. Update and remove functionality is also exposed through this object.
Container for a number. See DittoMutableCounter which can be incremented and decremented.
DittoScopedWriteTransaction exposes functionality that allows you to perform multiple operations on the store within a single write transaction.
The interface that you must implement with the third parameter provided to observeWithNextSignal
and observeLocalWithNextSignal
calls.
Typically this will only be used if interacting with the SDK from Java. You can call observe
or observeLocal
with an object that implements this interface.
Provides information about a live query event relating to a single document live query.
Typically this will only be used if interacting with the SDK from Java. You can call observeWithNextSignal
or observeLocalWithNextSignal
with an object that implements this interface.
Typically this will only be used if interacting with the SDK from Java. You can call update
with an object that implements this interface.
Describes the direction when sorting a query.
Provides access to DittoCollections and a write transaction API.
While DittoSubscription objects remain in scope they ensure that documents in the collection specified and that match the query provided will try to be kept up-to-date with the latest changes from remote peers.
Describes the result of an update operation performed on a DittoMutableDocument
.
Defines the various strategies available when inserting a document into a collection.
DittoWriteTransaction exposes functionality that allows you to perform multiple operations on the store within a single write transaction. You must use the scoped
function to get collection-scoped access to the write transaction object, which will then allow you to perform insert, update, remove or evict operations using the write transaction.
Typically this will only be used if interacting with the SDK from Java. You can call write
on a DittoStore instance with an object that implements this interface.
These objects are returned when using find
-like functionality on DittoScopedWriteTransactions. You can use them to perform updates on a document and remove or evict a document.
These objects are returned when using findByID functionality on DittoScopedWriteTransactions. You can use them to perform updates on a document and remove or evict a document.
Describes one part of the result of a write transaction.