Home Reference Source Test
public class | source

DataObject

Main extension class for observers and reporters, with common properties and methods. Children management is common for observers and reporters.

Member Summary

Public Members
public get

All created children's since the subscription, doesn't contain all children's since reporter creation.

public get

Data structure to be synchronized.

public get

All Metadata about the Data Object

public get

schema: SchemaURL

Object schema URL (this field is not yet stable, and is subsject to change)

public get

status: Status

Status of the reporter or observer connection (this field is not yet stable, and is subsject to change)

public get

url: ObjectURL

Object URL of reporter or observer

Method Summary

Public Methods
public

addChild(children: String, initialData: JSON, identity: MessageBodyIdentity, input: SyncChildMetadata): Promise<DataObjectChild>

Create and add a DataObjectChild to a children collection.

public

onAddChild(callback: function(event: MsgEvent))

Setup the callback to process create and delete of childrens.

public

resumeChildrens(childrens: *)

Public Members

public get childrens: Object<ChildId, DataObjectChild> source

All created children's since the subscription, doesn't contain all children's since reporter creation.

public get data: JSON source

Data structure to be synchronized.

public get metadata: Object source

All Metadata about the Data Object

public get schema: SchemaURL source

Object schema URL (this field is not yet stable, and is subsject to change)

public get status: Status source

Status of the reporter or observer connection (this field is not yet stable, and is subsject to change)

public get url: ObjectURL source

Object URL of reporter or observer

Public Methods

public addChild(children: String, initialData: JSON, identity: MessageBodyIdentity, input: SyncChildMetadata): Promise<DataObjectChild> source

Create and add a DataObjectChild to a children collection.

Params:

NameTypeAttributeDescription
children String

Children name where the child is added.

initialData JSON

Initial data of the child

identity MessageBodyIdentity

(optional) identity data to be added to identity the user reporter. To be used for legacy identities.

input SyncChildMetadata

(optional) All additional metadata about the DataObjectChild.

Return:

Promise<DataObjectChild>

Return Promise to a new DataObjectChild.

public onAddChild(callback: function(event: MsgEvent)) source

Setup the callback to process create and delete of childrens.

Params:

NameTypeAttributeDescription
callback function(event: MsgEvent)

public resumeChildrens(childrens: *) source

Params:

NameTypeAttributeDescription
childrens *