http://git-wip-us.apache.org/repos/asf/ignite/blob/c56d16fb/modules/platforms/nodejs/api_spec/ComplexObjectType.html ---------------------------------------------------------------------- diff --git a/modules/platforms/nodejs/api_spec/ComplexObjectType.html b/modules/platforms/nodejs/api_spec/ComplexObjectType.html new file mode 100644 index 0000000..09cdd2a --- /dev/null +++ b/modules/platforms/nodejs/api_spec/ComplexObjectType.html @@ -0,0 +1,526 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <title>JSDoc: Class: ComplexObjectType</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: ComplexObjectType</h1> + + + + + + +<section> + +<header> + + <h2><span class="attribs"><span class="type-signature"></span></span>ComplexObjectType<span class="signature">(jsObject, typeName<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h2> + + <div class="class-description"><p>Class representing a complex type of Ignite object.</p> +<p>It is described by COMPOSITE_TYPE.COMPLEX_OBJECT <a href="ObjectType.html#.COMPOSITE_TYPE">ObjectType.COMPOSITE_TYPE</a>, +by a name of the complex type and by a JavaScript Object which is mapped to/from the Ignite complex type.</p></div> + + +</header> + +<article> + <div class="container-overview"> + + + + + <h2>Constructor</h2> + + + + <h4 class="name" id="ComplexObjectType"><span class="type-signature"></span>new ComplexObjectType<span class="signature">(jsObject, typeName<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4> + + + + + + +<div class="description"> + <p>Public constructor.</p> +<p>Specifies a JavaScript Object type which will be mapped to/from the complex type. +This specification is done using an instance of the JavaScript Object.</p> +<p>If an object of the complex type is going to be received (deserialized), +the JavaScript Object must have a constructor without parameters or with optional parameters only.</p> +<p>The JavaScript Object defines a set of fields of the complex type.</p> +<p>By default, the fields have no types specified. It means during operations the Ignite client +will try to make automatic mapping between JavaScript types and Ignite object types - +according to the mapping table defined in the description of the <a href="ObjectType.html">ObjectType</a> class.</p> +<p>A type of any field may be specified later by setFieldType() method.</p> +<p>By default, the name of the complex type is the name of the JavaScript Object. +The name may be explicitely specified using optional typeName parameter in the constructor.</p> +</div> + + + + + + + + + + <h5>Parameters:</h5> + + +<table class="params"> + <thead> + <tr> + + <th>Name</th> + + + <th>Type</th> + + + <th>Attributes</th> + + + + <th>Default</th> + + + <th class="last">Description</th> + </tr> + </thead> + + <tbody> + + + <tr> + + <td class="name"><code>jsObject</code></td> + + + <td class="type"> + + +<span class="param-type">object</span> + + + + </td> + + + <td class="attributes"> + + + + + + </td> + + + + <td class="default"> + + </td> + + + <td class="description last"><p>instance of JavaScript Object which will be mapped to/from this complex type.</p></td> + </tr> + + + + <tr> + + <td class="name"><code>typeName</code></td> + + + <td class="type"> + + +<span class="param-type">string</span> + + + + </td> + + + <td class="attributes"> + + <optional><br> + + + + + + </td> + + + + <td class="default"> + + null + + </td> + + + <td class="description last"><p>name of the complex type.</p></td> + </tr> + + + </tbody> +</table> + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="ObjectType.js.html">ObjectType.js</a>, <a href="ObjectType.js.html#line511">line 511</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + + + + + + + + + + </div> + + + <h3 class="subsection-title">Extends</h3> + + + + + <ul> + <li><a href="CompositeType.html">CompositeType</a></li> + </ul> + + + + + + + + + + + + + + + + + + <h3 class="subsection-title">Methods</h3> + + + + + + + + <h4 class="name" id="setFieldType"><span class="type-signature"></span>setFieldType<span class="signature">(fieldName, fieldType)</span><span class="type-signature"> → {<a href="ComplexObjectType.html">ComplexObjectType</a>}</span></h4> + + + + + + +<div class="description"> + <p>Specifies a type of the field in the complex type.</p> +<p>If the type is not specified then during operations the Ignite client +will try to make automatic mapping between JavaScript types and Ignite object types - +according to the mapping table defined in the description of the <a href="ObjectType.html">ObjectType</a> class.</p> +</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>fieldName</code></td> + + + <td class="type"> + + +<span class="param-type">string</span> + + + + </td> + + + + + + <td class="description last"><p>name of the field.</p></td> + </tr> + + + + <tr> + + <td class="name"><code>fieldType</code></td> + + + <td class="type"> + + +<span class="param-type"><a href="ObjectType.html#.PRIMITIVE_TYPE">ObjectType.PRIMITIVE_TYPE</a></span> +| + +<span class="param-type"><a href="CompositeType.html">CompositeType</a></span> + + + + </td> + + + + + + <td class="description last"><p>type of the field:</p> +<ul> +<li>either a type code of primitive (simple) type</li> +<li>or an instance of class representing non-primitive (composite) type</li> +<li>or null (means the type is not specified).</li> +</ul></td> + </tr> + + + </tbody> +</table> + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="ObjectType.js.html">ObjectType.js</a>, <a href="ObjectType.js.html#line574">line 574</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + +<h5>Throws:</h5> + + + +<dl> + <dt> + <div class="param-desc"> + <p>if error.</p> + </div> + </dt> + <dd></dd> + <dt> + <dl> + <dt> + Type + </dt> + <dd> + +<span class="param-type"><a href="IgniteClientError.html">IgniteClientError</a></span> + + + </dd> + </dl> + </dt> + <dd></dd> +</dl> + + + + + +<h5>Returns:</h5> + + +<div class="param-desc"> + <ul> +<li>the same instance of the ComplexObjectType.</li> +</ul> +</div> + + + +<dl> + <dt> + Type + </dt> + <dd> + +<span class="param-type"><a href="ComplexObjectType.html">ComplexObjectType</a></span> + + + </dd> +</dl> + + + + + + + + + + + + + +</article> + +</section> + + + + +</div> + +<nav> + <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BinaryObject.html">BinaryObject</a></li><li><a href="CacheClient.html">CacheClient</a></li><li><a href="CacheConfiguration.html">CacheConfiguration</a></li><li><a href="CacheEntry.html">CacheEntry</a></li><li><a href="CacheKeyConfiguration.html">CacheKeyConfiguration</a></li><li><a href="CollectionObjectType.html">CollectionObjectType</a></li><li><a href="ComplexObjectType.html">ComplexObjectType</a></li><li><a href="CompositeType.html">CompositeType</a></li><li><a href="Cursor.html">Cursor</a></li><li><a href="EnumItem.html">EnumItem</a></li><li><a href="IgniteClient.html">IgniteClient</a></li><li><a href="IgniteClientConfiguration.html">IgniteClientConfiguration</a></li><li><a href="IgniteClientError.html">IgniteClientError</a></li><li><a href="IllegalStateError.html">IllegalStateError</a></li><li><a href="LostConnectionError.html">LostConnectionError</a></li><li><a href="MapObjectType.html">MapObjectType</ a></li><li><a href="ObjectArrayType.html">ObjectArrayType</a></li><li><a href="ObjectType.html">ObjectType</a></li><li><a href="OperationError.html">OperationError</a></li><li><a href="Query.html">Query</a></li><li><a href="QueryEntity.html">QueryEntity</a></li><li><a href="QueryField.html">QueryField</a></li><li><a href="QueryIndex.html">QueryIndex</a></li><li><a href="ScanQuery.html">ScanQuery</a></li><li><a href="SqlFieldsCursor.html">SqlFieldsCursor</a></li><li><a href="SqlFieldsQuery.html">SqlFieldsQuery</a></li><li><a href="SqlQuery.html">SqlQuery</a></li><li><a href="Timestamp.html">Timestamp</a></li></ul> +</nav> + +<br class="clear"> + +<footer> + Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue May 22 2018 12:08:49 GMT+0300 (Russia TZ 2 Standard Time) +</footer> + +<script> prettyPrint(); </script> +<script src="scripts/linenumber.js"> </script> +</body> +</html> \ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/c56d16fb/modules/platforms/nodejs/api_spec/CompositeType.html ---------------------------------------------------------------------- diff --git a/modules/platforms/nodejs/api_spec/CompositeType.html b/modules/platforms/nodejs/api_spec/CompositeType.html new file mode 100644 index 0000000..a870b0c --- /dev/null +++ b/modules/platforms/nodejs/api_spec/CompositeType.html @@ -0,0 +1,170 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <title>JSDoc: Class: CompositeType</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: CompositeType</h1> + + + + + + +<section> + +<header> + + <h2><span class="attribs"><span class="type-signature"></span></span>CompositeType</h2> + + <div class="class-description"><p>Base class representing a non-primitive (composite) type of Ignite object.</p> +<p>The class has no public constructor. Only subclasses may be instantiated.</p></div> + + +</header> + +<article> + <div class="container-overview"> + + + + + + + + + + + + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="ObjectType.js.html">ObjectType.js</a>, <a href="ObjectType.js.html#line315">line 315</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + + + + + + + + + + </div> + + + <h3 class="subsection-title">Extends</h3> + + + + + <ul> + <li><a href="ObjectType.html">ObjectType</a></li> + </ul> + + + + + + + + + + + + + + + + + + + + + +</article> + +</section> + + + + +</div> + +<nav> + <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BinaryObject.html">BinaryObject</a></li><li><a href="CacheClient.html">CacheClient</a></li><li><a href="CacheConfiguration.html">CacheConfiguration</a></li><li><a href="CacheEntry.html">CacheEntry</a></li><li><a href="CacheKeyConfiguration.html">CacheKeyConfiguration</a></li><li><a href="CollectionObjectType.html">CollectionObjectType</a></li><li><a href="ComplexObjectType.html">ComplexObjectType</a></li><li><a href="CompositeType.html">CompositeType</a></li><li><a href="Cursor.html">Cursor</a></li><li><a href="EnumItem.html">EnumItem</a></li><li><a href="IgniteClient.html">IgniteClient</a></li><li><a href="IgniteClientConfiguration.html">IgniteClientConfiguration</a></li><li><a href="IgniteClientError.html">IgniteClientError</a></li><li><a href="IllegalStateError.html">IllegalStateError</a></li><li><a href="LostConnectionError.html">LostConnectionError</a></li><li><a href="MapObjectType.html">MapObjectType</ a></li><li><a href="ObjectArrayType.html">ObjectArrayType</a></li><li><a href="ObjectType.html">ObjectType</a></li><li><a href="OperationError.html">OperationError</a></li><li><a href="Query.html">Query</a></li><li><a href="QueryEntity.html">QueryEntity</a></li><li><a href="QueryField.html">QueryField</a></li><li><a href="QueryIndex.html">QueryIndex</a></li><li><a href="ScanQuery.html">ScanQuery</a></li><li><a href="SqlFieldsCursor.html">SqlFieldsCursor</a></li><li><a href="SqlFieldsQuery.html">SqlFieldsQuery</a></li><li><a href="SqlQuery.html">SqlQuery</a></li><li><a href="Timestamp.html">Timestamp</a></li></ul> +</nav> + +<br class="clear"> + +<footer> + Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue May 22 2018 12:08:49 GMT+0300 (Russia TZ 2 Standard Time) +</footer> + +<script> prettyPrint(); </script> +<script src="scripts/linenumber.js"> </script> +</body> +</html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/c56d16fb/modules/platforms/nodejs/api_spec/Cursor.html ---------------------------------------------------------------------- diff --git a/modules/platforms/nodejs/api_spec/Cursor.html b/modules/platforms/nodejs/api_spec/Cursor.html new file mode 100644 index 0000000..da75149 --- /dev/null +++ b/modules/platforms/nodejs/api_spec/Cursor.html @@ -0,0 +1,588 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <title>JSDoc: Class: Cursor</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: Cursor</h1> + + + + + + +<section> + +<header> + + <h2><span class="attribs"><span class="type-signature"></span></span>Cursor</h2> + + <div class="class-description"><p>Class representing a cursor to obtain results of SQL and Scan query operations.</p> +<p>The class has no public constructor. An instance of this class is obtained +via query() method of <a href="CacheClient.html">CacheClient</a> objects. +One instance of this class returns results of one SQL or Scan query operation.</p></div> + + +</header> + +<article> + <div class="container-overview"> + + + + + + + + + + + + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="Cursor.js.html">Cursor.js</a>, <a href="Cursor.js.html#line35">line 35</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + + + + + + + + + + </div> + + + + + + + + + + + + + + + + + <h3 class="subsection-title">Methods</h3> + + + + + + + + <h4 class="name" id="close"><span class="type-signature">(async) </span>close<span class="signature">()</span><span class="type-signature"></span></h4> + + + + + + +<div class="description"> + <p>Closes the cursor. Obtaining elements from the results is not possible after this.</p> +<p>This method should be called if no more elements are needed. +It is not neccessary to call it if all elements have been already obtained.</p> +</div> + + + + + + + + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="Cursor.js.html">Cursor.js</a>, <a href="Cursor.js.html#line101">line 101</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + + + + + + + + + + + + + + + <h4 class="name" id="getAll"><span class="type-signature">(async) </span>getAll<span class="signature">()</span><span class="type-signature"> → {Promise.<Array.<<a href="CacheEntry.html">CacheEntry</a>>>}</span></h4> + + + + + + +<div class="description"> + <p>Returns all elements (cache entries - key-value pairs) from the query results.</p> +<p>May be used instead of getValue() method if the number of returned entries +is relatively small and will not cause memory utilization issues.</p> +</div> + + + + + + + + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="Cursor.js.html">Cursor.js</a>, <a href="Cursor.js.html#line81">line 81</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + + + +<h5>Returns:</h5> + + +<div class="param-desc"> + <ul> +<li>all cache entries (key-value pairs) +returned by SQL or Scan query.</li> +</ul> +</div> + + + +<dl> + <dt> + Type + </dt> + <dd> + +<span class="param-type">Promise.<Array.<<a href="CacheEntry.html">CacheEntry</a>>></span> + + + </dd> +</dl> + + + + + + + + + + + + + + <h4 class="name" id="getValue"><span class="type-signature">(async) </span>getValue<span class="signature">()</span><span class="type-signature"> → {Promise.<<a href="CacheEntry.html">CacheEntry</a>>}</span></h4> + + + + + + +<div class="description"> + <p>Returns one element (cache entry - key-value pair) from the query results.</p> +<p>Every new call returns the next cache entry from the query results. +If the method returns null, no more entries are available.</p> +</div> + + + + + + + + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="Cursor.js.html">Cursor.js</a>, <a href="Cursor.js.html#line47">line 47</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + + + +<h5>Returns:</h5> + + +<div class="param-desc"> + <ul> +<li>a cache entry (key-value pair).</li> +</ul> +</div> + + + +<dl> + <dt> + Type + </dt> + <dd> + +<span class="param-type">Promise.<<a href="CacheEntry.html">CacheEntry</a>></span> + + + </dd> +</dl> + + + + + + + + + + + + + + <h4 class="name" id="hasMore"><span class="type-signature"></span>hasMore<span class="signature">()</span><span class="type-signature"> → {boolean}</span></h4> + + + + + + +<div class="description"> + <p>Checks if more elements are available in the query results.</p> +</div> + + + + + + + + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="Cursor.js.html">Cursor.js</a>, <a href="Cursor.js.html#line65">line 65</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + + + +<h5>Returns:</h5> + + +<div class="param-desc"> + <ul> +<li>true if more cache entries are available, false otherwise.</li> +</ul> +</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="BinaryObject.html">BinaryObject</a></li><li><a href="CacheClient.html">CacheClient</a></li><li><a href="CacheConfiguration.html">CacheConfiguration</a></li><li><a href="CacheEntry.html">CacheEntry</a></li><li><a href="CacheKeyConfiguration.html">CacheKeyConfiguration</a></li><li><a href="CollectionObjectType.html">CollectionObjectType</a></li><li><a href="ComplexObjectType.html">ComplexObjectType</a></li><li><a href="CompositeType.html">CompositeType</a></li><li><a href="Cursor.html">Cursor</a></li><li><a href="EnumItem.html">EnumItem</a></li><li><a href="IgniteClient.html">IgniteClient</a></li><li><a href="IgniteClientConfiguration.html">IgniteClientConfiguration</a></li><li><a href="IgniteClientError.html">IgniteClientError</a></li><li><a href="IllegalStateError.html">IllegalStateError</a></li><li><a href="LostConnectionError.html">LostConnectionError</a></li><li><a href="MapObjectType.html">MapObjectType</ a></li><li><a href="ObjectArrayType.html">ObjectArrayType</a></li><li><a href="ObjectType.html">ObjectType</a></li><li><a href="OperationError.html">OperationError</a></li><li><a href="Query.html">Query</a></li><li><a href="QueryEntity.html">QueryEntity</a></li><li><a href="QueryField.html">QueryField</a></li><li><a href="QueryIndex.html">QueryIndex</a></li><li><a href="ScanQuery.html">ScanQuery</a></li><li><a href="SqlFieldsCursor.html">SqlFieldsCursor</a></li><li><a href="SqlFieldsQuery.html">SqlFieldsQuery</a></li><li><a href="SqlQuery.html">SqlQuery</a></li><li><a href="Timestamp.html">Timestamp</a></li></ul> +</nav> + +<br class="clear"> + +<footer> + Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue May 22 2018 12:08:49 GMT+0300 (Russia TZ 2 Standard Time) +</footer> + +<script> prettyPrint(); </script> +<script src="scripts/linenumber.js"> </script> +</body> +</html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/c56d16fb/modules/platforms/nodejs/api_spec/Cursor.js.html ---------------------------------------------------------------------- diff --git a/modules/platforms/nodejs/api_spec/Cursor.js.html b/modules/platforms/nodejs/api_spec/Cursor.js.html new file mode 100644 index 0000000..b73fa97 --- /dev/null +++ b/modules/platforms/nodejs/api_spec/Cursor.js.html @@ -0,0 +1,360 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <title>JSDoc: Source: Cursor.js</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">Source: Cursor.js</h1> + + + + + + + <section> + <article> + <pre class="prettyprint source linenums"><code>/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +const Errors = require('./Errors'); +const BinaryUtils = require('./internal/BinaryUtils'); +const BinaryObject = require('./BinaryObject'); +const BinaryReader = require('./internal/BinaryReader'); +const BinaryWriter = require('./internal/BinaryWriter'); + +/** + * Class representing a cursor to obtain results of SQL and Scan query operations. + * + * The class has no public constructor. An instance of this class is obtained + * via query() method of {@link CacheClient} objects. + * One instance of this class returns results of one SQL or Scan query operation. + * + * @hideconstructor + */ +class Cursor { + + /** + * Returns one element (cache entry - key-value pair) from the query results. + * + * Every new call returns the next cache entry from the query results. + * If the method returns null, no more entries are available. + * + * @async + * + * @return {Promise<CacheEntry>} - a cache entry (key-value pair). + */ + async getValue() { + if (!this._values || this._valueIndex >= this._values.length) { + await this._getValues(); + this._valueIndex = 0; + } + if (this._values && this._values.length > 0) { + const value = this._values[this._valueIndex]; + this._valueIndex++; + return value; + } + return null; + } + + /** + * Checks if more elements are available in the query results. + * + * @return {boolean} - true if more cache entries are available, false otherwise. + */ + hasMore() { + return this._hasNext || + this._values && this._valueIndex < this._values.length; + } + + /** + * Returns all elements (cache entries - key-value pairs) from the query results. + * + * May be used instead of getValue() method if the number of returned entries + * is relatively small and will not cause memory utilization issues. + * + * @async + * + * @return {Promise<Array<CacheEntry>>} - all cache entries (key-value pairs) + * returned by SQL or Scan query. + */ + async getAll() { + let result = new Array(); + let values; + do { + values = await this._getValues(); + if (values) { + result = result.concat(values); + } + } while (this._hasNext); + return result; + } + + /** + * Closes the cursor. Obtaining elements from the results is not possible after this. + * + * This method should be called if no more elements are needed. + * It is not neccessary to call it if all elements have been already obtained. + * + * @async + */ + async close() { + // Close cursor only if the server has more pages: the server closes cursor automatically on last page + if (this._id && this._hasNext) { + await this._socket.send( + BinaryUtils.OPERATION.RESOURCE_CLOSE, + async (payload) => { + await this._write(payload); + }); + } + } + + /** Private methods */ + + /** + * @ignore + */ + constructor(socket, operation, buffer, keyType = null, valueType = null) { + this._socket = socket; + this._operation = operation; + this._buffer = buffer; + this._keyType = keyType; + this._valueType = valueType; + this._id = null; + this._hasNext = false; + this._values = null; + this._valueIndex = 0; + } + + /** + * @ignore + */ + async _getNext() { + this._hasNext = false; + this._values = null; + this._buffer = null; + await this._socket.send( + this._operation, + async (payload) => { + await this._write(payload); + }, + async (payload) => { + this._buffer = payload; + }); + } + + /** + * @ignore + */ + async _getValues() { + if (!this._buffer && this._hasNext) { + await this._getNext(); + } + await this._read(this._buffer) + this._buffer = null; + return this._values; + } + + /** + * @ignore + */ + async _write(buffer) { + buffer.writeLong(this._id); + } + + /** + * @ignore + */ + _readId(buffer) { + this._id = buffer.readLong(); + } + + /** + * @ignore + */ + async _readRow(buffer) { + const CacheEntry = require('./CacheClient').CacheEntry; + return new CacheEntry( + await BinaryReader.readObject(buffer, this._keyType), + await BinaryReader.readObject(buffer, this._valueType)); + } + + /** + * @ignore + */ + async _read(buffer) { + const rowCount = buffer.readInteger(); + this._values = new Array(rowCount); + for (let i = 0; i < rowCount; i++) { + this._values[i] = await this._readRow(buffer); + } + this._hasNext = buffer.readBoolean(); + } +} + +/** + * Class representing a cursor to obtain results of SQL Fields query operation. + * + * The class has no public constructor. An instance of this class is obtained + * via query() method of {@link CacheClient} objects. + * One instance of this class returns results of one SQL Fields query operation. + * + * @hideconstructor + * @extends Cursor + */ +class SqlFieldsCursor extends Cursor { + + /** + * Returns one element (array with values of the fields) from the query results. + * + * Every new call returns the next element from the query results. + * If the method returns null, no more elements are available. + * + * @async + * + * @return {Promise<Array<*>>} - array with values of the fields requested by the query. + * + */ + async getValue() { + return await super.getValue(); + } + + /** + * Returns all elements (arrays with values of the fields) from the query results. + * + * May be used instead of getValue() method if the number of returned elements + * is relatively small and will not cause memory utilization issues. + * + * @async + * + * @return {Promise<Array<Array<*>>>} - all results returned by SQL Fields query. + * Every element of the array is an array with values of the fields requested by the query. + * + */ + async getAll() { + return await super.getAll(); + } + + /** + * Returns names of the fields which were requested in the SQL Fields query. + * + * Empty array is returned if "include field names" flag was false in the query. + * + * @return {Array<string>} - field names. + * The order of names corresponds to the order of field values returned in the results of the query. + */ + getFieldNames() { + return this._fieldNames; + } + + /** + * Specifies types of the fields returned by the SQL Fields query. + * + * By default, a type of every field is not specified that means during operations the Ignite client + * will try to make automatic mapping between JavaScript types and Ignite object types - + * according to the mapping table defined in the description of the {@link ObjectType} class. + * + * @param {...ObjectType.PRIMITIVE_TYPE | CompositeType} fieldTypes - types of the returned fields. + * The order of types must correspond the order of field values returned in the results of the query. + * A type of every field can be: + * - either a type code of primitive (simple) type + * - or an instance of class representing non-primitive (composite) type + * - or null (means the type is not specified) + * + * @return {SqlFieldsCursor} - the same instance of the SqlFieldsCursor. + */ + setFieldTypes(...fieldTypes) { + this._fieldTypes = fieldTypes; + return this; + } + + /** Private methods */ + + /** + * @ignore + */ + constructor(socket, buffer) { + super(socket, BinaryUtils.OPERATION.QUERY_SQL_FIELDS_CURSOR_GET_PAGE, buffer); + this._fieldNames = []; + } + + /** + * @ignore + */ + async _readFieldNames(buffer, includeFieldNames) { + this._id = buffer.readLong(); + this._fieldCount = buffer.readInteger(); + if (includeFieldNames) { + for (let i = 0; i < this._fieldCount; i++) { + this._fieldNames[i] = await BinaryReader.readObject(buffer); + } + } + } + + /** + * @ignore + */ + async _readRow(buffer) { + let values = new Array(this._fieldCount); + let fieldType; + for (let i = 0; i < this._fieldCount; i++) { + fieldType = this._fieldTypes && i < this._fieldTypes.length ? this._fieldTypes[i] : null; + values[i] = await BinaryReader.readObject(buffer); + } + return values; + } +} + +module.exports.Cursor = Cursor; +module.exports.SqlFieldsCursor = SqlFieldsCursor; +</code></pre> + </article> + </section> + + + + +</div> + +<nav> + <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BinaryObject.html">BinaryObject</a></li><li><a href="CacheClient.html">CacheClient</a></li><li><a href="CacheConfiguration.html">CacheConfiguration</a></li><li><a href="CacheEntry.html">CacheEntry</a></li><li><a href="CacheKeyConfiguration.html">CacheKeyConfiguration</a></li><li><a href="CollectionObjectType.html">CollectionObjectType</a></li><li><a href="ComplexObjectType.html">ComplexObjectType</a></li><li><a href="CompositeType.html">CompositeType</a></li><li><a href="Cursor.html">Cursor</a></li><li><a href="EnumItem.html">EnumItem</a></li><li><a href="IgniteClient.html">IgniteClient</a></li><li><a href="IgniteClientConfiguration.html">IgniteClientConfiguration</a></li><li><a href="IgniteClientError.html">IgniteClientError</a></li><li><a href="IllegalStateError.html">IllegalStateError</a></li><li><a href="LostConnectionError.html">LostConnectionError</a></li><li><a href="MapObjectType.html">MapObjectType</ a></li><li><a href="ObjectArrayType.html">ObjectArrayType</a></li><li><a href="ObjectType.html">ObjectType</a></li><li><a href="OperationError.html">OperationError</a></li><li><a href="Query.html">Query</a></li><li><a href="QueryEntity.html">QueryEntity</a></li><li><a href="QueryField.html">QueryField</a></li><li><a href="QueryIndex.html">QueryIndex</a></li><li><a href="ScanQuery.html">ScanQuery</a></li><li><a href="SqlFieldsCursor.html">SqlFieldsCursor</a></li><li><a href="SqlFieldsQuery.html">SqlFieldsQuery</a></li><li><a href="SqlQuery.html">SqlQuery</a></li><li><a href="Timestamp.html">Timestamp</a></li></ul> +</nav> + +<br class="clear"> + +<footer> + Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue May 22 2018 12:08:48 GMT+0300 (Russia TZ 2 Standard Time) +</footer> + +<script> prettyPrint(); </script> +<script src="scripts/linenumber.js"> </script> +</body> +</html> http://git-wip-us.apache.org/repos/asf/ignite/blob/c56d16fb/modules/platforms/nodejs/api_spec/EnumItem.html ---------------------------------------------------------------------- diff --git a/modules/platforms/nodejs/api_spec/EnumItem.html b/modules/platforms/nodejs/api_spec/EnumItem.html new file mode 100644 index 0000000..9697520 --- /dev/null +++ b/modules/platforms/nodejs/api_spec/EnumItem.html @@ -0,0 +1,1431 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <title>JSDoc: Class: EnumItem</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: EnumItem</h1> + + + + + + +<section> + +<header> + + <h2><span class="attribs"><span class="type-signature"></span></span>EnumItem<span class="signature">(typeId)</span><span class="type-signature"></span></h2> + + <div class="class-description"><p>Class representing an item of Ignite enum type.</p> +<p>The item is defined by:</p> +<ul> +<li>type Id (mandatory) - Id of the Ignite enum type.</li> +<li>ordinal (optional) - ordinal of the item in the Ignite enum type.</li> +<li>name (optional) - name of the item (field name in the Ignite enum type).</li> +<li>value (optional) - value of the item. +Usually, at least one from the optional ordinal, name or value must be specified +in order to use an instance of this class in Ignite operations.</li> +</ul> +<p>To distinguish one item from another, the Ignite client analyzes the optional fields in the following order: +ordinal, name, value.</p></div> + + +</header> + +<article> + <div class="container-overview"> + + + + + <h2>Constructor</h2> + + + + <h4 class="name" id="EnumItem"><span class="type-signature"></span>new EnumItem<span class="signature">(typeId)</span><span class="type-signature"></span></h4> + + + + + + +<div class="description"> + <p>Public constructor.</p> +</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>typeId</code></td> + + + <td class="type"> + + +<span class="param-type">number</span> + + + + </td> + + + + + + <td class="description last"><p>Id of the Ignite enum type.</p></td> + </tr> + + + </tbody> +</table> + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="EnumItem.js.html">EnumItem.js</a>, <a href="EnumItem.js.html#line37">line 37</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + + + + + + + + + + </div> + + + + + + + + + + + + + + + + + <h3 class="subsection-title">Methods</h3> + + + + + + + + <h4 class="name" id="getName"><span class="type-signature"></span>getName<span class="signature">()</span><span class="type-signature"> → {string}</span></h4> + + + + + + +<div class="description"> + <p>Returns name of the item +or null if name is not set.</p> +</div> + + + + + + + + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="EnumItem.js.html">EnumItem.js</a>, <a href="EnumItem.js.html#line110">line 110</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + + + +<h5>Returns:</h5> + + +<div class="param-desc"> + <ul> +<li>name of the item.</li> +</ul> +</div> + + + +<dl> + <dt> + Type + </dt> + <dd> + +<span class="param-type">string</span> + + + </dd> +</dl> + + + + + + + + + + + + + + <h4 class="name" id="getOrdinal"><span class="type-signature"></span>getOrdinal<span class="signature">()</span><span class="type-signature"> → {number}</span></h4> + + + + + + +<div class="description"> + <p>Returns ordinal of the item in the Ignite enum type +or null if ordinal is not set.</p> +</div> + + + + + + + + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="EnumItem.js.html">EnumItem.js</a>, <a href="EnumItem.js.html#line85">line 85</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + + + +<h5>Returns:</h5> + + +<div class="param-desc"> + <ul> +<li>ordinal of the item in the Ignite enum type.</li> +</ul> +</div> + + + +<dl> + <dt> + Type + </dt> + <dd> + +<span class="param-type">number</span> + + + </dd> +</dl> + + + + + + + + + + + + + + <h4 class="name" id="getTypeId"><span class="type-signature"></span>getTypeId<span class="signature">()</span><span class="type-signature"> → {number}</span></h4> + + + + + + +<div class="description"> + <p>Returns Id of the Ignite enum type.</p> +</div> + + + + + + + + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="EnumItem.js.html">EnumItem.js</a>, <a href="EnumItem.js.html#line60">line 60</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + + + +<h5>Returns:</h5> + + +<div class="param-desc"> + <ul> +<li>Id of the enum type.</li> +</ul> +</div> + + + +<dl> + <dt> + Type + </dt> + <dd> + +<span class="param-type">number</span> + + + </dd> +</dl> + + + + + + + + + + + + + + <h4 class="name" id="getValue"><span class="type-signature"></span>getValue<span class="signature">()</span><span class="type-signature"> → {number}</span></h4> + + + + + + +<div class="description"> + <p>Returns value of the item +or null if value is not set.</p> +</div> + + + + + + + + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="EnumItem.js.html">EnumItem.js</a>, <a href="EnumItem.js.html#line135">line 135</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + + + +<h5>Returns:</h5> + + +<div class="param-desc"> + <ul> +<li>value of the item.</li> +</ul> +</div> + + + +<dl> + <dt> + Type + </dt> + <dd> + +<span class="param-type">number</span> + + + </dd> +</dl> + + + + + + + + + + + + + + <h4 class="name" id="setName"><span class="type-signature"></span>setName<span class="signature">(name)</span><span class="type-signature"> → {<a href="EnumItem.html">EnumItem</a>}</span></h4> + + + + + + +<div class="description"> + <p>Sets or updates name of the item.</p> +</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>name</code></td> + + + <td class="type"> + + +<span class="param-type">string</span> + + + + </td> + + + + + + <td class="description last"><p>name of the item.</p></td> + </tr> + + + </tbody> +</table> + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="EnumItem.js.html">EnumItem.js</a>, <a href="EnumItem.js.html#line123">line 123</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + +<h5>Throws:</h5> + + + +<dl> + <dt> + <div class="param-desc"> + <p>if error.</p> + </div> + </dt> + <dd></dd> + <dt> + <dl> + <dt> + Type + </dt> + <dd> + +<span class="param-type"><a href="IgniteClientError.html">IgniteClientError</a></span> + + + </dd> + </dl> + </dt> + <dd></dd> +</dl> + + + + + +<h5>Returns:</h5> + + +<div class="param-desc"> + <ul> +<li>the same instance of EnumItem</li> +</ul> +</div> + + + +<dl> + <dt> + Type + </dt> + <dd> + +<span class="param-type"><a href="EnumItem.html">EnumItem</a></span> + + + </dd> +</dl> + + + + + + + + + + + + + + <h4 class="name" id="setOrdinal"><span class="type-signature"></span>setOrdinal<span class="signature">(ordinal)</span><span class="type-signature"> → {<a href="EnumItem.html">EnumItem</a>}</span></h4> + + + + + + +<div class="description"> + <p>Sets or updates ordinal of the item in the Ignite enum type.</p> +</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>ordinal</code></td> + + + <td class="type"> + + +<span class="param-type">number</span> + + + + </td> + + + + + + <td class="description last"><p>ordinal of the item in the Ignite enum type.</p></td> + </tr> + + + </tbody> +</table> + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="EnumItem.js.html">EnumItem.js</a>, <a href="EnumItem.js.html#line98">line 98</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + +<h5>Throws:</h5> + + + +<dl> + <dt> + <div class="param-desc"> + <p>if error.</p> + </div> + </dt> + <dd></dd> + <dt> + <dl> + <dt> + Type + </dt> + <dd> + +<span class="param-type"><a href="IgniteClientError.html">IgniteClientError</a></span> + + + </dd> + </dl> + </dt> + <dd></dd> +</dl> + + + + + +<h5>Returns:</h5> + + +<div class="param-desc"> + <ul> +<li>the same instance of EnumItem</li> +</ul> +</div> + + + +<dl> + <dt> + Type + </dt> + <dd> + +<span class="param-type"><a href="EnumItem.html">EnumItem</a></span> + + + </dd> +</dl> + + + + + + + + + + + + + + <h4 class="name" id="setTypeId"><span class="type-signature"></span>setTypeId<span class="signature">(typeId)</span><span class="type-signature"> → {<a href="EnumItem.html">EnumItem</a>}</span></h4> + + + + + + +<div class="description"> + <p>Updates Id of the Ignite enum type.</p> +</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>typeId</code></td> + + + <td class="type"> + + +<span class="param-type">number</span> + + + + </td> + + + + + + <td class="description last"><p>new Id of the Ignite enum type.</p></td> + </tr> + + + </tbody> +</table> + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="EnumItem.js.html">EnumItem.js</a>, <a href="EnumItem.js.html#line73">line 73</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + +<h5>Throws:</h5> + + + +<dl> + <dt> + <div class="param-desc"> + <p>if error.</p> + </div> + </dt> + <dd></dd> + <dt> + <dl> + <dt> + Type + </dt> + <dd> + +<span class="param-type"><a href="IgniteClientError.html">IgniteClientError</a></span> + + + </dd> + </dl> + </dt> + <dd></dd> +</dl> + + + + + +<h5>Returns:</h5> + + +<div class="param-desc"> + <ul> +<li>the same instance of EnumItem</li> +</ul> +</div> + + + +<dl> + <dt> + Type + </dt> + <dd> + +<span class="param-type"><a href="EnumItem.html">EnumItem</a></span> + + + </dd> +</dl> + + + + + + + + + + + + + + <h4 class="name" id="setValue"><span class="type-signature"></span>setValue<span class="signature">(value)</span><span class="type-signature"> → {<a href="EnumItem.html">EnumItem</a>}</span></h4> + + + + + + +<div class="description"> + <p>Sets or updates value of the item.</p> +</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>value</code></td> + + + <td class="type"> + + +<span class="param-type">number</span> + + + + </td> + + + + + + <td class="description last"><p>value of the item.</p></td> + </tr> + + + </tbody> +</table> + + + + + + +<dl class="details"> + + + + + + + + + + + + + + + + + + + + + + + + + + + <dt class="tag-source">Source:</dt> + <dd class="tag-source"><ul class="dummy"><li> + <a href="EnumItem.js.html">EnumItem.js</a>, <a href="EnumItem.js.html#line148">line 148</a> + </li></ul></dd> + + + + + + + +</dl> + + + + + + + + + + + +<h5>Throws:</h5> + + + +<dl> + <dt> + <div class="param-desc"> + <p>if error.</p> + </div> + </dt> + <dd></dd> + <dt> + <dl> + <dt> + Type + </dt> + <dd> + +<span class="param-type"><a href="IgniteClientError.html">IgniteClientError</a></span> + + + </dd> + </dl> + </dt> + <dd></dd> +</dl> + + + + + +<h5>Returns:</h5> + + +<div class="param-desc"> + <ul> +<li>the same instance of EnumItem</li> +</ul> +</div> + + + +<dl> + <dt> + Type + </dt> + <dd> + +<span class="param-type"><a href="EnumItem.html">EnumItem</a></span> + + + </dd> +</dl> + + + + + + + + + + + + + +</article> + +</section> + + + + +</div> + +<nav> + <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BinaryObject.html">BinaryObject</a></li><li><a href="CacheClient.html">CacheClient</a></li><li><a href="CacheConfiguration.html">CacheConfiguration</a></li><li><a href="CacheEntry.html">CacheEntry</a></li><li><a href="CacheKeyConfiguration.html">CacheKeyConfiguration</a></li><li><a href="CollectionObjectType.html">CollectionObjectType</a></li><li><a href="ComplexObjectType.html">ComplexObjectType</a></li><li><a href="CompositeType.html">CompositeType</a></li><li><a href="Cursor.html">Cursor</a></li><li><a href="EnumItem.html">EnumItem</a></li><li><a href="IgniteClient.html">IgniteClient</a></li><li><a href="IgniteClientConfiguration.html">IgniteClientConfiguration</a></li><li><a href="IgniteClientError.html">IgniteClientError</a></li><li><a href="IllegalStateError.html">IllegalStateError</a></li><li><a href="LostConnectionError.html">LostConnectionError</a></li><li><a href="MapObjectType.html">MapObjectType</ a></li><li><a href="ObjectArrayType.html">ObjectArrayType</a></li><li><a href="ObjectType.html">ObjectType</a></li><li><a href="OperationError.html">OperationError</a></li><li><a href="Query.html">Query</a></li><li><a href="QueryEntity.html">QueryEntity</a></li><li><a href="QueryField.html">QueryField</a></li><li><a href="QueryIndex.html">QueryIndex</a></li><li><a href="ScanQuery.html">ScanQuery</a></li><li><a href="SqlFieldsCursor.html">SqlFieldsCursor</a></li><li><a href="SqlFieldsQuery.html">SqlFieldsQuery</a></li><li><a href="SqlQuery.html">SqlQuery</a></li><li><a href="Timestamp.html">Timestamp</a></li></ul> +</nav> + +<br class="clear"> + +<footer> + Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue May 22 2018 12:08:49 GMT+0300 (Russia TZ 2 Standard Time) +</footer> + +<script> prettyPrint(); </script> +<script src="scripts/linenumber.js"> </script> +</body> +</html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/c56d16fb/modules/platforms/nodejs/api_spec/EnumItem.js.html ---------------------------------------------------------------------- diff --git a/modules/platforms/nodejs/api_spec/EnumItem.js.html b/modules/platforms/nodejs/api_spec/EnumItem.js.html new file mode 100644 index 0000000..99bb5ae --- /dev/null +++ b/modules/platforms/nodejs/api_spec/EnumItem.js.html @@ -0,0 +1,255 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <title>JSDoc: Source: EnumItem.js</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">Source: EnumItem.js</h1> + + + + + + + <section> + <article> + <pre class="prettyprint source linenums"><code>/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +const ArgumentChecker = require('./internal/ArgumentChecker'); +const Errors = require('./Errors'); + +/** + * Class representing an item of Ignite enum type. + * + * The item is defined by: + * - type Id (mandatory) - Id of the Ignite enum type. + * - ordinal (optional) - ordinal of the item in the Ignite enum type. + * - name (optional) - name of the item (field name in the Ignite enum type). + * - value (optional) - value of the item. + * Usually, at least one from the optional ordinal, name or value must be specified + * in order to use an instance of this class in Ignite operations. + * + * To distinguish one item from another, the Ignite client analyzes the optional fields in the following order: + * ordinal, name, value. + */ +class EnumItem { + + /** + * Public constructor. + * + * @param {number} typeId - Id of the Ignite enum type. + * + * @return {EnumItem} - new EnumItem instance + * + * @throws {IgniteClientError} if error. + */ + constructor(typeId) { + this.setTypeId(typeId); + this._ordinal = null; + this._name = null; + this._value = null; + } + + /** + * Returns Id of the Ignite enum type. + * + * @return {number} - Id of the enum type. + */ + getTypeId() { + return this._typeId; + } + + /** + * Updates Id of the Ignite enum type. + * + * @param {number} typeId - new Id of the Ignite enum type. + * + * @return {EnumItem} - the same instance of EnumItem + * + * @throws {IgniteClientError} if error. + */ + setTypeId(typeId) { + ArgumentChecker.isInteger(typeId, 'typeId'); + this._typeId = typeId; + return this; + } + + /** + * Returns ordinal of the item in the Ignite enum type + * or null if ordinal is not set. + * + * @return {number} - ordinal of the item in the Ignite enum type. + */ + getOrdinal() { + return this._ordinal; + } + + /** + * Sets or updates ordinal of the item in the Ignite enum type. + * + * @param {number} ordinal - ordinal of the item in the Ignite enum type. + * + * @return {EnumItem} - the same instance of EnumItem + * + * @throws {IgniteClientError} if error. + */ + setOrdinal(ordinal) { + ArgumentChecker.isInteger(ordinal, 'ordinal'); + this._ordinal = ordinal; + return this; + } + + /** + * Returns name of the item + * or null if name is not set. + * + * @return {string} - name of the item. + */ + getName() { + return this._name; + } + + /** + * Sets or updates name of the item. + * + * @param {string} name - name of the item. + * + * @return {EnumItem} - the same instance of EnumItem + * + * @throws {IgniteClientError} if error. + */ + setName(name) { + ArgumentChecker.notEmpty(name, 'name'); + this._name = name; + return this; + } + + /** + * Returns value of the item + * or null if value is not set. + * + * @return {number} - value of the item. + */ + getValue() { + return this._value; + } + + /** + * Sets or updates value of the item. + * + * @param {number} value - value of the item. + * + * @return {EnumItem} - the same instance of EnumItem + * + * @throws {IgniteClientError} if error. + */ + setValue(value) { + ArgumentChecker.isInteger(value, 'value'); + this._value = value; + return this; + } + + /** Private methods */ + + /** + * @ignore + */ + async _write(buffer) { + buffer.writeInteger(this._typeId); + if (this._ordinal !== null) { + buffer.writeInteger(this._ordinal); + return; + } + else if (this._name !== null || this._value !== null) { + const type = await this._getType(this._typeId); + if (type._isEnum && type._enumValues) { + for (let i = 0; i < type._enumValues.length; i++) { + if (this._name === type._enumValues[i][0] || + this._value === type._enumValues[i][1]) { + buffer.writeInteger(i); + return; + } + } + } + } + throw Errors.IgniteClientError.illegalArgumentError( + 'Proper ordinal, name or value must be specified for EnumItem'); + } + + /** + * @ignore + */ + async _read(buffer) { + this._typeId = buffer.readInteger(); + this._ordinal = buffer.readInteger(); + const type = await this._getType(this._typeId); + if (!type._isEnum || !type._enumValues || type._enumValues.length <= this._ordinal) { + throw new Errors.IgniteClientError('EnumItem can not be deserialized: type mismatch'); + } + this._name = type._enumValues[this._ordinal][0]; + this._value = type._enumValues[this._ordinal][1]; + } + + /** + * @ignore + */ + async _getType(typeId) { + const BinaryTypeStorage = require('./internal/BinaryTypeStorage'); + return await BinaryTypeStorage.getEntity().getType(typeId); + } +} + +module.exports = EnumItem; +</code></pre> + </article> + </section> + + + + +</div> + +<nav> + <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BinaryObject.html">BinaryObject</a></li><li><a href="CacheClient.html">CacheClient</a></li><li><a href="CacheConfiguration.html">CacheConfiguration</a></li><li><a href="CacheEntry.html">CacheEntry</a></li><li><a href="CacheKeyConfiguration.html">CacheKeyConfiguration</a></li><li><a href="CollectionObjectType.html">CollectionObjectType</a></li><li><a href="ComplexObjectType.html">ComplexObjectType</a></li><li><a href="CompositeType.html">CompositeType</a></li><li><a href="Cursor.html">Cursor</a></li><li><a href="EnumItem.html">EnumItem</a></li><li><a href="IgniteClient.html">IgniteClient</a></li><li><a href="IgniteClientConfiguration.html">IgniteClientConfiguration</a></li><li><a href="IgniteClientError.html">IgniteClientError</a></li><li><a href="IllegalStateError.html">IllegalStateError</a></li><li><a href="LostConnectionError.html">LostConnectionError</a></li><li><a href="MapObjectType.html">MapObjectType</ a></li><li><a href="ObjectArrayType.html">ObjectArrayType</a></li><li><a href="ObjectType.html">ObjectType</a></li><li><a href="OperationError.html">OperationError</a></li><li><a href="Query.html">Query</a></li><li><a href="QueryEntity.html">QueryEntity</a></li><li><a href="QueryField.html">QueryField</a></li><li><a href="QueryIndex.html">QueryIndex</a></li><li><a href="ScanQuery.html">ScanQuery</a></li><li><a href="SqlFieldsCursor.html">SqlFieldsCursor</a></li><li><a href="SqlFieldsQuery.html">SqlFieldsQuery</a></li><li><a href="SqlQuery.html">SqlQuery</a></li><li><a href="Timestamp.html">Timestamp</a></li></ul> +</nav> + +<br class="clear"> + +<footer> + Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue May 22 2018 12:08:48 GMT+0300 (Russia TZ 2 Standard Time) +</footer> + +<script> prettyPrint(); </script> +<script src="scripts/linenumber.js"> </script> +</body> +</html> http://git-wip-us.apache.org/repos/asf/ignite/blob/c56d16fb/modules/platforms/nodejs/api_spec/Errors.js.html ---------------------------------------------------------------------- diff --git a/modules/platforms/nodejs/api_spec/Errors.js.html b/modules/platforms/nodejs/api_spec/Errors.js.html new file mode 100644 index 0000000..220d2e8 --- /dev/null +++ b/modules/platforms/nodejs/api_spec/Errors.js.html @@ -0,0 +1,172 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <title>JSDoc: Source: Errors.js</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">Source: Errors.js</h1> + + + + + + + <section> + <article> + <pre class="prettyprint source linenums"><code>/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +const Util = require('util'); + +/** + * Base Ignite client error class. + */ +class IgniteClientError extends Error { + constructor(message) { + super(message); + } + + /** + * Ignite client does not support one of the specified or received data types. + * @ignore + */ + static unsupportedTypeError(type) { + const BinaryUtils = require('./internal/BinaryUtils'); + return new IgniteClientError(Util.format('Type %s is not supported', BinaryUtils.getTypeName(type))); + } + + /** + * The real type of data is not equal to the specified one. + * @ignore + */ + static typeCastError(fromType, toType) { + const BinaryUtils = require('./internal/BinaryUtils'); + return new IgniteClientError(Util.format('Type "%s" can not be cast to %s', + BinaryUtils.getTypeName(fromType), BinaryUtils.getTypeName(toType))); + } + + /** + * The real value can not be cast to the specified type. + * @ignore + */ + static valueCastError(value, toType) { + const BinaryUtils = require('./internal/BinaryUtils'); + return new IgniteClientError(Util.format('Value "%s" can not be cast to %s', + value, BinaryUtils.getTypeName(toType))); + } + + /** + * An illegal or inappropriate argument has been passed to the API method. + * @ignore + */ + static illegalArgumentError(message) { + return new IgniteClientError(message); + } + + /** + * Ignite client internal error. + * @ignore + */ + static internalError(message = null) { + return new IgniteClientError(message || 'Internal library error'); + } + + /** + * Serialization/deserialization errors. + * @ignore + */ + static serializationError(serialize, message = null) { + let msg = serialize ? 'Complex object can not be serialized' : 'Complex object can not be deserialized'; + if (message) { + msg = msg + ': ' + message; + } + return new IgniteClientError(msg); + } +} + +/** + * Ignite server returns error for the requested operation. + * @extends IgniteClientError + */ +class OperationError extends IgniteClientError { + constructor(message) { + super(message); + } +} + +/** + * Ignite client is not in an appropriate state for the requested operation. + * @extends IgniteClientError + */ +class IllegalStateError extends IgniteClientError { + constructor(message = null) { + super(message || 'Ignite client is not in an appropriate state for the requested operation'); + } +} + +/** + * The requested operation is not completed due to the connection lost. + * @extends IgniteClientError + */ +class LostConnectionError extends IgniteClientError { + constructor(message = null) { + super(message || 'Request is not completed due to the connection lost'); + } +} + +module.exports.IgniteClientError = IgniteClientError; +module.exports.OperationError = OperationError; +module.exports.IllegalStateError = IllegalStateError; +module.exports.LostConnectionError = LostConnectionError; +</code></pre> + </article> + </section> + + + + +</div> + +<nav> + <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BinaryObject.html">BinaryObject</a></li><li><a href="CacheClient.html">CacheClient</a></li><li><a href="CacheConfiguration.html">CacheConfiguration</a></li><li><a href="CacheEntry.html">CacheEntry</a></li><li><a href="CacheKeyConfiguration.html">CacheKeyConfiguration</a></li><li><a href="CollectionObjectType.html">CollectionObjectType</a></li><li><a href="ComplexObjectType.html">ComplexObjectType</a></li><li><a href="CompositeType.html">CompositeType</a></li><li><a href="Cursor.html">Cursor</a></li><li><a href="EnumItem.html">EnumItem</a></li><li><a href="IgniteClient.html">IgniteClient</a></li><li><a href="IgniteClientConfiguration.html">IgniteClientConfiguration</a></li><li><a href="IgniteClientError.html">IgniteClientError</a></li><li><a href="IllegalStateError.html">IllegalStateError</a></li><li><a href="LostConnectionError.html">LostConnectionError</a></li><li><a href="MapObjectType.html">MapObjectType</ a></li><li><a href="ObjectArrayType.html">ObjectArrayType</a></li><li><a href="ObjectType.html">ObjectType</a></li><li><a href="OperationError.html">OperationError</a></li><li><a href="Query.html">Query</a></li><li><a href="QueryEntity.html">QueryEntity</a></li><li><a href="QueryField.html">QueryField</a></li><li><a href="QueryIndex.html">QueryIndex</a></li><li><a href="ScanQuery.html">ScanQuery</a></li><li><a href="SqlFieldsCursor.html">SqlFieldsCursor</a></li><li><a href="SqlFieldsQuery.html">SqlFieldsQuery</a></li><li><a href="SqlQuery.html">SqlQuery</a></li><li><a href="Timestamp.html">Timestamp</a></li></ul> +</nav> + +<br class="clear"> + +<footer> + Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue May 22 2018 12:08:48 GMT+0300 (Russia TZ 2 Standard Time) +</footer> + +<script> prettyPrint(); </script> +<script src="scripts/linenumber.js"> </script> +</body> +</html>