Class: ServiceObject

ServiceObject

new ServiceObject(obj, container)

The Service Object
Parameters:
Name Type Description
obj Object A JSON object with the object definition
container Raptor reference to the Raptor sdk wrapper
Source:

Extends

Members

getObject

Overrides:
Source:

Methods

action(name) → {Action}

Return an action reference
Parameters:
Name Type Description
name String action name
Source:
Returns:
action requested action, if available
Type
Action

action(name) → {Action}

Return an action reference
Parameters:
Name Type Description
name String action name
Source:
Returns:
action requested action, if available
Type
Action

addChild(child) → {Promise}

Add a child
Parameters:
Name Type Description
child ServiceObject The object instance or id to add
Source:
Returns:
Promise of the request with a the list of children
Type
Promise

addChild(child) → {Promise}

Add a child
Parameters:
Name Type Description
child ServiceObject The object instance or id to add
Source:
Returns:
Promise of the request with a the list of children
Type
Promise

addStream(name, definition)

Add a stream to the object
Parameters:
Name Type Description
name String The stream name
definition Object The steam definition
Source:

addStream(name, definition)

Add a stream to the object
Parameters:
Name Type Description
name String The stream name
definition Object The steam definition
Source:

create() → {Promise}

Create a new Object instance
Source:
Returns:
object the newly created reference
Type
Promise

create() → {Promise}

Create a new Object instance
Source:
Returns:
object the newly created reference
Type
Promise

delete(Optional,) → {Promise}

Delete a Service Object
Parameters:
Name Type Description
Optional, String the objectId to delete
Source:
Returns:
Promise of the request with a new empty so as argument
Type
Promise

delete(Optional,) → {Promise}

Delete a Service Object
Parameters:
Name Type Description
Optional, String the objectId to delete
Source:
Returns:
Promise of the request with a new empty so as argument
Type
Promise

exportProperties()

Exposes setter and getter for a class from the `data` field
Overrides:
Source:

getChildren() → {Promise}

Get children
Source:
Returns:
Promise of the request with a the list of children
Type
Promise

getChildren() → {Promise}

Get children
Source:
Returns:
Promise of the request with a the list of children
Type
Promise

getClient() → {Client}

Return the client reference
Overrides:
Source:
Returns:
client
Type
Client

getContainer() → {Raptor}

Return the Raptor instance wrapper
Overrides:
Source:
Returns:
container Raptor instance reference
Type
Raptor

getCreatedAt() → {Number}

Source:
Returns:
createdAt The creation date as unix timestamp
Type
Number

getCreatedAt() → {Number}

Source:
Returns:
createdAt The creation date as unix timestamp
Type
Number

getId() → {String}

Source:
Returns:
id The object id
Type
String

getId() → {String}

Source:
Returns:
id The object id
Type
String

load(id) → {Promise}

Load the Object definition
Parameters:
Name Type Description
id String The object Id
Source:
Returns:
Promise of the request with the ServiceObject as argument
Type
Promise

load(id) → {Promise}

Load the Object definition
Parameters:
Name Type Description
id String The object Id
Source:
Returns:
Promise of the request with the ServiceObject as argument
Type
Promise

parseJSON(raw)

Parse a plain object and populate the corresponding fields in the current instance
Parameters:
Name Type Description
raw Object the json object
Overrides:
Source:

removeChild(child) → {Promise}

Remove a child
Parameters:
Name Type Description
child ServiceObject The object instance or id to remove
Source:
Returns:
Promise of the request with a the list of children
Type
Promise

removeChild(child) → {Promise}

Remove a child
Parameters:
Name Type Description
child ServiceObject The object instance or id to remove
Source:
Returns:
Promise of the request with a the list of children
Type
Promise

setActions(actions)

Set actions to the object
Parameters:
Name Type Description
actions Array The list of actions to set
Source:

setActions(actions)

Set actions to the object
Parameters:
Name Type Description
actions Array The list of actions to set
Source:

setChildren() → {Promise}

Set children
Source:
Returns:
Promise of the request with a the list of children
Type
Promise

setChildren() → {Promise}

Set children
Source:
Returns:
Promise of the request with a the list of children
Type
Promise

setContainer(container)

Parameters:
Name Type Description
container Raptor reference to Raptor instance wrapper
Overrides:
Source:

setServiceObject(object)

Set a reference to the parent object
Parameters:
Name Type Description
object ServiceObject reference to the parent object
Overrides:
Source:

setStreams(streams)

Set streams to the object
Parameters:
Name Type Description
streams Array The list of streams to set
Source:

setStreams(streams)

Set streams to the object
Parameters:
Name Type Description
streams Array The list of streams to set
Source:

stream(name) → {Stream}

Return a stream reference
Parameters:
Name Type Description
name String stream name
Source:
Returns:
stream requested stream, if available
Type
Stream

stream(name) → {Stream}

Return a stream reference
Parameters:
Name Type Description
name String stream name
Source:
Returns:
stream requested stream, if available
Type
Stream

subscribe(cb) → {EventEmitter}

Subscribe for Service Object updates
Parameters:
Name Type Description
cb ServiceObjectOnEvent The callback that handles an event notification
Source:
Returns:
An emitter that will notify of updates
Type
EventEmitter

subscribe(cb) → {EventEmitter}

Subscribe for Service Object updates
Parameters:
Name Type Description
cb ServiceObjectOnEvent The callback that handles an event notification
Source:
Returns:
An emitter that will notify of updates
Type
EventEmitter

toJSON() → {Object}

Convert the instance to a js object
Overrides:
Source:
Returns:
Plain js object
Type
Object

toString() → {String}

Return a JSON string of this object
Overrides:
Source:
Returns:
json stringified JSON
Type
String

unsubscribe()

Unsubscribe from Service Object updates
Source:

unsubscribe()

Unsubscribe from Service Object updates
Source:

update() → {Promise}

Update an Object
Source:
Returns:
Promise of the request with the ServiceObject as argument
Type
Promise

update() → {Promise}

Update an Object
Source:
Returns:
Promise of the request with the ServiceObject as argument
Type
Promise

validate() → {void}

Validate the object and throw an exception if fails
Overrides:
Source:
Returns:
Type
void

ServiceObject

new ServiceObject(obj, container)

The Service Object
Parameters:
Name Type Description
obj Object A JSON object with the object definition
container Raptor reference to the Raptor sdk wrapper
Source:

Extends

Members

getObject

Overrides:
Source:

Methods

action(name) → {Action}

Return an action reference
Parameters:
Name Type Description
name String action name
Source:
Returns:
action requested action, if available
Type
Action

action(name) → {Action}

Return an action reference
Parameters:
Name Type Description
name String action name
Source:
Returns:
action requested action, if available
Type
Action

addChild(child) → {Promise}

Add a child
Parameters:
Name Type Description
child ServiceObject The object instance or id to add
Source:
Returns:
Promise of the request with a the list of children
Type
Promise

addChild(child) → {Promise}

Add a child
Parameters:
Name Type Description
child ServiceObject The object instance or id to add
Source:
Returns:
Promise of the request with a the list of children
Type
Promise

addStream(name, definition)

Add a stream to the object
Parameters:
Name Type Description
name String The stream name
definition Object The steam definition
Source:

addStream(name, definition)

Add a stream to the object
Parameters:
Name Type Description
name String The stream name
definition Object The steam definition
Source:

create() → {Promise}

Create a new Object instance
Source:
Returns:
object the newly created reference
Type
Promise

create() → {Promise}

Create a new Object instance
Source:
Returns:
object the newly created reference
Type
Promise

delete(Optional,) → {Promise}

Delete a Service Object
Parameters:
Name Type Description
Optional, String the objectId to delete
Source:
Returns:
Promise of the request with a new empty so as argument
Type
Promise

delete(Optional,) → {Promise}

Delete a Service Object
Parameters:
Name Type Description
Optional, String the objectId to delete
Source:
Returns:
Promise of the request with a new empty so as argument
Type
Promise

exportProperties()

Exposes setter and getter for a class from the `data` field
Overrides:
Source:

getChildren() → {Promise}

Get children
Source:
Returns:
Promise of the request with a the list of children
Type
Promise

getChildren() → {Promise}

Get children
Source:
Returns:
Promise of the request with a the list of children
Type
Promise

getClient() → {Client}

Return the client reference
Overrides:
Source:
Returns:
client
Type
Client

getContainer() → {Raptor}

Return the Raptor instance wrapper
Overrides:
Source:
Returns:
container Raptor instance reference
Type
Raptor

getCreatedAt() → {Number}

Source:
Returns:
createdAt The creation date as unix timestamp
Type
Number

getCreatedAt() → {Number}

Source:
Returns:
createdAt The creation date as unix timestamp
Type
Number

getId() → {String}

Source:
Returns:
id The object id
Type
String

getId() → {String}

Source:
Returns:
id The object id
Type
String

load(id) → {Promise}

Load the Object definition
Parameters:
Name Type Description
id String The object Id
Source:
Returns:
Promise of the request with the ServiceObject as argument
Type
Promise

load(id) → {Promise}

Load the Object definition
Parameters:
Name Type Description
id String The object Id
Source:
Returns:
Promise of the request with the ServiceObject as argument
Type
Promise

parseJSON(raw)

Parse a plain object and populate the corresponding fields in the current instance
Parameters:
Name Type Description
raw Object the json object
Overrides:
Source:

removeChild(child) → {Promise}

Remove a child
Parameters:
Name Type Description
child ServiceObject The object instance or id to remove
Source:
Returns:
Promise of the request with a the list of children
Type
Promise

removeChild(child) → {Promise}

Remove a child
Parameters:
Name Type Description
child ServiceObject The object instance or id to remove
Source:
Returns:
Promise of the request with a the list of children
Type
Promise

setActions(actions)

Set actions to the object
Parameters:
Name Type Description
actions Array The list of actions to set
Source:

setActions(actions)

Set actions to the object
Parameters:
Name Type Description
actions Array The list of actions to set
Source:

setChildren() → {Promise}

Set children
Source:
Returns:
Promise of the request with a the list of children
Type
Promise

setChildren() → {Promise}

Set children
Source:
Returns:
Promise of the request with a the list of children
Type
Promise

setContainer(container)

Parameters:
Name Type Description
container Raptor reference to Raptor instance wrapper
Overrides:
Source:

setServiceObject(object)

Set a reference to the parent object
Parameters:
Name Type Description
object ServiceObject reference to the parent object
Overrides:
Source:

setStreams(streams)

Set streams to the object
Parameters:
Name Type Description
streams Array The list of streams to set
Source:

setStreams(streams)

Set streams to the object
Parameters:
Name Type Description
streams Array The list of streams to set
Source:

stream(name) → {Stream}

Return a stream reference
Parameters:
Name Type Description
name String stream name
Source:
Returns:
stream requested stream, if available
Type
Stream

stream(name) → {Stream}

Return a stream reference
Parameters:
Name Type Description
name String stream name
Source:
Returns:
stream requested stream, if available
Type
Stream

subscribe(cb) → {EventEmitter}

Subscribe for Service Object updates
Parameters:
Name Type Description
cb ServiceObjectOnEvent The callback that handles an event notification
Source:
Returns:
An emitter that will notify of updates
Type
EventEmitter

subscribe(cb) → {EventEmitter}

Subscribe for Service Object updates
Parameters:
Name Type Description
cb ServiceObjectOnEvent The callback that handles an event notification
Source:
Returns:
An emitter that will notify of updates
Type
EventEmitter

toJSON() → {Object}

Convert the instance to a js object
Overrides:
Source:
Returns:
Plain js object
Type
Object

toString() → {String}

Return a JSON string of this object
Overrides:
Source:
Returns:
json stringified JSON
Type
String

unsubscribe()

Unsubscribe from Service Object updates
Source:

unsubscribe()

Unsubscribe from Service Object updates
Source:

update() → {Promise}

Update an Object
Source:
Returns:
Promise of the request with the ServiceObject as argument
Type
Promise

update() → {Promise}

Update an Object
Source:
Returns:
Promise of the request with the ServiceObject as argument
Type
Promise

validate() → {void}

Validate the object and throw an exception if fails
Overrides:
Source:
Returns:
Type
void