Webcom Android SDK Public API Reference / com.orange.webcom.sdkv2.datasync / DatasyncManager

DatasyncManager

class DatasyncManager

Handles a set of subscriptions to data nodes and authentication events.

This class is intended to work with UI views in the way that it can cancel all handled subscriptions as soon as the associated view is disposed (see the unsubscribeFromAllEvents method). Instances must be built using the DatasyncService.createManager method.

Properties

policy

val policy: SubscriptionCancellationPolicy

The SubscriptionCancellationPolicy associated with this DatasyncManager instance, which controls the management of cached data when subscriptions are cancelled.

service

val service: DatasyncService

The DatasyncService instance associated with this DatasyncManager instance.

Functions

div

operator fun div(path: String): DatasyncNode

Shortcut for the node method.

node

fun node(path: String): DatasyncNode

Gets a DatasyncNode at a given path.

subscribeToStateChange

fun subscribeToStateChange(callback: (DatasyncState) -> Unit): Subscription

Subscribes to the DatasyncState of the DatasyncService associated with this DatasyncManager instance, and calls asynchronously the given callback each time this state changes.

unsubscribeFromAllEvents

fun unsubscribeFromAllEvents(): Unit

Cancels all the subscriptions managed by this DatasyncManager instance. These includes the ones created using the DatasyncNode.subscribe and subscribeToStateChange methods.