blob: 783062ce0ac661b9e2297ad719db3676de11e9ba [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: DataCacheOperation</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<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: DataCacheOperation</h1>
<section>
<header>
<h2>
DataCacheOperation
</h2>
</header>
<article>
<div class="container-overview">
<dt>
<h4 class="name" id="DataCacheOperation"><span class="type-signature"></span>new DataCacheOperation<span class="signature">(stateMachine, promise, isCancelable, index, count, data, pending)</span><span class="type-signature"> &rarr; {<a href="DataCacheOperation.html">DataCacheOperation</a>}</span></h4>
</dt>
<dd>
<div class="description">
Creates a new operation object.
</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>stateMachine</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">State machine that describes the specific behavior of the operation.</td>
</tr>
<tr>
<td class="name"><code>promise</code></td>
<td class="type">
<span class="param-type"><a href="DjsDeferred.html">DjsDeferred</a></span>
</td>
<td class="description last">Promise for requested values.</td>
</tr>
<tr>
<td class="name"><code>isCancelable</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">Whether this operation can be canceled or not.</td>
</tr>
<tr>
<td class="name"><code>index</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Index of first item requested.</td>
</tr>
<tr>
<td class="name"><code>count</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Count of items requested.</td>
</tr>
<tr>
<td class="name"><code>data</code></td>
<td class="type">
<span class="param-type">Array</span>
</td>
<td class="description last">Array with the items requested by the operation.</td>
</tr>
<tr>
<td class="name"><code>pending</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Total number of pending prefetch records.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="cache.js.html">cache.js</a>, <a href="cache.js.html#line207">line 207</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
A new data cache operation instance.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="DataCacheOperation.html">DataCacheOperation</a></span>
</dd>
</dl>
</dd>
</div>
<h3 class="subsection-title">Methods</h3>
<dl>
<dt>
<h4 class="name" id="cancel"><span class="type-signature"></span>cancel<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Transitions this operation to the cancel state and sets the canceled flag to true.
The function is a no-op if the operation is non-cancelable.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="cache.js.html">cache.js</a>, <a href="cache.js.html#line234">line 234</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="complete"><span class="type-signature"></span>complete<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Transitions this operation to the end state.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="cache.js.html">cache.js</a>, <a href="cache.js.html#line251">line 251</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="error"><span class="type-signature"></span>error<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Transitions this operation to the error state.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="cache.js.html">cache.js</a>, <a href="cache.js.html#line260">line 260</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="fireCanceled"><span class="type-signature"></span>fireCanceled<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Fires a canceled notification as necessary.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="cache.js.html">cache.js</a>, <a href="cache.js.html#line396">line 396</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="fireRejected"><span class="type-signature"></span>fireRejected<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Fires a rejected notification as necessary.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="cache.js.html">cache.js</a>, <a href="cache.js.html#line383">line 383</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="fireResolved"><span class="type-signature"></span>fireResolved<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Fires a resolved notification as necessary.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="cache.js.html">cache.js</a>, <a href="cache.js.html#line370">line 370</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="operationStateMachine"><span class="type-signature"></span>operationStateMachine<span class="signature">(opTargetState, cacheState, <span class="optional">data</span>)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
State machine that describes all operations common behavior.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>opTargetState</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
</td>
<td class="description last">Operation state to transition to.</td>
</tr>
<tr>
<td class="name"><code>cacheState</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
</td>
<td class="description last">Current cache state.</td>
</tr>
<tr>
<td class="name"><code>data</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">Additional data passed to the state.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="cache.js.html">cache.js</a>, <a href="cache.js.html#line290">line 290</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="run"><span class="type-signature"></span>run<span class="signature">(state)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Executes the operation's current state in the context of a new cache state.
</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>state</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">New cache state.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="cache.js.html">cache.js</a>, <a href="cache.js.html#line271">line 271</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="transition"><span class="type-signature"></span>transition<span class="signature">(state, <span class="optional">data</span>)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Transitions this operation to a new state.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>state</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
</td>
<td class="description last">State to transition the operation to.</td>
</tr>
<tr>
<td class="name"><code>data</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">-</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="cache.js.html">cache.js</a>, <a href="cache.js.html#line356">line 356</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="wait"><span class="type-signature"></span>wait<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Transitions this operation to the wait state.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="cache.js.html">cache.js</a>, <a href="cache.js.html#line281">line 281</a>
</li></ul></dd>
</dl>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Index</a></h2><h3>Modules</h3><ul><li><a href="module-cache.html">cache</a></li><li><a href="source.html">cache/source</a></li><li><a href="module-odata.html">odata</a></li><li><a href="batch.html">odata/batch</a></li><li><a href="handler.html">odata/handler</a></li><li><a href="json.html">odata/json</a></li><li><a href="metadata.html">odata/metadata</a></li><li><a href="net.html">odata/net</a></li><li><a href="utils.html">odata/utils</a></li><li><a href="deferred.html">odatajs/deferred</a></li><li><a href="utils_.html">odatajs/utils</a></li><li><a href="xml.html">odatajs/xml</a></li><li><a href="module-store.html">store</a></li><li><a href="dom.html">store/dom</a></li><li><a href="indexeddb.html">store/indexeddb</a></li><li><a href="memory.html">store/memory</a></li></ul><h3>Classes</h3><ul><li><a href="DataCache.html">DataCache</a></li><li><a href="DataCacheOperation.html">DataCacheOperation</a></li><li><a href="DjsDeferred.html">DjsDeferred</a></li><li><a href="dom-DomStore.html">DomStore</a></li><li><a href="indexeddb-IndexedDBStore.html">IndexedDBStore</a></li><li><a href="memory-MemoryStore.html">MemoryStore</a></li><li><a href="ODataCacheSource.html">ODataCacheSource</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br clear="both">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Thu Apr 09 2015 08:31:26 GMT+0200 (MESZ)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>