UNPKG

nmos-ledger

Version:

NMOS discovery and registration APIs

1,527 lines (432 loc) 21.3 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Class: Device</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Class: Device</h1> <section> <header> <h2>Device</h2> </header> <article> <div class="container-overview"> <h4 class="name" id="Device"><span class="type-signature"></span>new Device<span class="signature">(id, version, label, type, node_id, senders, receivers)</span><span class="type-signature"></span></h4> <div class="description"> Describes a Device. Immutable value. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>id</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">Globally unique UUID identifier for the Device.</td> </tr> <tr> <td class="name"><code>version</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">String formatted PTP timestamp (&lt;<em>seconds</em>&gt;:&lt;<em>nanoseconds</em>&gt;) indicating precisely when an attribute of the resource last changed.</td> </tr> <tr> <td class="name"><code>label</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Freeform string label for the Device.</td> </tr> <tr> <td class="name"><code>type</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"><a href="global.html#deviceTypes">Device type</a> URN.</td> </tr> <tr> <td class="name"><code>node_id</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Globally unique UUID identifier for the <a href="Node.html">Node</a> which initially created the Device.</td> </tr> <tr> <td class="name"><code>senders</code></td> <td class="type"> <span class="param-type">Array.&lt;string></span> </td> <td class="description last">UUIDs of Senders attached to the Device.</td> </tr> <tr> <td class="name"><code>receivers</code></td> <td class="type"> <span class="param-type">Array.&lt;string></span> </td> <td class="description last">UUIDs of Receivers attached to the Device</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="model_Device.js.html">model/Device.js</a>, <a href="model_Device.js.html#line36">line 36</a> </li></ul></dd> </dl> </div> <h3 class="subsection-title">Extends</h3> <ul> <li><a href="Versionned.html">Versionned</a></li> </ul> <h3 class="subsection-title">Members</h3> <h4 class="name" id="id"><span class="type-signature">(readonly) </span>id<span class="type-signature"> :string</span></h4> <div class="description"> Globally unique UUID identifier for the resource. </div> <h5>Type:</h5> <ul> <li> <span class="param-type">string</span> </li> </ul> <dl class="details"> <dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="Versionned.html#id">Versionned#id</a> </li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="model_Versionned.js.html">model/Versionned.js</a>, <a href="model_Versionned.js.html#line47">line 47</a> </li></ul></dd> </dl> <h4 class="name" id="label"><span class="type-signature">(readonly) </span>label<span class="type-signature"> :string</span></h4> <div class="description"> Freeform string label for the resource. </div> <h5>Type:</h5> <ul> <li> <span class="param-type">string</span> </li> </ul> <dl class="details"> <dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="Versionned.html#label">Versionned#label</a> </li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="model_Versionned.js.html">model/Versionned.js</a>, <a href="model_Versionned.js.html#line60">line 60</a> </li></ul></dd> </dl> <h4 class="name" id="node_id"><span class="type-signature">(readonly) </span>node_id<span class="type-signature"> :string</span></h4> <div class="description"> Globally unique UUID identifier for the <a href="Node.html">Node</a> which initially created the Device. </div> <h5>Type:</h5> <ul> <li> <span class="param-type">string</span> </li> </ul> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="model_Device.js.html">model/Device.js</a>, <a href="model_Device.js.html#line52">line 52</a> </li></ul></dd> </dl> <h4 class="name" id="receivers"><span class="type-signature">(readonly) </span>receivers<span class="type-signature"> :Array.&lt;string></span></h4> <div class="description"> UUIDs of Receivers attached to the Device. </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Array.&lt;string></span> </li> </ul> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="model_Device.js.html">model/Device.js</a>, <a href="model_Device.js.html#line64">line 64</a> </li></ul></dd> </dl> <h4 class="name" id="senders"><span class="type-signature">(readonly) </span>senders<span class="type-signature"> :Array.&lt;string></span></h4> <div class="description"> UUIDs of Senders attached to the Device. </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Array.&lt;string></span> </li> </ul> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="model_Device.js.html">model/Device.js</a>, <a href="model_Device.js.html#line58">line 58</a> </li></ul></dd> </dl> <h4 class="name" id="type"><span class="type-signature">(readonly) </span>type<span class="type-signature"> :string</span></h4> <div class="description"> <a href="global.html#deviceTypes">Device type</a> URN. </div> <h5>Type:</h5> <ul> <li> <span class="param-type">string</span> </li> </ul> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="model_Device.js.html">model/Device.js</a>, <a href="model_Device.js.html#line45">line 45</a> </li></ul></dd> </dl> <h4 class="name" id="version"><span class="type-signature">(readonly) </span>version<span class="type-signature"> :string</span></h4> <div class="description"> String formatted PTP timestamp (&lt;<em>seconds</em>&gt;:&lt;<em>nanoseconds</em>&gt;) indicating precisely when an attribute of the resource last changed. </div> <h5>Type:</h5> <ul> <li> <span class="param-type">string</span> </li> </ul> <dl class="details"> <dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="Versionned.html#version">Versionned#version</a> </li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="model_Versionned.js.html">model/Versionned.js</a>, <a href="model_Versionned.js.html#line54">line 54</a> </li></ul></dd> </dl> <h3 class="subsection-title">Methods</h3> <h4 class="name" id="generateID"><span class="type-signature"></span>generateID<span class="signature">(id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {string}</span></h4> <div class="description"> Generate an <a href="Versionned.html#id">identifier</a> when one is not provided, otherwise pass this one through. No validation takes place. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>id</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">Identifier to pass through.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="Versionned.html#generateID">Versionned#generateID</a> </li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="model_Versionned.js.html">model/Versionned.js</a>, <a href="model_Versionned.js.html#line71">line 71</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> Value passed to the method or a generated pseudo-random UUID for no arguments, null or undefined. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> <h4 class="name" id="generateLabel"><span class="type-signature"></span>generateLabel<span class="signature">(label<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {string}</span></h4> <div class="description"> Generate a <a href="Versionned.html#label">label</a> when one is not provided, otherwise pass the given one through. No validation takes place. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>label</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">Label to pass through.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="Versionned.html#generateLabel">Versionned#generateLabel</a> </li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="model_Versionned.js.html">model/Versionned.js</a>, <a href="model_Versionned.js.html#line102">line 102</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> Value passed to the method or an empty string for no arguments, null or undefined. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> <h4 class="name" id="generateVersion"><span class="type-signature"></span>generateVersion<span class="signature">(version<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {string}</span></h4> <div class="description"> Generate a <a href="Versionned.html#version">version number</a> when one is not provided, otherwise pass the given one through. No validation takes place. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>version</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">Version number to pass through.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="Versionned.html#generateVersion">Versionned#generateVersion</a> </li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="model_Versionned.js.html">model/Versionned.js</a>, <a href="model_Versionned.js.html#line85">line 85</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> Value passed to the method or a generated version number from the current clock with no arguments, null or undefined. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> <h4 class="name" id="valid"><span class="type-signature"></span>valid<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h4> <div class="description"> Checks that all the properties of this resource are valid. The is a syntactic check and does not check semantics such as references to other objects can be checked. Valid includes: <ul> <li>Required properties are defined and not null.</li> <li>Identifiers a valid UUIDs.</li> <li>Enumerations are known values and/or match expected patterns.</li> <li>Values are of the expected type.</li> </ul> </div> <dl class="details"> <dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="Versionned.html#valid">Versionned#valid</a> </li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="model_Versionned.js.html">model/Versionned.js</a>, <a href="model_Versionned.js.html#line211">line 211</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> Is the resource valid? </div> <dl> <dt> Type </dt> <dd> <span class="param-type">boolean</span> </dd> </dl> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Device.html">Device</a></li><li><a href="Flow.html">Flow</a></li><li><a href="Node.html">Node</a></li><li><a href="NodeAPI.html">NodeAPI</a></li><li><a href="NodeRAMStore.html">NodeRAMStore</a></li><li><a href="Versionned.html">Versionned</a></li></ul><h3>Interfaces</h3><ul><li><a href="NodeStore.html">NodeStore</a></li></ul><h3>Global</h3><ul><li><a href="global.html#capabilities">capabilities</a></li><li><a href="global.html#deviceTypes">deviceTypes</a></li><li><a href="global.html#formats">formats</a></li><li><a href="global.html#statusError">statusError</a></li><li><a href="global.html#transports">transports</a></li></ul> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Mon Dec 21 2015 17:19:49 GMT+0000 (GMT) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>