blob: 9525878e37ef39f3bfdac8127c37b45496523e41 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: CacheClient</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: CacheClient</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>CacheClient</h2>
<div class="class-description"><p>Class representing and providing access to Ignite cache.</p>
<p>The class has no public constructor. An instance of this class should be obtained
via the methods of <a href="IgniteClient.html">IgniteClient</a> objects.
One instance of this class provides access to one Ignite cache which is specified
during the instance obtaining and cannot be changed after that.</p>
<p>There are three groups of methods in the cache client:</p>
<ul>
<li>methods to configure the cache client</li>
<li>methods to operate with the cache using Key-Value Queries</li>
<li>methods to operate with the cache using SQL and Scan Queries</li>
</ul></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="CacheClient.js.html">CacheClient.js</a>, <a href="CacheClient.js.html#line60">line 60</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id=".PEEK_MODE"><span class="type-signature">(static, readonly) </span>PEEK_MODE<span class="type-signature"></span></h4>
<div class="description">
<p>Peek modes</p>
</div>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>ALL</code></td>
<td class="type">
</td>
<td class="description last"><p>0</p></td>
</tr>
<tr>
<td class="name"><code>NEAR</code></td>
<td class="type">
</td>
<td class="description last"><p>1</p></td>
</tr>
<tr>
<td class="name"><code>PRIMARY</code></td>
<td class="type">
</td>
<td class="description last"><p>2</p></td>
</tr>
<tr>
<td class="name"><code>BACKUP</code></td>
<td class="type">
</td>
<td class="description last"><p>3</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="CacheClient.js.html">CacheClient.js</a>, <a href="CacheClient.js.html#line28">line 28</a>
</li></ul></dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="clear"><span class="type-signature">(async) </span>clear<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Removes all entries from the cache, without notifying listeners and cache writers.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="CacheClient.js.html">CacheClient.js</a>, <a href="CacheClient.js.html#line397">line 397</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>
<h4 class="name" id="clearKey"><span class="type-signature">(async) </span>clearKey<span class="signature">(key)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Removes entry with the specified key from the cache, without notifying listeners and cache writers.</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>key</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>key to be removed.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="CacheClient.js.html">CacheClient.js</a>, <a href="CacheClient.js.html#line414">line 414</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>
<h4 class="name" id="clearKeys"><span class="type-signature">(async) </span>clearKeys<span class="signature">(keys)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Removes entries with the specified keys from the cache, without notifying listeners and cache writers.</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>keys</code></td>
<td class="type">
<span class="param-type">Array.&lt;*></span>
</td>
<td class="description last"><p>keys to be removed.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="CacheClient.js.html">CacheClient.js</a>, <a href="CacheClient.js.html#line427">line 427</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>
<h4 class="name" id="containsKey"><span class="type-signature">(async) </span>containsKey<span class="signature">(key)</span><span class="type-signature"> &rarr; {Promise.&lt;boolean>}</span></h4>
<div class="description">
<p>Checks if the specified key exists in the cache.</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>key</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>key to check.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="CacheClient.js.html">CacheClient.js</a>, <a href="CacheClient.js.html#line231">line 231</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>true if the key exists, false otherwise.</li>
</ul>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;boolean></span>
</dd>
</dl>
<h4 class="name" id="containsKeys"><span class="type-signature">(async) </span>containsKeys<span class="signature">(keys)</span><span class="type-signature"> &rarr; {Promise.&lt;boolean>}</span></h4>
<div class="description">
<p>Checks if all the specified keys exist in the cache.</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>keys</code></td>
<td class="type">
<span class="param-type">Array.&lt;*></span>
</td>
<td class="description last"><p>keys to check.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="CacheClient.js.html">CacheClient.js</a>, <a href="CacheClient.js.html#line247">line 247</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>true if all the keys exist,
false if at least one of the keys does not exist in the cache.</li>
</ul>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;boolean></span>
</dd>
</dl>
<h4 class="name" id="get"><span class="type-signature">(async) </span>get<span class="signature">(key)</span><span class="type-signature"> &rarr; {Promise.&lt;*>}</span></h4>
<div class="description">
<p>Retrieves a value associated with the specified key from the cache.</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>key</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>key.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="CacheClient.js.html">CacheClient.js</a>, <a href="CacheClient.js.html#line139">line 139</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>value associated with the specified key, or null if it does not exist.</li>
</ul>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;*></span>
</dd>
</dl>
<h4 class="name" id="getAll"><span class="type-signature">(async) </span>getAll<span class="signature">(keys)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="CacheEntry.html">CacheEntry</a>>>}</span></h4>
<div class="description">
<p>Retrieves entries associated with the specified keys from the cache.</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>keys</code></td>
<td class="type">
<span class="param-type">Array.&lt;*></span>
</td>
<td class="description last"><p>keys.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="CacheClient.js.html">CacheClient.js</a>, <a href="CacheClient.js.html#line155">line 155</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 retrieved entries (key-value pairs).
Entries with the keys which do not exist in the cache are not included into the array.</li>
</ul>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;Array.&lt;<a href="CacheEntry.html">CacheEntry</a>>></span>
</dd>
</dl>
<h4 class="name" id="getAndPut"><span class="type-signature">(async) </span>getAndPut<span class="signature">(key, value)</span><span class="type-signature"> &rarr; {Promise.&lt;*>}</span></h4>
<div class="description">
<p>Associates the specified value with the specified key in the cache
and returns the previous associated value, if any.</p>
<p>Overwrites the previous value if the key exists in the cache,
otherwise creates new entry (key-value pair).</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>key</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>key.</p></td>
</tr>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>value to be associated with the specified key.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="CacheClient.js.html">CacheClient.js</a>, <a href="CacheClient.js.html#line267">line 267</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 previous value associated with the specified key, or null if it did not exist.</li>
</ul>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;*></span>
</dd>
</dl>
<h4 class="name" id="getAndPutIfAbsent"><span class="type-signature">(async) </span>getAndPutIfAbsent<span class="signature">(key, value)</span><span class="type-signature"> &rarr; {Promise.&lt;*>}</span></h4>
<div class="description">
<p>Creates new entry (key-value pair) if the specified key does not exist in the cache.
Otherwise returns the current value associated with the existing key.</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>key</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>key.</p></td>
</tr>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>value to be associated with the specified key.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="CacheClient.js.html">CacheClient.js</a>, <a href="CacheClient.js.html#line336">line 336</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 current value associated with the key if it already exists in the cache,
null if the new entry is created.</li>
</ul>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;*></span>
</dd>
</dl>
<h4 class="name" id="getAndRemove"><span class="type-signature">(async) </span>getAndRemove<span class="signature">(key)</span><span class="type-signature"> &rarr; {Promise.&lt;*>}</span></h4>
<div class="description">
<p>Removes the cache entry with the specified key
and returns the last associated value, if any.</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>key</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>key of the entry to be removed.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="CacheClient.js.html">CacheClient.js</a>, <a href="CacheClient.js.html#line301">line 301</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 last value associated with the specified key, or null if it did not exist.</li>
</ul>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;*></span>
</dd>
</dl>
<h4 class="name" id="getAndReplace"><span class="type-signature">(async) </span>getAndReplace<span class="signature">(key, value)</span><span class="type-signature"> &rarr; {Promise.&lt;*>}</span></h4>
<div class="description">
<p>Associates the specified value with the specified key in the cache
and returns the previous associated value, if the key exists in the cache.
Otherwise does nothing and returns null.</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>key</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>key.</p></td>
</tr>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>value to be associated with the specified key.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="CacheClient.js.html">CacheClient.js</a>, <a href="CacheClient.js.html#line285">line 285</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 previous value associated with the specified key, or null if it did not exist.</li>
</ul>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;*></span>
</dd>
</dl>
<h4 class="name" id="getSize"><span class="type-signature">(async) </span>getSize<span class="signature">(&hellip;peekModes<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;number>}</span></h4>
<div class="description">
<p>Returns the number of the entries in the cache.</p>
</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>peekModes</code></td>
<td class="type">
<span class="param-type"><a href="CacheClient.html#.PEEK_MODE">CacheClient.PEEK_MODE</a></span>
</td>
<td class="attributes">
&lt;optional><br>
&lt;repeatable><br>
</td>
<td class="description last"><p>peek modes.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="CacheClient.js.html">CacheClient.js</a>, <a href="CacheClient.js.html#line502">line 502</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 number of the entries in the cache.</li>
</ul>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;number></span>
</dd>
</dl>
<h4 class="name" id="put"><span class="type-signature">(async) </span>put<span class="signature">(key, value)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Associates the specified value with the specified key in the cache.</p>
<p>Overwrites the previous value if the key exists in the cache,
otherwise creates new entry (key-value pair).</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>key</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>key.</p></td>
</tr>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>value to be associated with the specified key.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="CacheClient.js.html">CacheClient.js</a>, <a href="CacheClient.js.html#line190">line 190</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>
<h4 class="name" id="putAll"><span class="type-signature">(async) </span>putAll<span class="signature">(entries)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Associates the specified values with the specified keys in the cache.</p>
<p>Overwrites the previous value if a key exists in the cache,
otherwise creates new entry (key-value pair).</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>entries</code></td>
<td class="type">
<span class="param-type">Array.&lt;<a href="CacheEntry.html">CacheEntry</a>></span>
</td>
<td class="description last"><p>entries (key-value pairs) to be put into the cache.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="CacheClient.js.html">CacheClient.js</a>, <a href="CacheClient.js.html#line206">line 206</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>
<h4 class="name" id="putIfAbsent"><span class="type-signature">(async) </span>putIfAbsent<span class="signature">(key, value)</span><span class="type-signature"> &rarr; {Promise.&lt;boolean>}</span></h4>
<div class="description">
<p>Creates new entry (key-value pair) if the specified key does not exist in the cache.
Otherwise does nothing.</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>key</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>key.</p></td>
</tr>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>value to be associated with the specified key.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="CacheClient.js.html">CacheClient.js</a>, <a href="CacheClient.js.html#line318">line 318</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>true if the operation has been done, false otherwise.</li>
</ul>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;boolean></span>
</dd>
</dl>
<h4 class="name" id="query"><span class="type-signature">(async) </span>query<span class="signature">(query)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="Cursor.html">Cursor</a>>}</span></h4>
<div class="description">
<p>Starts an SQL or Scan query operation.</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>query</code></td>
<td class="type">
<span class="param-type"><a href="SqlQuery.html">SqlQuery</a></span>
|
<span class="param-type"><a href="SqlFieldsQuery.html">SqlFieldsQuery</a></span>
|
<span class="param-type"><a href="ScanQuery.html">ScanQuery</a></span>
</td>
<td class="description last"><p>query to be executed.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="CacheClient.js.html">CacheClient.js</a>, <a href="CacheClient.js.html#line535">line 535</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>cursor to obtain the results of the query operation:<ul>
<li><a href="SqlFieldsCursor.html">SqlFieldsCursor</a> in case of <a href="SqlFieldsQuery.html">SqlFieldsQuery</a> query</li>
<li><a href="Cursor.html">Cursor</a> in case of other types of query</li>
</ul>
</li>
</ul>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;<a href="Cursor.html">Cursor</a>></span>
</dd>
</dl>
<h4 class="name" id="removeAll"><span class="type-signature">(async) </span>removeAll<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Removes all entries from the cache, notifying listeners and cache writers.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="CacheClient.js.html">CacheClient.js</a>, <a href="CacheClient.js.html#line483">line 483</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>
<h4 class="name" id="removeIfEquals"><span class="type-signature">(async) </span>removeIfEquals<span class="signature">(key, value)</span><span class="type-signature"> &rarr; {Promise.&lt;boolean>}</span></h4>
<div class="description">
<p>Removes entry with the specified key from the cache, if the current value equals to the provided one.
Notifies listeners and cache writers.</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>key</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>key to be removed.</p></td>
</tr>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>value to be compared with the current value associated with the specified key.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="CacheClient.js.html">CacheClient.js</a>, <a href="CacheClient.js.html#line459">line 459</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>true if the operation has been done, false otherwise.</li>
</ul>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;boolean></span>
</dd>
</dl>
<h4 class="name" id="removeKey"><span class="type-signature">(async) </span>removeKey<span class="signature">(key)</span><span class="type-signature"> &rarr; {Promise.&lt;boolean>}</span></h4>
<div class="description">
<p>Removes entry with the specified key from the cache, notifying listeners and cache writers.</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>key</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>key to be removed.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="CacheClient.js.html">CacheClient.js</a>, <a href="CacheClient.js.html#line442">line 442</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>true if the operation has been done, false otherwise.</li>
</ul>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;boolean></span>
</dd>
</dl>
<h4 class="name" id="removeKeys"><span class="type-signature">(async) </span>removeKeys<span class="signature">(keys)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Removes entries with the specified keys from the cache, notifying listeners and cache writers.</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>keys</code></td>
<td class="type">
<span class="param-type">Array.&lt;*></span>
</td>
<td class="description last"><p>keys to be removed.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="CacheClient.js.html">CacheClient.js</a>, <a href="CacheClient.js.html#line472">line 472</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>
<h4 class="name" id="replace"><span class="type-signature">(async) </span>replace<span class="signature">(key, value)</span><span class="type-signature"> &rarr; {Promise.&lt;boolean>}</span></h4>
<div class="description">
<p>Associates the specified value with the specified key, if the key exists in the cache.
Otherwise does nothing.</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>key</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>key.</p></td>
</tr>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>value to be associated with the specified key.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="CacheClient.js.html">CacheClient.js</a>, <a href="CacheClient.js.html#line353">line 353</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>true if the operation has been done, false otherwise.</li>
</ul>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;boolean></span>
</dd>
</dl>
<h4 class="name" id="replaceIfEquals"><span class="type-signature">(async) </span>replaceIfEquals<span class="signature">(key, value, newValue)</span><span class="type-signature"> &rarr; {Promise.&lt;boolean>}</span></h4>
<div class="description">
<p>Associates the new value with the specified key, if the key exists in the cache
and the current value equals to the provided one.
Otherwise does nothing.</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>key</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>key.</p></td>
</tr>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>value to be compared with the current value associated with the specified key.</p></td>
</tr>
<tr>
<td class="name"><code>newValue</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>new value to be associated with the specified key.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="CacheClient.js.html">CacheClient.js</a>, <a href="CacheClient.js.html#line372">line 372</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>true if the operation has been done, false otherwise.</li>
</ul>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;boolean></span>
</dd>
</dl>
<h4 class="name" id="setKeyType"><span class="type-signature"></span>setKeyType<span class="signature">(type)</span><span class="type-signature"> &rarr; {<a href="CacheClient.html">CacheClient</a>}</span></h4>
<div class="description">
<p>Specifies a type of the cache key.</p>
<p>The cache client assumes that keys in all further operations with the cache
will have the specified type.
Eg. the cache client will convert keys provided as input parameters of the methods
to the specified object type before sending them to a server.</p>
<p>After the cache client creation a type of the cache key is not specified (null).</p>
<p>If the type is not specified then during operations the cache client
will do automatic mapping between some of the JavaScript types and 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>type</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 keys in the cache:</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="CacheClient.js.html">CacheClient.js</a>, <a href="CacheClient.js.html#line91">line 91</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 cache client.</li>
</ul>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="CacheClient.html">CacheClient</a></span>
</dd>
</dl>
<h4 class="name" id="setValueType"><span class="type-signature"></span>setValueType<span class="signature">(type)</span><span class="type-signature"> &rarr; {<a href="CacheClient.html">CacheClient</a>}</span></h4>
<div class="description">
<p>Specifies a type of the cache value.</p>
<p>The cache client assumes that values in all further operations with the cache
will have the specified type.
Eg. the cache client will convert values provided as input parameters of the methods
to the specified object type before sending them to a server.</p>
<p>After the cache client creation a type of the cache value is not specified (null).</p>
<p>If the type is not specified then during operations the cache client
will do automatic mapping between some of the JavaScript types and 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>type</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 values in the cache:</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="CacheClient.js.html">CacheClient.js</a>, <a href="CacheClient.js.html#line120">line 120</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 cache client.</li>
</ul>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="CacheClient.html">CacheClient</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>