class DatasyncService : WebcomAbstractService
The WebcomAbstractService that makes it possible to interact in real time with the data of a Webcom application.
This service mainly provides ways to get/set/update the data and to subscribe to them in order to be notified in real time when they change. Instances of DatasyncService must be built using the WebcomApplication.datasyncService property.
val shouldBeConnected: Boolean
Indicates whether the DatasyncService tries to establish connection to the Webcom back end. |
|
val state: DatasyncState
Synchronously returns the current state of this DatasyncService. |
fun cleanOfflineCache(): Unit
Stops maintaining updates of data previously watched by cancelled subscriptions within the local cache. In other words, cleans from cache all data that are not currently watched by an active subscription. |
|
fun connect(): Unit
Sets shouldBeConnected to |
|
fun createManager(policy: SubscriptionCancellationPolicy = SubscriptionCancellationPolicy.KeepUpdatingDataWhenImplicit): DatasyncManager
Asks the DatasyncService to create a new DatasyncManager instance. The passed policy controls how the cached data is managed when subscriptions to data events (to be created using the DatasyncNode.subscribe method) are cancelled. |
|
fun disconnect(): Unit
Sets shouldBeConnected to |
|
fun isPresent(value: PresenceState?): Boolean
Indicates whether a value previously set by the startPublishingMyPresence method means that a user is present. |
|
fun offlineCache(): String
Retrieves the content of the current local cache content. It can then be saved somewhere and restored later at next app startup using WebcomConfiguration.offlineCache. |
|
fun startPublishingMyPresence(path: String): Unit
Starts maintaining a value at a given path that indicates in real time whether the user of the underlying WebcomApplication is connected and authenticated. |
|
fun stopPublishingMyPresence(): Unit
Stops maintaining the indicator of the user presence, previously started by the startPublishingMyPresence method. |