blob: b2c055626bbd2dc54de3400bce69bebc9e2fc959 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_112) on Mon Dec 18 11:25:20 EST 2017 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>IotGateway (Apache Edgent (incubating) v1.2.0 API)</title>
<meta name="date" content="2017-12-18">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="IotGateway (Apache Edgent (incubating) v1.2.0 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/IotGateway.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html" title="interface in org.apache.edgent.connectors.iot"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/edgent/connectors/iot/QoS.html" title="interface in org.apache.edgent.connectors.iot"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/edgent/connectors/iot/IotGateway.html" target="_top">Frames</a></li>
<li><a href="IotGateway.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.edgent.connectors.iot</div>
<h2 title="Interface IotGateway" class="title">Interface IotGateway</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Superinterfaces:</dt>
<dd><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html" title="interface in org.apache.edgent.connectors.iot">IotDevice</a>, <a href="../../../../../org/apache/edgent/topology/TopologyElement.html" title="interface in org.apache.edgent.topology">TopologyElement</a></dd>
</dl>
<dl>
<dt>All Known Implementing Classes:</dt>
<dd><a href="../../../../../org/apache/edgent/connectors/iotp/IotpGateway.html" title="class in org.apache.edgent.connectors.iotp">IotpGateway</a></dd>
</dl>
<hr>
<br>
<pre>public interface <span class="typeNameLabel">IotGateway</span>
extends <a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html" title="interface in org.apache.edgent.connectors.iot">IotDevice</a></pre>
<div class="block">A generic IoT gateway device IoT hub connector.
<p>
<b>This interface is incubating and is subject to change.</b>
<p>
An IoT gateway device is a conduit for a collection of IoT devices
that lack direct connection to the enterprise IoT hub.
<p>
An IoT gateway device is an IoT device. Events can be published
that are from the gateway's deviceId and commands can be received that are targeted for it
using the gateway's <a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#events-org.apache.edgent.topology.TStream-java.lang.String-int-"><code>events()</code></a>
and <a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#commands-java.lang.String...-"><code>commands()</code></a>.
<p>
Use <a href="../../../../../org/apache/edgent/connectors/iot/IotGateway.html#getIotDevice-java.util.Map-"><code>getIotDevice(Map)</code></a> to get an <code>IotDevice</code> for a gateway connected device
or <a href="../../../../../org/apache/edgent/connectors/iot/IotGateway.html#getIotDeviceId-java.util.Map-"><code>getIotDeviceId(Map)</code></a> to get a deviceId for it.
The name/value pairs in the map are IotGateway implementation defined values.
Refer to the IotGateway implementation for details.
<p>
Events can be published that are from a connected device's deviceId and commands can be
received for that are targeted for it using
<a href="../../../../../org/apache/edgent/connectors/iot/IotGateway.html#eventsForDevice-java.lang.String-org.apache.edgent.topology.TStream-java.lang.String-int-"><code>eventsForDevice()</code></a>
and <a href="../../../../../org/apache/edgent/connectors/iot/IotGateway.html#commandsForDevice-java.util.Set-java.lang.String...-"><code>commandsForDevice()</code></a>.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../org/apache/edgent/connectors/iot/package-summary.html">Edgent generic IoT device model</a>,
<a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html" title="interface in org.apache.edgent.connectors.iot"><code>IotDevice</code></a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="fields.inherited.from.class.org.apache.edgent.connectors.iot.IotDevice">
<!-- -->
</a>
<h3>Fields inherited from interface&nbsp;org.apache.edgent.connectors.iot.<a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html" title="interface in org.apache.edgent.connectors.iot">IotDevice</a></h3>
<code><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#CMD_DEVICE">CMD_DEVICE</a>, <a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#CMD_FORMAT">CMD_FORMAT</a>, <a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#CMD_ID">CMD_ID</a>, <a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#CMD_PAYLOAD">CMD_PAYLOAD</a>, <a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#CMD_TS">CMD_TS</a>, <a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#RESERVED_ID_PREFIX">RESERVED_ID_PREFIX</a></code></li>
</ul>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a>&lt;com.google.gson.JsonObject&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/connectors/iot/IotGateway.html#commandsForDevice-java.util.Set-java.lang.String...-">commandsForDevice</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a>&lt;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;deviceIds,
<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>...&nbsp;commands)</code>
<div class="block">Create a stream of device commands as JSON objects.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a>&lt;com.google.gson.JsonObject&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/connectors/iot/IotGateway.html#commandsForDevice-java.lang.String-java.lang.String...-">commandsForDevice</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;deviceId,
<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>...&nbsp;commands)</code>
<div class="block">Create a stream of device commands as JSON objects.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a>&lt;com.google.gson.JsonObject&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/connectors/iot/IotGateway.html#commandsForType-java.lang.String-java.lang.String...-">commandsForType</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;deviceTypeId,
<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>...&nbsp;commands)</code>
<div class="block">Create a stream of device commands as JSON objects.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/edgent/topology/TSink.html" title="interface in org.apache.edgent.topology">TSink</a>&lt;com.google.gson.JsonObject&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/connectors/iot/IotGateway.html#eventsForDevice-org.apache.edgent.function.Function-org.apache.edgent.topology.TStream-org.apache.edgent.function.Function-org.apache.edgent.function.UnaryOperator-org.apache.edgent.function.Function-">eventsForDevice</a></span>(<a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a>&lt;com.google.gson.JsonObject,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;deviceId,
<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a>&lt;com.google.gson.JsonObject&gt;&nbsp;stream,
<a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a>&lt;com.google.gson.JsonObject,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;eventId,
<a href="../../../../../org/apache/edgent/function/UnaryOperator.html" title="interface in org.apache.edgent.function">UnaryOperator</a>&lt;com.google.gson.JsonObject&gt;&nbsp;payload,
<a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a>&lt;com.google.gson.JsonObject,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&gt;&nbsp;qos)</code>
<div class="block">Publish a stream's tuples as device events.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/edgent/topology/TSink.html" title="interface in org.apache.edgent.topology">TSink</a>&lt;com.google.gson.JsonObject&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/connectors/iot/IotGateway.html#eventsForDevice-java.lang.String-org.apache.edgent.topology.TStream-java.lang.String-int-">eventsForDevice</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;deviceId,
<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a>&lt;com.google.gson.JsonObject&gt;&nbsp;stream,
<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;eventId,
int&nbsp;qos)</code>
<div class="block">Publish a stream's tuples as device events.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html" title="interface in org.apache.edgent.connectors.iot">IotDevice</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/connectors/iot/IotGateway.html#getIotDevice-java.util.Map-">getIotDevice</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;deviceIdAttrs)</code>
<div class="block">Get an <a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html" title="interface in org.apache.edgent.connectors.iot"><code>IotDevice</code></a> for a connected device.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html" title="interface in org.apache.edgent.connectors.iot">IotDevice</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/connectors/iot/IotGateway.html#getIotDevice-java.lang.String-">getIotDevice</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;deviceId)</code>
<div class="block">Get an <a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html" title="interface in org.apache.edgent.connectors.iot"><code>IotDevice</code></a> for a connected device.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/connectors/iot/IotGateway.html#getIotDeviceId-java.util.Map-">getIotDeviceId</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;deviceIdAttrs)</code>
<div class="block">Get a <code>deviceId</code> for a device.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.org.apache.edgent.connectors.iot.IotDevice">
<!-- -->
</a>
<h3>Methods inherited from interface&nbsp;org.apache.edgent.connectors.iot.<a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html" title="interface in org.apache.edgent.connectors.iot">IotDevice</a></h3>
<code><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#commands-java.lang.String...-">commands</a>, <a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#events-org.apache.edgent.topology.TStream-org.apache.edgent.function.Function-org.apache.edgent.function.UnaryOperator-org.apache.edgent.function.Function-">events</a>, <a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#events-org.apache.edgent.topology.TStream-java.lang.String-int-">events</a>, <a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#getDeviceId--">getDeviceId</a>, <a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#getDeviceType--">getDeviceType</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.org.apache.edgent.topology.TopologyElement">
<!-- -->
</a>
<h3>Methods inherited from interface&nbsp;org.apache.edgent.topology.<a href="../../../../../org/apache/edgent/topology/TopologyElement.html" title="interface in org.apache.edgent.topology">TopologyElement</a></h3>
<code><a href="../../../../../org/apache/edgent/topology/TopologyElement.html#topology--">topology</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getIotDevice-java.util.Map-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getIotDevice</h4>
<pre><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html" title="interface in org.apache.edgent.connectors.iot">IotDevice</a>&nbsp;getIotDevice(<a href="http://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;deviceIdAttrs)</pre>
<div class="block">Get an <a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html" title="interface in org.apache.edgent.connectors.iot"><code>IotDevice</code></a> for a connected device.
No external validation of the attribute values is performed.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>deviceIdAttrs</code> - IotGateway implementation specific attributes
that identify a device.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>IotDevice</dd>
</dl>
</li>
</ul>
<a name="getIotDeviceId-java.util.Map-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getIotDeviceId</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getIotDeviceId(<a href="http://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;deviceIdAttrs)</pre>
<div class="block">Get a <code>deviceId</code> for a device.
Logically equivalent to <code>getIotDevice(deviceIdAttrs).getDeviceId()</code>.
No external validation of the attribute values is performed.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>deviceIdAttrs</code> - IotGateway implementation specific attributes
that identify a device.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>deviceId</dd>
</dl>
</li>
</ul>
<a name="getIotDevice-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getIotDevice</h4>
<pre><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html" title="interface in org.apache.edgent.connectors.iot">IotDevice</a>&nbsp;getIotDevice(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;deviceId)</pre>
<div class="block">Get an <a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html" title="interface in org.apache.edgent.connectors.iot"><code>IotDevice</code></a> for a connected device.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>deviceId</code> - a value from <a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#getDeviceId--"><code>IotDevice.getDeviceId()</code></a>.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>IotDevice</dd>
</dl>
</li>
</ul>
<a name="eventsForDevice-org.apache.edgent.function.Function-org.apache.edgent.topology.TStream-org.apache.edgent.function.Function-org.apache.edgent.function.UnaryOperator-org.apache.edgent.function.Function-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>eventsForDevice</h4>
<pre><a href="../../../../../org/apache/edgent/topology/TSink.html" title="interface in org.apache.edgent.topology">TSink</a>&lt;com.google.gson.JsonObject&gt;&nbsp;eventsForDevice(<a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a>&lt;com.google.gson.JsonObject,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;deviceId,
<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a>&lt;com.google.gson.JsonObject&gt;&nbsp;stream,
<a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a>&lt;com.google.gson.JsonObject,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;eventId,
<a href="../../../../../org/apache/edgent/function/UnaryOperator.html" title="interface in org.apache.edgent.function">UnaryOperator</a>&lt;com.google.gson.JsonObject&gt;&nbsp;payload,
<a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a>&lt;com.google.gson.JsonObject,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&gt;&nbsp;qos)</pre>
<div class="block">Publish a stream's tuples as device events.
Each tuple is published as a device event with the supplied functions
providing the device identifier, event identifier, payload and QoS.
The values can be generated based upon the tuple.
<p>
Events for a particular device can also be published via its
<a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#events-org.apache.edgent.topology.TStream-org.apache.edgent.function.Function-org.apache.edgent.function.UnaryOperator-org.apache.edgent.function.Function-"><code>IotDevice.events()</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>deviceId</code> - function to supply the device-id that the event is associated with.</dd>
<dd><code>stream</code> - Stream to be published.</dd>
<dd><code>eventId</code> - function to supply the event identifier.</dd>
<dd><code>payload</code> - function to supply the event's payload.</dd>
<dd><code>qos</code> - function to supply the event's delivery Quality of Service.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>TSink sink element representing termination of this stream.</dd>
</dl>
</li>
</ul>
<a name="eventsForDevice-java.lang.String-org.apache.edgent.topology.TStream-java.lang.String-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>eventsForDevice</h4>
<pre><a href="../../../../../org/apache/edgent/topology/TSink.html" title="interface in org.apache.edgent.topology">TSink</a>&lt;com.google.gson.JsonObject&gt;&nbsp;eventsForDevice(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;deviceId,
<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a>&lt;com.google.gson.JsonObject&gt;&nbsp;stream,
<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;eventId,
int&nbsp;qos)</pre>
<div class="block">Publish a stream's tuples as device events.
Each tuple is published as a device event with the supplied
device identifier, event identifier and QoS.
<p>
Events for a particular device can also be published via its
<a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#events-org.apache.edgent.topology.TStream-java.lang.String-int-"><code>IotDevice.event()</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>deviceId</code> - Device-id that the event is associated with.</dd>
<dd><code>stream</code> - Stream to be published.</dd>
<dd><code>eventId</code> - Event identifier.</dd>
<dd><code>qos</code> - Event's delivery Quality of Service.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>TSink sink element representing termination of this stream.</dd>
</dl>
</li>
</ul>
<a name="commandsForDevice-java.util.Set-java.lang.String...-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>commandsForDevice</h4>
<pre><a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a>&lt;com.google.gson.JsonObject&gt;&nbsp;commandsForDevice(<a href="http://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a>&lt;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;deviceIds,
<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>...&nbsp;commands)</pre>
<div class="block">Create a stream of device commands as JSON objects.
Each command sent to one of the specified <code>deviceIds</code> matching <code>commands</code> will
result in a tuple on the stream. The JSON object has these keys:
<UL>
<LI><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#CMD_DEVICE"><code>device</code></a> - Command's opaque target device's id String.
<LI><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#CMD_ID"><code>command</code></a> - Command identifier as a String</LI>
<LI><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#CMD_TS"><code>tsms</code></a> - Timestamp of the command in milliseconds since the 1970/1/1 epoch.</LI>
<LI><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#CMD_FORMAT"><code>format</code></a> - Format of the command as a String</LI>
<LI><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#CMD_PAYLOAD"><code>payload</code></a> - Payload of the command
<UL>
<LI>If <code>format</code> is <code>json</code> then <code>payload</code> is JSON</LI>
<LI>Otherwise <code>payload</code> is String</LI>
</UL>
</LI>
</UL>
Logically equivalent to a union of a collection of individual IotDevice specific
command streams but enables an IotGateway implementation to implement it more efficiently.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>deviceIds</code> - Filter to include commands for the specified deviceIds
If the set is empty no filtering occurs. The commands for any device are included.</dd>
<dd><code>commands</code> - Command identifiers to include. If no command identifiers are provided then the
stream will contain all device commands for the specified devices.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Stream containing device commands.</dd>
</dl>
</li>
</ul>
<a name="commandsForDevice-java.lang.String-java.lang.String...-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>commandsForDevice</h4>
<pre><a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a>&lt;com.google.gson.JsonObject&gt;&nbsp;commandsForDevice(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;deviceId,
<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>...&nbsp;commands)</pre>
<div class="block">Create a stream of device commands as JSON objects.
Each command sent to the specified <code>deviceId</code> matching <code>commands</code> will
result in a tuple on the stream. The JSON object has these keys:
<UL>
<LI><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#CMD_DEVICE"><code>device</code></a> - Command's target device's opaque id String.
<LI><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#CMD_ID"><code>command</code></a> - Command identifier as a String</LI>
<LI><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#CMD_TS"><code>tsms</code></a> - Timestamp of the command in milliseconds since the 1970/1/1 epoch.</LI>
<LI><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#CMD_FORMAT"><code>format</code></a> - Format of the command as a String</LI>
<LI><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#CMD_PAYLOAD"><code>payload</code></a> - Payload of the command
<UL>
<LI>If <code>format</code> is <code>json</code> then <code>payload</code> is JSON</LI>
<LI>Otherwise <code>payload</code> is String</LI>
</UL>
</LI>
</UL>
<P>
Equivalent to <code>commandsForDevice(Collections.singleton(deviceId)), ...</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>deviceId</code> - Filter to include commands for the specified deviceId</dd>
<dd><code>commands</code> - Command identifiers to include. If no command identifiers are provided then the
stream will contain all device commands for the specified device.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Stream containing device commands.</dd>
</dl>
</li>
</ul>
<a name="commandsForType-java.lang.String-java.lang.String...-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>commandsForType</h4>
<pre><a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a>&lt;com.google.gson.JsonObject&gt;&nbsp;commandsForType(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;deviceTypeId,
<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>...&nbsp;commands)</pre>
<div class="block">Create a stream of device commands as JSON objects.
Each command sent to connected devices of type <code>deviceTypeId</code> matching <code>commands</code>
will result in a tuple on the stream. The JSON object has these keys:
<UL>
<LI><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#CMD_DEVICE"><code>device</code></a> - Command's target device's opaque id String.
<LI><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#CMD_ID"><code>command</code></a> - Command identifier as a String</LI>
<LI><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#CMD_TS"><code>tsms</code></a> - Timestamp of the command in milliseconds since the 1970/1/1 epoch.</LI>
<LI><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#CMD_FORMAT"><code>format</code></a> - Format of the command as a String</LI>
<LI><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#CMD_PAYLOAD"><code>payload</code></a> - Payload of the command
<UL>
<LI>If <code>format</code> is <code>json</code> then <code>payload</code> is JSON</LI>
<LI>Otherwise <code>payload</code> is String</LI>
</UL>
</LI>
</UL>
<P>
An IoT connector implementation may throw
<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/UnsupportedOperationException.html?is-external=true" title="class or interface in java.lang"><code>UnsupportedOperationException</code></a>
if it does not support this capability. See the implementation's documentation.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>deviceTypeId</code> - Only return commands for connected devices with the specified
device type id value (a value from <a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#getDeviceType--"><code>IotDevice.getDeviceType()</code></a>).</dd>
<dd><code>commands</code> - Command identifiers to include. If no command identifiers are provided then the
stream will contain all device commands for devices with the specified device type id.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Stream containing device commands.</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/IotGateway.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html" title="interface in org.apache.edgent.connectors.iot"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/edgent/connectors/iot/QoS.html" title="interface in org.apache.edgent.connectors.iot"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/edgent/connectors/iot/IotGateway.html" target="_top">Frames</a></li>
<li><a href="IotGateway.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2016&#x2013;2017 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>