blob: 8ba6d2c56acfa945cfdc1b2095983df906ad97c0 [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>IotDevice (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="IotDevice (Apache Edgent (incubating) v1.2.0 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":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/IotDevice.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/HeartBeat.html" title="class in org.apache.edgent.connectors.iot"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/edgent/connectors/iot/IotGateway.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/IotDevice.html" target="_top">Frames</a></li>
<li><a href="IotDevice.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><a href="#field.summary">Field</a>&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><a href="#field.detail">Field</a>&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 IotDevice" class="title">Interface IotDevice</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/topology/TopologyElement.html" title="interface in org.apache.edgent.topology">TopologyElement</a></dd>
</dl>
<dl>
<dt>All Known Subinterfaces:</dt>
<dd><a href="../../../../../org/apache/edgent/connectors/iot/IotGateway.html" title="interface in org.apache.edgent.connectors.iot">IotGateway</a></dd>
</dl>
<dl>
<dt>All Known Implementing Classes:</dt>
<dd><a href="../../../../../org/apache/edgent/connectors/iotp/IotpDevice.html" title="class in org.apache.edgent.connectors.iotp">IotpDevice</a>, <a href="../../../../../org/apache/edgent/connectors/iotp/IotpGateway.html" title="class in org.apache.edgent.connectors.iotp">IotpGateway</a>, <a href="../../../../../org/apache/edgent/connectors/mqtt/iot/MqttDevice.html" title="class in org.apache.edgent.connectors.mqtt.iot">MqttDevice</a></dd>
</dl>
<hr>
<br>
<pre>public interface <span class="typeNameLabel">IotDevice</span>
extends <a href="../../../../../org/apache/edgent/topology/TopologyElement.html" title="interface in org.apache.edgent.topology">TopologyElement</a></pre>
<div class="block">A generic IoT device IoT hub connector.
<p>
IotDevice characteristics:
<ul>
<li><code>IotDevice.getDeviceTypeId()</code> returns an opaque value whose form
is the domain of an IoT connector implementation.</li>
<li><code>IotDevice.getDeviceId()</code> returns an opaque value whose form
is the domain of an IoT connector implementation.
The value is unique for a particular a logical device.
<li><code>IotDevice.equals()</code> returns true if two IotDevice instances are
for the same logical device, false otherwise.</li>
<li><code>IotDevice.hashCode()</code> returns the same value for all IotDevice instances
for the same logical device.</li>
</ul></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/IotGateway.html" title="interface in org.apache.edgent.connectors.iot"><code>IotGateway</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>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <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/IotDevice.html#CMD_DEVICE">CMD_DEVICE</a></span></code>
<div class="block">Device identifier key.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <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/IotDevice.html#CMD_FORMAT">CMD_FORMAT</a></span></code>
<div class="block">Command format key.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <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/IotDevice.html#CMD_ID">CMD_ID</a></span></code>
<div class="block">Command identifier key.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <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/IotDevice.html#CMD_PAYLOAD">CMD_PAYLOAD</a></span></code>
<div class="block">Command payload key.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <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/IotDevice.html#CMD_TS">CMD_TS</a></span></code>
<div class="block">Command timestamp (in milliseconds) key.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <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/IotDevice.html#RESERVED_ID_PREFIX">RESERVED_ID_PREFIX</a></span></code>
<div class="block">Device event and command identifiers starting with "edgent" are reserved for use by Edgent.</div>
</td>
</tr>
</table>
</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/IotDevice.html#commands-java.lang.String...-">commands</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;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/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/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></span>(<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="i2" 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/IotDevice.html#events-org.apache.edgent.topology.TStream-java.lang.String-int-">events</a></span>(<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="i3" 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/IotDevice.html#getDeviceId--">getDeviceId</a></span>()</code>
<div class="block">Get the device's unique opaque device identifier.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<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/IotDevice.html#getDeviceType--">getDeviceType</a></span>()</code>
<div class="block">Get the device's opaque device type identifier.</div>
</td>
</tr>
</table>
<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">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="RESERVED_ID_PREFIX">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>RESERVED_ID_PREFIX</h4>
<pre>static final&nbsp;<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> RESERVED_ID_PREFIX</pre>
<div class="block">Device event and command identifiers starting with "edgent" are reserved for use by Edgent.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../constant-values.html#org.apache.edgent.connectors.iot.IotDevice.RESERVED_ID_PREFIX">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="CMD_ID">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>CMD_ID</h4>
<pre>static final&nbsp;<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> CMD_ID</pre>
<div class="block">Command identifier key.
Key is "command".</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#commands-java.lang.String...-"><code>commands(String...)</code></a>,
<a href="../../../../../constant-values.html#org.apache.edgent.connectors.iot.IotDevice.CMD_ID">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="CMD_TS">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>CMD_TS</h4>
<pre>static final&nbsp;<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> CMD_TS</pre>
<div class="block">Command timestamp (in milliseconds) key.
Key is "tsms".</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#commands-java.lang.String...-"><code>commands(String...)</code></a>,
<a href="../../../../../constant-values.html#org.apache.edgent.connectors.iot.IotDevice.CMD_TS">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="CMD_FORMAT">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>CMD_FORMAT</h4>
<pre>static final&nbsp;<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> CMD_FORMAT</pre>
<div class="block">Command format key.
Key is "format".</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#commands-java.lang.String...-"><code>commands(String...)</code></a>,
<a href="../../../../../constant-values.html#org.apache.edgent.connectors.iot.IotDevice.CMD_FORMAT">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="CMD_PAYLOAD">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>CMD_PAYLOAD</h4>
<pre>static final&nbsp;<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> CMD_PAYLOAD</pre>
<div class="block">Command payload key.
If the command format is <code>json</code> then
the key's value will be a <code>JsonObject</code>,
otherwise a <code>String</code>.
Key is "payload".</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#commands-java.lang.String...-"><code>commands(String...)</code></a>,
<a href="../../../../../constant-values.html#org.apache.edgent.connectors.iot.IotDevice.CMD_PAYLOAD">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="CMD_DEVICE">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>CMD_DEVICE</h4>
<pre>static final&nbsp;<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> CMD_DEVICE</pre>
<div class="block">Device identifier key.
Key is "device".
The value is the result of <a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#getDeviceId--"><code>getDeviceId()</code></a>.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#commands-java.lang.String...-"><code>commands(String...)</code></a>,
<a href="../../../../../constant-values.html#org.apache.edgent.connectors.iot.IotDevice.CMD_DEVICE">Constant Field Values</a></dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getDeviceType--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDeviceType</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;getDeviceType()</pre>
<div class="block">Get the device's opaque device type identifier.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the device's type</dd>
</dl>
</li>
</ul>
<a name="getDeviceId--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDeviceId</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;getDeviceId()</pre>
<div class="block">Get the device's unique opaque device identifier.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the device's id</dd>
</dl>
</li>
</ul>
<a name="events-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>events</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;events(<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.
<p>
Each tuple is published as a device event with the supplied functions
providing the event identifier, payload and QoS. The event identifier and
QoS can be generated based upon the tuple.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<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="events-org.apache.edgent.topology.TStream-java.lang.String-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>events</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;events(<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.
<p>
Each tuple is published as a device event with fixed event identifier and
QoS.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<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="commands-java.lang.String...-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>commands</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;commands(<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 device 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></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>commands</code> - Command identifiers to include. If no command identifiers are provided then the
stream will contain all of this IotDevice's device commands.</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/IotDevice.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/HeartBeat.html" title="class in org.apache.edgent.connectors.iot"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/edgent/connectors/iot/IotGateway.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/IotDevice.html" target="_top">Frames</a></li>
<li><a href="IotDevice.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><a href="#field.summary">Field</a>&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><a href="#field.detail">Field</a>&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>