Interface: NodeStore

NodeStore

Generic store providing access to the current state of a node.
Source:

Members

statusError

Add a status code to an error object.
Source:

Methods

getDevice(id, cb)

Get the details of a specific device.
Parameters:
Name Type Description
id String Identity of the device being queried. String as UUID.
cb NodeStore~deviceCallback Callback with the device result.
Source:

getDevices(skipopt, limitopt, cb)

Get all the devices available at this node.
Parameters:
Name Type Attributes Description
skip number <optional>
Number of devices to skip before starting the listing.
limit number <optional>
Limit the number of values returned.
cb NodeStore~devicesCallback Callback providing the list of devlices.
Source:

getSelf(cb)

Retrieve details of the node as the result of the callback.
Parameters:
Name Type Description
cb NodeStore~nodeCallback Callback with the node result.
Source:

putDevice(device, cb)

Add or update a device on this node. The following conditions are checked:
  • If the device already exists, the version number must be more up-to-date. If null/undefined, a new version number will be generated.
  • The node_id property is set to the identifier of this node. If it is null/undefined, it will be set.
  • All referenced senders must exist in this store.
  • All referenced receivers must exist in this store.
  • The device is valid.
Parameters:
Name Type Description
device Device [description]
cb NodeStore~deviceCallback [description]
Source:

putSelf(node, cb)

Update the defails of the node represented by this store. The following conditions are checked:
  • The version number is more up-to-date than the stored self.
  • All service references are to known devices.
  • The identifier of the passed node is the same as the one that is stored.
  • The node is valid.
Parameters:
Name Type Description
node Node Node value to replace the current one.
cb NodeStore~nodeCallback Callback with the updated node or details of update issues.
Source:

Type Definitions

deviceCallback(err, result)

Callback with the single requested device.
Parameters:
Name Type Description
err Error Error retrieving the device's details.
result Device Single requested device.
Source:

devicesCallback(err, result, totalopt, pageOfopt, pagesopt, sizeopt)

Callback to contain a list of devices.
Parameters:
Name Type Attributes Description
err Error Error retrieving the list of devices.
result Array.<Device> List of devices.
total number <optional>
Total number of devices.
pageOf number <optional>
Current page number, starting from 1.
pages number <optional>
Total number of pages.
size number <optional>
Number of items on this page. Up to the provided limit.
Source:

nodeCallback(err, result)

Callback containing a single node result.
Parameters:
Name Type Description
err Error Error retrieving the node's details.
result Node Node details.
Source: