Home Reference Source Test
public class | source

DataObjectsStorage

Constructor Summary

Public Constructor
public

constructor(storageManager: *, storedDataObjects: *)

Method Summary

Public Methods
public

delete(isReporter: Boolean, resource: DataObjectURL, attribute: String, data: any): *

public

deleteResource(resource: *): *

TODO: check if this process is viable because the storage manager ability to delete now the storageManager only can delete an specific key, but not the specific value inside that key;

public

getAll(): *

public

getDataObject(resource: DataObjectURL): *

public

getResourcesByCriteria(msg: Object, isReporter: Boolean): *

public

saveChildrens(isReporter: *, resource: *, attribute: *, value: *): *

public

saveData(isReporter: Boolean, resource: DataObjectURL, attribute: String, data: any): *

public

set(url: DataObjectURL, isReporter: Boolean, schema: SchemaURL, status: String, reporter: HypertyURL, subscription: Array<HypertyURL>, children: Array<DataObjectChild>, childrens: Array<String>, subscriberUser: Array<UserURL): *

public

update(isReporter: Boolean, resource: DataObjectURL, attribute: String, data: any): *

Public Constructors

public constructor(storageManager: *, storedDataObjects: *) source

Params:

NameTypeAttributeDescription
storageManager *
storedDataObjects *

Public Methods

public delete(isReporter: Boolean, resource: DataObjectURL, attribute: String, data: any): * source

Params:

NameTypeAttributeDescription
isReporter Boolean

the object to be saved is a reporter

resource DataObjectURL

dataObjectURL to be saved or updated;

attribute String

attribute inside the data which will be saved

data any

value will be saved inside the attribute;

Return:

*

public deleteResource(resource: *): * source

TODO: check if this process is viable because the storage manager ability to delete now the storageManager only can delete an specific key, but not the specific value inside that key;

Params:

NameTypeAttributeDescription
resource *

Return:

*

public getAll(): * source

Return:

*

public getDataObject(resource: DataObjectURL): * source

Params:

NameTypeAttributeDescription
resource DataObjectURL

the dataObjectURL will be searched

Return:

*

Promise<Object> object with the dataObject information;

public getResourcesByCriteria(msg: Object, isReporter: Boolean): * source

Params:

NameTypeAttributeDescription
msg Object

message would be analised to get the current dataObject information

isReporter Boolean

the object to be saved is a reporter

Return:

*

Promise<object> should retun an object with the dataObject or null

public saveChildrens(isReporter: *, resource: *, attribute: *, value: *): * source

Params:

NameTypeAttributeDescription
isReporter *
resource *
attribute *
value *

Return:

*

public saveData(isReporter: Boolean, resource: DataObjectURL, attribute: String, data: any): * source

Params:

NameTypeAttributeDescription
isReporter Boolean

the object to be saved is a reporter

resource DataObjectURL

dataObjectURL to be saved or updated;

attribute String

attribute inside the data which will be saved

data any

value will be saved inside the attribute;

Return:

*

public set(url: DataObjectURL, isReporter: Boolean, schema: SchemaURL, status: String, reporter: HypertyURL, subscription: Array<HypertyURL>, children: Array<DataObjectChild>, childrens: Array<String>, subscriberUser: Array<UserURL): * source

Params:

NameTypeAttributeDescription
url DataObjectURL

dataObjectURL to be saved;

isReporter Boolean

the object to be saved is a reporter

schema SchemaURL

the schema url

status String

the status of current dataObject

reporter HypertyURL

the Reporter hypertyURL

subscription Array<HypertyURL>

list of subscriptions

children Array<DataObjectChild>

list of childs of dataObjectURL

childrens Array<String>

list of childrens, like, 'chatmessage';

subscriberUser Array<UserURL

list of subscribed users;

Return:

*

public update(isReporter: Boolean, resource: DataObjectURL, attribute: String, data: any): * source

Params:

NameTypeAttributeDescription
isReporter Boolean

the object to be saved is a reporter

resource DataObjectURL

dataObjectURL to be saved or updated;

attribute String

attribute inside the data which will be saved

data any

value will be saved inside the attribute;

Return:

*