blob: ab55e94032542e7783e72e215d207f83808e78bf [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:21 EST 2017 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>org.apache.edgent.providers.iot (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="org.apache.edgent.providers.iot (Apache Edgent (incubating) v1.2.0 API)";
}
}
catch(err) {
}
//-->
</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 class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.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/providers/direct/package-summary.html">Prev&nbsp;Package</a></li>
<li><a href="../../../../../org/apache/edgent/runtime/appservice/package-summary.html">Next&nbsp;Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/edgent/providers/iot/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.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>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Package" class="title">Package&nbsp;org.apache.edgent.providers.iot</h1>
<div class="docSummary">
<div class="block">Iot provider that allows multiple applications to
share an <code>IotDevice</code>.</div>
</div>
<p>See:&nbsp;<a href="#package.description">Description</a></p>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation">
<caption><span>Class Summary</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../org/apache/edgent/providers/iot/IotProvider.html" title="class in org.apache.edgent.providers.iot">IotProvider</a></td>
<td class="colLast">
<div class="block">A provider that supports sharing of a single connection to an IoT message hub and
access to control MBeans via IoT device commands.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
<a name="package.description">
<!-- -->
</a>
<h2 title="Package org.apache.edgent.providers.iot Description">Package org.apache.edgent.providers.iot Description</h2>
<div class="block">Iot provider that allows multiple applications to
share an <code>IotDevice</code>.
<H3>IoT device</H3>
<H3>Application registration</H3>
The provider includes an <a href="../../../../../org/apache/edgent/topology/services/ApplicationService.html" title="interface in org.apache.edgent.topology.services"><code>ApplicationService</code></a> that allows applications
to be registered by name. Once registered an application can be started (and stopped) remotely
through the control service using a device command.
<p>A jar may be registered remotely through a control service device command.
Applications in the jar are registered with the ApplicationService and may then be started and stopped
remotely.
<H3>Supported device commands</H3>
This provider supports a number of system level device commands to control the applications
running within it.
<H4>Control service</H4>
Device commands with the command identifier '<a href="../../../../../org/apache/edgent/connectors/iot/Commands.html#CONTROL_SERVICE"><code>edgentControl</code></a>'
are sent to the provider's control service, an instance of <a href="../../../../../org/apache/edgent/runtime/jsoncontrol/JsonControlService.html" title="class in org.apache.edgent.runtime.jsoncontrol"><code>JsonControlService</code></a>.
This allows invocation of an operation against a control MBean registered with the
control service, either by an application or the provider itself.
<P>
The command's data (JSON) uniquely identifies a control MBean through its type and
alias, and indicates the operation to call on the MBean and the arguments to
pass to the operation.
Thus any control operation can be remotely invoked through a <code>edgentControl</code> device command,
including arbitrary control MBeans registered by applications.
<H4 id="providerOps">Provider operations</H4>
<table border="1" summary="Provider operations">
<tr>
<th id="operation">Operation</th><th id="cmdIdentifier">Command identifier</th>
<th id="type">type</th><th id="alias">alias</th><th id="op">op</th><th id="args">args</th>
<th id="controlMbean">Control MBean</th>
</tr>
<tr>
<td rowspan="2" headers="operation"><strong>Submit (start) a registered application</strong></td>
<td headers="cmdIdentifier"><code>edgentControl</code></td>
<td headers="type"><code>appService</code></td>
<td headers="alias"><code>edgent</code></td>
<td headers="op"><a href="../../../../../org/apache/edgent/topology/mbeans/ApplicationServiceMXBean.html#submit-java.lang.String-java.lang.String-"><code>submit</code></a></td>
<td headers="args"><em><code>[applicationName, configJSONObject]</code></em></td>
<td headers="controlMbean"><a href="../../../../../org/apache/edgent/topology/mbeans/ApplicationServiceMXBean.html" title="interface in org.apache.edgent.topology.mbeans"><code>ApplicationServiceMXBean</code></a></td>
</tr>
<tr>
<td headers="cmdIdentifier"><strong>Sample command data</strong></td>
<td colspan=5 headers="type alias op args controlMbean"><code>{"type":"appService","alias":"edgent","op":"submit","args":["Heartbeat",{}]}</code></td>
</tr>
<tr></tr>
<tr>
<td rowspan="2" headers="operation"><strong>Register an applications Jar</strong></td>
<td headers="cmdIdentifier"><code>edgentControl</code></td>
<td headers="type"><code>appService</code></td>
<td headers="alias"><code>edgent</code></td>
<td headers="op"><a href="../../../../../org/apache/edgent/topology/mbeans/ApplicationServiceMXBean.html#registerJar-java.lang.String-java.lang.String-"><code>registerJar</code></a></td>
<td headers="args"><em><code>[jarURL, configJSONObject]</code></em></td>
<td headers="controlMbean"><a href="../../../../../org/apache/edgent/topology/mbeans/ApplicationServiceMXBean.html" title="interface in org.apache.edgent.topology.mbeans"><code>ApplicationServiceMXBean</code></a></td>
</tr>
<tr>
<td headers="cmdIdentifier"><strong>Sample command data</strong></td>
<td colspan=5 headers="type alias op args controlMbean"><code>{"type":"appService","alias":"edgent","op":"registerJar","args":["https://myHost/path/to/myApp.jar",{}]}</code></td>
</tr>
<tr></tr>
<tr>
<td rowspan="2" headers="operation"><strong>Close (stop) a running registered application</strong></td>
<td headers="cmdIdentifier"><code>edgentControl</code></td>
<td headers="type"><code>job</code></td>
<td headers="alias"><em><code>applicationName</code></em></td>
<td headers="op"><a href="../../../../../org/apache/edgent/execution/mbeans/JobMXBean.html#stateChange-org.apache.edgent.execution.Job.Action-"><code>stateChange</code></a></td>
<td headers="args"><code>["CLOSE"]</code></td>
<td headers="controlMbean"><a href="../../../../../org/apache/edgent/execution/mbeans/JobMXBean.html" title="interface in org.apache.edgent.execution.mbeans"><code>JobMXBean</code></a></td>
</tr>
<tr>
<td headers="cmdIdentifier"><strong>Sample command data</strong></td>
<td colspan=5 headers="type alias op args controlMbean"><code>{"type":"job","alias":"Heartbeat","op":"stateChange","args":["CLOSE"]}</code></td>
</tr>
<tr></tr>
<tr>
<td rowspan="2" headers="operation"><strong>Change a period control</strong></td>
<td headers="cmdIdentifier"><code>edgentControl</code></td>
<td headers="type"><em><code>varies</code></em></td>
<td headers="alias"><em><code>varies</code></em></td>
<td headers="op"><a href="../../../../../org/apache/edgent/execution/mbeans/PeriodMXBean.html#setPeriod-long-java.util.concurrent.TimeUnit-"><code>setPeriod</code></a></td>
<td headers="args"><em><code>[period, timeUnit]</code></em></td>
<td headers="controlMbean"><a href="../../../../../org/apache/edgent/execution/mbeans/PeriodMXBean.html" title="interface in org.apache.edgent.execution.mbeans"><code>PeriodMXBean</code></a></td>
</tr>
<tr>
<td headers="cmdIdentifier"><strong>Sample command data (TStream.poll())</strong></td>
<td colspan=5 headers="type alias op args controlMbean"><code>{"type":"stream","alias":"myStreamAlias","op":"setPeriod","args":[10, "SECONDS"]}</code></td>
</tr>
<tr></tr>
</table></div>
</div>
<!-- ======= 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 class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.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/providers/direct/package-summary.html">Prev&nbsp;Package</a></li>
<li><a href="../../../../../org/apache/edgent/runtime/appservice/package-summary.html">Next&nbsp;Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/edgent/providers/iot/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.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>
<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>