Home Manual Reference Source
import {Remoting} from 'zetapush-js/src/mapping/services.js'
public class | source

Remoting

Extends:

src/mapping/core.js~Service → Remoting

User API for remote control

Static Member Summary

Static Public Members
public static get

Get default deployment id associated to Remoting service

Method Summary

Public Methods
public

addListener(objectPattern: {"resource": *, "fromResource": *, "cmd": *, "from": *, "data": *, "owner": *}): *

Adds a listener

public

capabilities(objectPattern: {"askingResource": *, "capabilities": *, "answeringResource": *}): *

Response to 'getCapabilities'

public

execute(objectPattern: {"resource": *, "cmd": *, "data": *, "owner": *}): *

Executes a command

public

Requests capabilities

public

notify(objectPattern: {"resource": *, "fromResource": *, "cmd": *, "from": *, "data": *, "owner": *}): *

Notifies of some event

public

ping(objectPattern: {"action": *}): *

Pings devices

public

pong(objectPattern: {"user": *, "resource": *, "available": *, "uid": *, "owner": *, "action": *}): *

Response to ping

public

removeListener(objectPattern: {"resource": *, "fromResource": *, "cmd": *, "from": *, "data": *, "owner": *}): *

Removes a listener

Static Public Members

public static get DEFAULT_DEPLOYMENT_ID: string: string source

Get default deployment id associated to Remoting service

Return:

string

Public Methods

public addListener(objectPattern: {"resource": *, "fromResource": *, "cmd": *, "from": *, "data": *, "owner": *}): * source

Adds a listener

A user requests notifications from a device owned by anyone who granted him the right authorizations. Whenever the device calls 'notify', notifications will be sent to the caller of this verb.

Params:

NameTypeAttributeDescription
objectPattern {"resource": *, "fromResource": *, "cmd": *, "from": *, "data": *, "owner": *}
  • default: {"resource":null,"fromResource":null,"cmd":null,"from":null,"data":null,"owner":null}

Return:

*

public capabilities(objectPattern: {"askingResource": *, "capabilities": *, "answeringResource": *}): * source

Response to 'getCapabilities'

Params:

NameTypeAttributeDescription
objectPattern {"askingResource": *, "capabilities": *, "answeringResource": *}
  • default: {"askingResource":null,"capabilities":null,"answeringResource":null}

Return:

*

public execute(objectPattern: {"resource": *, "cmd": *, "data": *, "owner": *}): * source

Executes a command

A user executes a command on a device owned by anyone who granted him the right authorizations. The command is issued on channel 'command'

Params:

NameTypeAttributeDescription
objectPattern {"resource": *, "cmd": *, "data": *, "owner": *}
  • default: {"resource":null,"cmd":null,"data":null,"owner":null}

Return:

*

public getCapabilities(): * source

Requests capabilities

A user requests all his devices for the whole list of their capabilities. Devices are expected to answer on channel 'capabilities'

Return:

*

public notify(objectPattern: {"resource": *, "fromResource": *, "cmd": *, "from": *, "data": *, "owner": *}): * source

Notifies of some event

A device notifies the registered users/devices on this channel. The server forwards the notification to said users.

Params:

NameTypeAttributeDescription
objectPattern {"resource": *, "fromResource": *, "cmd": *, "from": *, "data": *, "owner": *}
  • default: {"resource":null,"fromResource":null,"cmd":null,"from":null,"data":null,"owner":null}

Return:

*

public ping(objectPattern: {"action": *}): * source

Pings devices

A user requests all devices (of all owners) on which he has authorizations to respond on channel 'pong'

Params:

NameTypeAttributeDescription
objectPattern {"action": *}
  • default: {"action":null}

Return:

*

public pong(objectPattern: {"user": *, "resource": *, "available": *, "uid": *, "owner": *, "action": *}): * source

Response to ping

Params:

NameTypeAttributeDescription
objectPattern {"user": *, "resource": *, "available": *, "uid": *, "owner": *, "action": *}
  • default: {"user":null,"resource":null,"available":null,"uid":null,"owner":null,"action":null}

Return:

*

public removeListener(objectPattern: {"resource": *, "fromResource": *, "cmd": *, "from": *, "data": *, "owner": *}): * source

Removes a listener

A user stops requesting notifications from a device owned by anyone who granted him the right authorizations

Params:

NameTypeAttributeDescription
objectPattern {"resource": *, "fromResource": *, "cmd": *, "from": *, "data": *, "owner": *}
  • default: {"resource":null,"fromResource":null,"cmd":null,"from":null,"data":null,"owner":null}

Return:

*