blob: b99255b7fb35b166887d907ee4e05f1173df314f [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_77) on Mon Oct 24 00:05:43 UTC 2016 -->
<title>IotpDevice (Edgent v1.0.0)</title>
<meta name="date" content="2016-10-24">
<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="IotpDevice (Edgent v1.0.0)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":9,"i4":10};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete 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/IotpDevice.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>Prev&nbsp;Class</li>
<li>Next&nbsp;Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/edgent/connectors/iotp/IotpDevice.html" target="_top">Frames</a></li>
<li><a href="IotpDevice.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><a href="#constructor.summary">Constr</a>&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><a href="#constructor.detail">Constr</a>&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.iotp</div>
<h2 title="Class IotpDevice" class="title">Class IotpDevice</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.apache.edgent.connectors.iotp.IotpDevice</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</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>
<hr>
<br>
<pre>public class <span class="typeNameLabel">IotpDevice</span>
extends java.lang.Object
implements <a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html" title="interface in org.apache.edgent.connectors.iot">IotDevice</a></pre>
<div class="block">Connector for IBM Watson IoT Platform.
<BR>
IBM Watson IoT Platform is a cloud based internet of things
scale message hub that provides a device model on top of MQTT.
<code>IotpDevice</code> implements the generic device model <a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html" title="interface in org.apache.edgent.connectors.iot"><code>IotDevice</code></a>
and thus can be used as a connector for
<a href="../../../../../org/apache/edgent/providers/iot/IotProvider.html" title="class in org.apache.edgent.providers.iot"><code>IotProvider</code></a>.
<BR>
<em>Note IBM Watson IoT Platform was previously known as
IBM Internet of Things Foundation.</em></div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><code>Edgent generic device model</code>,
<a href="http://www.ibm.com/internet-of-things/iot-platform.html">IBM Watson IoT Platform</a>,
<a href="../../../../../org/apache/edgent/samples/connectors/iotp/IotpSensors.html" title="class in org.apache.edgent.samples.connectors.iotp"><code>Sample application</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 java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/connectors/iotp/IotpDevice.html#QUICKSTART_DEVICE_TYPE">QUICKSTART_DEVICE_TYPE</a></span></code>
<div class="block">Device type identifier ("iotsamples-edgent") used when using the Quickstart service.</div>
</td>
</tr>
</table>
<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_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>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/connectors/iotp/IotpDevice.html#IotpDevice-org.apache.edgent.topology.Topology-java.io.File-">IotpDevice</a></span>(<a href="../../../../../org/apache/edgent/topology/Topology.html" title="interface in org.apache.edgent.topology">Topology</a>&nbsp;topology,
java.io.File&nbsp;optionsFile)</code>
<div class="block">Create a connector to the IBM Watson IoT Platform Bluemix service.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/connectors/iotp/IotpDevice.html#IotpDevice-org.apache.edgent.topology.Topology-java.util.Properties-">IotpDevice</a></span>(<a href="../../../../../org/apache/edgent/topology/Topology.html" title="interface in org.apache.edgent.topology">Topology</a>&nbsp;topology,
java.util.Properties&nbsp;options)</code>
<div class="block">Create a connector to the IBM Watson IoT Platform Bluemix service with the device
specified by <code>options</code>.</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="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></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="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete 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/iotp/IotpDevice.html#commands-java.lang.String...-">commands</a></span>(java.lang.String...&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/iotp/IotpDevice.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,java.lang.String&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,java.lang.Integer&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/iotp/IotpDevice.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,
java.lang.String&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>static <a href="../../../../../org/apache/edgent/connectors/iotp/IotpDevice.html" title="class in org.apache.edgent.connectors.iotp">IotpDevice</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/connectors/iotp/IotpDevice.html#quickstart-org.apache.edgent.topology.Topology-java.lang.String-">quickstart</a></span>(<a href="../../../../../org/apache/edgent/topology/Topology.html" title="interface in org.apache.edgent.topology">Topology</a>&nbsp;topology,
java.lang.String&nbsp;deviceId)</code>
<div class="block">Create an <code>IotpDevice</code> connector to the Quickstart service.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/edgent/topology/Topology.html" title="interface in org.apache.edgent.topology">Topology</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/connectors/iotp/IotpDevice.html#topology--">topology</a></span>()</code>
<div class="block">Topology this element is contained in.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</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="QUICKSTART_DEVICE_TYPE">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>QUICKSTART_DEVICE_TYPE</h4>
<pre>public static final&nbsp;java.lang.String QUICKSTART_DEVICE_TYPE</pre>
<div class="block">Device type identifier ("iotsamples-edgent") used when using the Quickstart service.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../org/apache/edgent/connectors/iotp/IotpDevice.html#quickstart-org.apache.edgent.topology.Topology-java.lang.String-"><code>quickstart(Topology, String)</code></a>,
<a href="../../../../../constant-values.html#org.apache.edgent.connectors.iotp.IotpDevice.QUICKSTART_DEVICE_TYPE">Constant Field Values</a></dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="IotpDevice-org.apache.edgent.topology.Topology-java.util.Properties-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>IotpDevice</h4>
<pre>public&nbsp;IotpDevice(<a href="../../../../../org/apache/edgent/topology/Topology.html" title="interface in org.apache.edgent.topology">Topology</a>&nbsp;topology,
java.util.Properties&nbsp;options)</pre>
<div class="block">Create a connector to the IBM Watson IoT Platform Bluemix service with the device
specified by <code>options</code>.
<BR>
These properties must be set in <code>options</code>.
<UL>
<LI><code>org=</code><em>organization identifier</em></LI>
<LI><code>type=</code><em>device type</em></LI>
<LI><code>id=</code><em>device identifier</em></LI>
<LI><code>auth-method=token</code></LI>
<LI><code>auth-token=</code><em>authorization token</em></LI>
</UL>
For example:
<pre>
<code>
Properties options = new Properties();
options.setProperty("org", "uguhsp");
options.setProperty("type", "iotsample-arduino");
options.setProperty("id", "00aabbccde03");
options.setProperty("auth-method", "token");
options.setProperty("auth-token", "AJfKQV@&amp;bBo@VX6Dcg");
IotDevice iotDevice = new IotpDevice(options);
</code>
</pre>
<p>
Connecting to the server occurs when the topology is submitted for
execution.
</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>options</code> - control options</dd>
<dd><code>topology</code> - the connector's associated <code>Topology</code>.</dd>
</dl>
</li>
</ul>
<a name="IotpDevice-org.apache.edgent.topology.Topology-java.io.File-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>IotpDevice</h4>
<pre>public&nbsp;IotpDevice(<a href="../../../../../org/apache/edgent/topology/Topology.html" title="interface in org.apache.edgent.topology">Topology</a>&nbsp;topology,
java.io.File&nbsp;optionsFile)</pre>
<div class="block">Create a connector to the IBM Watson IoT Platform Bluemix service.
Device identifier and authorization are specified
by a configuration file.
<BR>
The format of the file is:
<pre>
<code>
[device]
org = <em>organization identifier</em>
type = <em>device type</em>
id = <em>device identifier</em>
auth-method = token
auth-token = <em>authorization token</em>
</code>
</pre>
For example:
<pre>
<code>
[device]
org = uguhsp
type = iotsample-arduino
id = 00aabbccde03
auth-method = token
auth-token = AJfKQV@&amp;bBo@VX6Dcg
</code>
</pre>
<p>
Connecting to the server occurs when the topology is submitted for
execution.
</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>topology</code> - the connector's associated <code>Topology</code>.</dd>
<dd><code>optionsFile</code> - File containing connection information.</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="quickstart-org.apache.edgent.topology.Topology-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>quickstart</h4>
<pre>public static&nbsp;<a href="../../../../../org/apache/edgent/connectors/iotp/IotpDevice.html" title="class in org.apache.edgent.connectors.iotp">IotpDevice</a>&nbsp;quickstart(<a href="../../../../../org/apache/edgent/topology/Topology.html" title="interface in org.apache.edgent.topology">Topology</a>&nbsp;topology,
java.lang.String&nbsp;deviceId)</pre>
<div class="block">Create an <code>IotpDevice</code> connector to the Quickstart service.
Quickstart service requires no-sign up to use to allow evaluation
but has limitations on functionality, such as only supporting
device events and only one message per second.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>topology</code> - the connector's associated <code>Topology</code>.</dd>
<dd><code>deviceId</code> - Device identifier to use for the connection.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Connector to the Quickstart service.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="https://quickstart.internetofthings.ibmcloud.com">Quickstart</a>,
<a href="../../../../../org/apache/edgent/samples/connectors/iotp/IotpQuickstart.html" title="class in org.apache.edgent.samples.connectors.iotp"><code>Quickstart sample application</code></a></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>public&nbsp;<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,java.lang.String&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,java.lang.Integer&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 from the tuple.
The event identifier and <a href="../../../../../org/apache/edgent/connectors/iot/QoS.html" title="interface in org.apache.edgent.connectors.iot"><code>Quality of Service</code></a>
can be generated based upon the tuple.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><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></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html" title="interface in org.apache.edgent.connectors.iot">IotDevice</a></code></dd>
<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 <a href="../../../../../org/apache/edgent/connectors/iot/QoS.html" title="interface in org.apache.edgent.connectors.iot"><code>Quality of Service</code></a>.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>TSink sink element representing termination of this stream.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../org/apache/edgent/connectors/iot/QoS.html" title="interface in org.apache.edgent.connectors.iot"><code>QoS</code></a></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>public&nbsp;<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,
java.lang.String&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="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#events-org.apache.edgent.topology.TStream-java.lang.String-int-">events</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html" title="interface in org.apache.edgent.connectors.iot">IotDevice</a></code></dd>
<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 <a href="../../../../../org/apache/edgent/connectors/iot/QoS.html" title="interface in org.apache.edgent.connectors.iot"><code>Quality of Service</code></a>.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>TSink sink element representing termination of this stream.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../org/apache/edgent/connectors/iot/QoS.html" title="interface in org.apache.edgent.connectors.iot"><code>QoS</code></a></dd>
</dl>
</li>
</ul>
<a name="commands-java.lang.String...-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>commands</h4>
<pre>public&nbsp;<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(java.lang.String...&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><code>command</code> - Command identifier as a String</LI>
<LI><code>tsms</code> - Timestamp of the command in milliseconds since the 1970/1/1 epoch.</LI>
<LI><code>format</code> - Format of the command as a String</LI>
<LI><code>payload</code> - Payload of the command
<UL>
<LI>If <code>format</code> is <code>json</code> then <code>payload</code> is JSON corresponding to the
command specific data.</LI>
<LI>Otherwise <code>payload</code> is String
</UL>
</LI>
</UL></div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html#commands-java.lang.String...-">commands</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/edgent/connectors/iot/IotDevice.html" title="interface in org.apache.edgent.connectors.iot">IotDevice</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>commands</code> - Commands to include. If no commands are provided then the
stream will contain all device commands.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Stream containing device commands.</dd>
</dl>
</li>
</ul>
<a name="topology--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>topology</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/edgent/topology/Topology.html" title="interface in org.apache.edgent.topology">Topology</a>&nbsp;topology()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../org/apache/edgent/topology/TopologyElement.html#topology--">TopologyElement</a></code></span></div>
<div class="block">Topology this element is contained in.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/edgent/topology/TopologyElement.html#topology--">topology</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/edgent/topology/TopologyElement.html" title="interface in org.apache.edgent.topology">TopologyElement</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Topology this element is contained in.</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/IotpDevice.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 class="aboutLanguage"><a href="http://edgent.incubator.apache.org">Apache Edgent (incubating)</a></div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev&nbsp;Class</li>
<li>Next&nbsp;Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/edgent/connectors/iotp/IotpDevice.html" target="_top">Frames</a></li>
<li><a href="IotpDevice.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><a href="#constructor.summary">Constr</a>&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><a href="#constructor.detail">Constr</a>&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 The Apache Software Foundation. All Rights Reserved - 59dfbdf-20161024-0005</small></p>
</body>
</html>