SyncMapJava

SyncMap is a key-value store with Strings as keys and arbitrary JSON objects as values.

You can add, remove and modify values associated with the keys.

To obtain an instance of a SyncMapJava use SyncClientJava.maps

Types

Link copied to clipboard
data class Item(val key: String, val jsonData: String, val dateCreated: Long, val dateUpdated: Long, val dateExpires: Long?)

Represents a value associated with each key in SyncMapJava.

Link copied to clipboard
interface Listener

Listener for all operations on a SyncMapJava.

Properties

Link copied to clipboard
abstract val dateCreated: Long

A date when this SyncMapJava was created.

Link copied to clipboard
abstract val dateExpires: Long?

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

Link copied to clipboard
abstract val dateUpdated: Long

A date when this SyncMapJava was last updated.

Link copied to clipboard
abstract val isFromCache: Boolean

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

Link copied to clipboard
abstract val isRemoved: Boolean

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

Link copied to clipboard
abstract val sid: String

An immutable system-assigned identifier of this SyncMapJava.

Link copied to clipboard

Current subscription state.

Link copied to clipboard
abstract val uniqueName: String?

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

Functions

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

Method to add listener for this SyncMapJava.

Link copied to clipboard
abstract fun close()

Close this SyncMapJava.

Link copied to clipboard
abstract fun getItem(itemKey: String, callback: SuccessListener<SyncMapJava.Item?>): CancellationToken

Retrieve Item from the SyncMapJava.

Link copied to clipboard
abstract fun mutateItem(itemKey: String, mutator: SyncMutator, callback: SuccessListener<SyncMapJava.Item>): CancellationToken

Mutate value of the Item using provided Mutator function.

Link copied to clipboard
abstract fun mutateItemWithTtl(itemKey: String, ttlSeconds: Long, mutator: SyncMutator, callback: SuccessListener<SyncMapJava.Item>): CancellationToken

Mutate value of the Item using provided Mutator function.

Link copied to clipboard

Retrieve all items from the SyncMap.

open fun queryItems(startKey: String, includeStartKey: Boolean): SyncIteratorJava<SyncMapJava.Item>
open fun queryItems(startKey: String?, includeStartKey: Boolean, queryOrder: <Error class: unknown class>): SyncIteratorJava<SyncMapJava.Item>
open fun queryItems(startKey: String?, includeStartKey: Boolean, queryOrder: <Error class: unknown class>, pageSize: Int): SyncIteratorJava<SyncMapJava.Item>
abstract fun queryItems(startKey: String?, includeStartKey: Boolean, queryOrder: <Error class: unknown class>, pageSize: Int, useCache: Boolean): SyncIteratorJava<SyncMapJava.Item>

Retrieve items from the SyncMapJava.

Link copied to clipboard
abstract override fun removeAllListeners()

Method to remove all listeners from this SyncMapJava.

Link copied to clipboard
abstract fun removeItem(itemKey: String, callback: SuccessListener<SyncMapJava>): CancellationToken

Remove Item from the SyncMapJava.

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

Method to Method to remove listener from this SyncMapJava.

Link copied to clipboard

Remove this SyncMapJava.

Link copied to clipboard
abstract fun setItem(itemKey: String, jsonData: String, callback: SuccessListener<SyncMapJava.Item>): CancellationToken

Set Item in the SyncMapJava.

Link copied to clipboard
abstract fun setItemWithTtl(itemKey: String, jsonData: String, ttlSeconds: Long, callback: SuccessListener<SyncMapJava.Item>): CancellationToken

Set Item in the SyncMapJava.

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

Set time to live for this SyncMapJava.