SyncDocumentJava

SyncDocument is an arbitrary JSON value.

You can set, get and modify this value.

To obtain an instance of a SyncDocumentJava use SyncClientJava.documents

Types

Link copied to clipboard
interface Listener

Listener for all operations on a SyncDocumentJava.

Properties

Link copied to clipboard
abstract val dateCreated: Long

A date when this SyncDocumentJava was created.

Link copied to clipboard
abstract val dateExpires: Long?

A date this SyncDocumentJava will expire, null means will not expire.

Link copied to clipboard
abstract val dateUpdated: Long

A date when this SyncDocumentJava was last updated.

Link copied to clipboard
abstract val isFromCache: Boolean

true when this SyncDocumentJava is offline and doesn't receive updates from backend, false otherwise.

Link copied to clipboard
abstract val isRemoved: Boolean

true when this SyncDocumentJava has been removed on the backend, false otherwise.

Link copied to clipboard
abstract val jsonData: String

Value of the document as a serialized JSON object.

Link copied to clipboard
abstract val sid: String

An immutable system-assigned identifier of this SyncDocumentJava.

Link copied to clipboard

Current subscription state.

Link copied to clipboard
abstract val uniqueName: String?

An optional unique name for this document, assigned at creation time.

Functions

Link copied to clipboard
abstract override fun addListener(listener: SyncDocumentJava.Listener)

Method to add listener for this SyncDocumentJava.

Link copied to clipboard
abstract fun close()

Close this SyncDocumentJava.

Link copied to clipboard

Mutate value of the SyncDocumentJava using provided Mutator function. Once this method finished the jsonData property contains updated document data.

Link copied to clipboard
abstract fun mutateDataWithTtl(ttlSeconds: Long, mutator: SyncMutator, callback: SuccessListener<SyncDocumentJava>): CancellationToken

Mutate value of the SyncDocumentJava using provided Mutator function. Once this method finished the jsonData property contains updated document data.

Link copied to clipboard
abstract override fun removeAllListeners()

Method to remove all listeners from this SyncDocumentJava.

Link copied to clipboard
Link copied to clipboard
abstract override fun removeListener(listener: SyncDocumentJava.Listener)

Method to Method to remove listener from this SyncDocumentJava.

Link copied to clipboard
abstract fun setData(jsonData: String, callback: SuccessListener<SyncDocumentJava>): CancellationToken

Set value of the SyncDocumentJava as a serialized JSON object.

Link copied to clipboard
abstract fun setDataWithTtl(jsonData: String, ttlSeconds: Long, callback: SuccessListener<SyncDocumentJava>): CancellationToken

Set value of the SyncDocumentJava as a serialized JSON object.

Link copied to clipboard
abstract fun setTtl(ttlSeconds: Long, callback: SuccessListener<SyncDocumentJava>): CancellationToken

Set time to live for this SyncDocumentJava.