Datasync Node
Represents a data node within the tree-like data of a Webcom application.
This class provides basic methods to browse, read, write data nodes, as well as subscribe to some events at a data node. Instances of DatasyncNode are built using the DatasyncManager.node method.
Functions
cancelNextDisconnectionAction
Link copied to clipboard
fun cancelNextDisconnectionAction()
Content copied to clipboard
Cancels any previous write operation on this data node with the DatasyncTime.AtNextDisconnection policy.
clear
Link copied to clipboard
@JvmOverloads()
Content copied to clipboard
createChild
Link copied to clipboard
div
Link copied to clipboard
get
Link copied to clipboard
increment
Link copied to clipboard
@JvmOverloads()
Content copied to clipboard
Atomically increments the value at this data node by a given step.
merge
Link copied to clipboard
@JvmOverloads()
Content copied to clipboard
@JvmOverloads()
Content copied to clipboard
plusAssign
Link copied to clipboard
push
Link copied to clipboard
@JvmOverloads()
Content copied to clipboard
Creates a child of this data node with a unique key and writes a given value at it.
relativeNode
Link copied to clipboard
Returns the data done specified by a path relatively to the data node represented by this DatasyncNode instance.
runTransaction
Link copied to clipboard
@JvmOverloads()
Content copied to clipboard
set
Link copied to clipboard
@JvmOverloads()
Content copied to clipboard
@JvmOverloads()
Content copied to clipboard
subscribe
Link copied to clipboard
fun subscribe(type: Child, constraint: Constraint = Constraint.None, includesAcknowledgements: Boolean = false, callback: WebcomResultCallback<ChildEvent>): Subscription
Content copied to clipboard
Subscribes to a Child event with a given constraint on this data node and sends notifications to a callback function.
fun subscribe(type: ValueChanged.WithData, constraint: Constraint = Constraint.None, includesAcknowledgements: Boolean = false, callback: WebcomResultCallback<ValueChangedWithDataEvent>): Subscription
Content copied to clipboard
Subscribes to a ValueChanged.WithData event with a given constraint on this data node and sends notifications to a callback function.
fun subscribe(type: ValueChanged.WithoutData, constraint: Constraint = Constraint.None, includesAcknowledgements: Boolean = false, callback: WebcomResultCallback<ValueChangedWithoutDataEvent>): Subscription
Content copied to clipboard
Subscribes to a ValueChanged.WithoutData event with a given constraint on this data node and sends notifications to a callback function.
subscribeThroughNotifications
Link copied to clipboard
fun subscribeThroughNotifications(type: Type, duration: Duration, cipher: CryptoMethod = CryptoMethod.None, includesRevocation: Boolean = true, callback: WebcomResultCallback<Subscription>)
Content copied to clipboard
fun subscribeThroughNotifications(type: Type, expirationDate: Date? = null, cipher: CryptoMethod = CryptoMethod.None, includesRevocation: Boolean = true, callback: WebcomResultCallback<Subscription>)
Content copied to clipboard
Subscribes to a type of event on this data node until a given expirationDate and push notifications to the mobile device.
subscribeThroughWebhook
Link copied to clipboard
fun subscribeThroughWebhook(type: Type, identifier: String, context: String, duration: Duration, includesRevocation: Boolean = true, callback: WebcomResultCallback<Subscription>)
Content copied to clipboard
fun subscribeThroughWebhook(type: Type, identifier: String, context: String, expirationDate: Date? = null, includesRevocation: Boolean = true, callback: WebcomResultCallback<Subscription>)
Content copied to clipboard
Subscribes to a type of event on this data node until a given expirationDate and send notifications to a webhook.
Properties
key
Link copied to clipboard
Gives the key of the data node represented by this DatasyncNode instance, that is, the name of the last segment of its path.
parent
Link copied to clipboard
Gets the parent data node of this DatasyncNode instance.
path
Link copied to clipboard
Gives the path of the data node represented by this DatasyncNode instance.