nmos-ledger
Version:
NMOS discovery and registration APIs
1,100 lines (307 loc) • 14.9 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: Versionned</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: Versionned</h1>
<section>
<header>
<h2>Versionned</h2>
</header>
<article>
<div class="container-overview">
<h4 class="name" id="Versionned"><span class="type-signature"></span>new Versionned<span class="signature">(id, version, label)</span><span class="type-signature"></span></h4>
<div class="description">
Supertype of every class that has UUID identity, version numbers and labels.
Methods are designed to be mixed in piecemeal as required.
</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 resource.</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
(<<em>seconds</em>>:<<em>nanoseconds<em>>)
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 resource.</td>
</tr>
</tbody>
</table>
<dl class="details">
<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#line41">line 41</a>
</li></ul></dd>
</dl>
</div>
<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-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-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="version"><span class="type-signature">(readonly) </span>version<span class="type-signature"> :string</span></h4>
<div class="description">
String formatted PTP timestamp (<<em>seconds</em>>:<<em>nanoseconds</em>>)
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-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"> → {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">
<optional><br>
</td>
<td class="description last">Identifier to pass through.</td>
</tr>
</tbody>
</table>
<dl class="details">
<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"> → {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">
<optional><br>
</td>
<td class="description last">Label to pass through.</td>
</tr>
</tbody>
</table>
<dl class="details">
<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"> → {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">
<optional><br>
</td>
<td class="description last">Version number to pass through.</td>
</tr>
</tbody>
</table>
<dl class="details">
<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"> → {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-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:50 GMT+0000 (GMT)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>