You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@edgent.apache.org by ho...@apache.org on 2016/04/29 02:38:16 UTC
[12/18] incubator-quarks-website git commit: from
3dd3cfd33362caec2b9d21f5283060c965bf1c95
from 3dd3cfd33362caec2b9d21f5283060c965bf1c95
Project: http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/commit/79ec4a23
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/tree/79ec4a23
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/diff/79ec4a23
Branch: refs/heads/master
Commit: 79ec4a237a5f8bc3f2ee0bfcb2e09b6344fc519f
Parents: 238baf1
Author: Dale LaBossiere <dl...@us.ibm.com>
Authored: Thu Apr 28 09:54:58 2016 -0400
Committer: Dale LaBossiere <dl...@us.ibm.com>
Committed: Thu Apr 28 09:54:58 2016 -0400
----------------------------------------------------------------------
content/algolia_search.json | 2 +-
content/docs/quickstart.html | 27 +++++++++++++--------------
2 files changed, 14 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/79ec4a23/content/algolia_search.json
----------------------------------------------------------------------
diff --git a/content/algolia_search.json b/content/algolia_search.json
index e44e83b..4d0a280 100644
--- a/content/algolia_search.json
+++ b/content/algolia_search.json
@@ -146,7 +146,7 @@
"keywords": "",
"url": "../docs/quickstart",
"summary": "",
-"body": "## Quarks to Quickstart quickly!IoT devices running quarks applications typically connect to back-end analytic systems through a message hub.Message hubs are used to isolate the back-end system from having to handle connections from thousands to millions of devices.An example of such a message hub designed for the Internet of Things is[IBM Watson IoT Platform](https://internetofthings.ibmcloud.com/). This cloud service runs on IBM's Bluemix cloud platformand Quarks provides a [connector](http://quarks-edge.github.io/quarks/docs/javadoc/index.html?quarks/connectors/iotf/IotfDevice.html).You can test out the service without any registration by using its Quickstart service and the Quarks sample application:[quarks.samples.connectors.iotf.IotfQuickstart](http://quarks-edge.github.io/quarks/docs/javadoc/index.html?quarks/samples/connectors/iotf/IotfQuickstart.html).You can execute the class directly from Eclipse, or using the script: `quarks/java8/scripts/connectors/iotf/runiotf
quickstart.sh`When run it produces output like this, with a URL as the third line.Pointing any browser on any machine to that URL takes you to a view of the data coming from the sample application.This view is executing in Bluemix, thus the device events from this sample are being sent over the public internetto the Quickstart Bluemix service.Here's an example view:## Quarks codeThe full source is at:[IotfQuickstart.java](https://github.com/apache/incubator-quarks/blob/master/samples/connectors/src/main/java/quarks/samples/connectors/iotf/IotfQuickstart.java)The first step to is to create a `IotDevice` instance that represents the connection to IBM Watson IoT Platform Qucikstart service.```java // Declare a connection to IoTF Quickstart service String deviceId = \"qs\" + Long.toHexString(new Random().nextLong()); IotDevice device = IotfDevice.quickstart(topology, deviceId);```Now any stream can send device events to the Quickstart service by simply calling its `
events()` method.Here we map a stream of random numbers into JSON as the payload for a device event is typically JSON.```java TStream json = raw.map(v -> { JsonObject j = new JsonObject(); j.addProperty(\"temp\", v[0]); j.addProperty(\"humidity\", v[1]); j.addProperty(\"objectTemp\", v[2]); return j; });``` Now we have a stream of simulated sensor reading events as JSON tuples (`json`) we send them as events with event identifer (type) `sensors` using `device`. ```java device.events(json, \"sensors\", QoS.FIRE_AND_FORGET);```It's that simple to send a Quarks stream to IBM Watson IoT Platform as device events."
+"body": "## Quarks to Quickstart quickly!IoT devices running quarks applications typically connect to back-end analytic systems through a message hub.Message hubs are used to isolate the back-end system from having to handle connections from thousands to millions of devices.An example of such a message hub designed for the Internet of Things is[IBM Watson IoT Platform](https://internetofthings.ibmcloud.com/). This cloud service runs on IBM's Bluemix cloud platformand Quarks provides a [connector](http://quarks-edge.github.io/quarks/docs/javadoc/index.html?quarks/connectors/iotf/IotfDevice.html).You can test out the service without any registration by using its Quickstart service and the Quarks sample application: [code](https://github.com/apache/incubator-quarks/blob/master/samples/connectors/src/main/java/quarks/samples/connectors/iotf/IotfQuickstart.java), [JavaDocs](http://quarks-edge.github.io/quarks/docs/javadoc/index.html?quarks/samples/connectors/iotf/IotfQuickstart.html).You
can execute the class directly from Eclipse, or using the script: [`quarks/java8/scripts/connectors/iotf/runiotfquickstart.sh`](https://github.com/quarks-edge/quarks/blob/master/scripts/connectors/iotf/runiotfquickstart.sh)When run it produces output like this, with a URL as the third line.Pointing any browser on any machine to that URL takes you to a view of the data coming from the sample application.This view is executing in Bluemix, thus the device events from this sample are being sent over the public internetto the Quickstart Bluemix service.Here's an example view:## Quarks codeThe full source is at:[IotfQuickstart.java](https://github.com/apache/incubator-quarks/blob/master/samples/connectors/src/main/java/quarks/samples/connectors/iotf/IotfQuickstart.java)The first step to is to create a `IotDevice` instance that represents the connection to IBM Watson IoT Platform Qucikstart service.```java// Declare a connection to IoTF Quickstart serviceString deviceId = \"qs\" + Long.to
HexString(new Random().nextLong());IotDevice device = IotfDevice.quickstart(topology, deviceId);```Now any stream can send device events to the Quickstart service by simply calling its `events()` method.Here we map a stream of random numbers into JSON as the payload for a device event is typically JSON.```javaTStream json = raw.map(v -> { JsonObject j = new JsonObject(); j.addProperty(\"temp\", v[0]); j.addProperty(\"humidity\", v[1]); j.addProperty(\"objectTemp\", v[2]); return j;});``` Now we have a stream of simulated sensor reading events as JSON tuples (`json`) we send them as events with event identifer (type) `sensors` using `device`. ```javadevice.events(json, \"sensors\", QoS.FIRE_AND_FORGET);```It's that simple to send a Quarks stream to IBM Watson IoT Platform as device events."
},
http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/79ec4a23/content/docs/quickstart.html
----------------------------------------------------------------------
diff --git a/content/docs/quickstart.html b/content/docs/quickstart.html
index 0d69c10..554a409 100644
--- a/content/docs/quickstart.html
+++ b/content/docs/quickstart.html
@@ -569,10 +569,9 @@ Message hubs are used to isolate the back-end system from having to handle conne
<a href="https://internetofthings.ibmcloud.com/">IBM Watson IoT Platform</a>. This cloud service runs on IBM's Bluemix cloud platform
and Quarks provides a <a href="http://quarks-edge.github.io/quarks/docs/javadoc/index.html?quarks/connectors/iotf/IotfDevice.html">connector</a>.</p>
-<p>You can test out the service without any registration by using its Quickstart service and the Quarks sample application:
-<a href="http://quarks-edge.github.io/quarks/docs/javadoc/index.html?quarks/samples/connectors/iotf/IotfQuickstart.html">quarks.samples.connectors.iotf.IotfQuickstart</a>.</p>
+<p>You can test out the service without any registration by using its Quickstart service and the Quarks sample application: <a href="https://github.com/apache/incubator-quarks/blob/master/samples/connectors/src/main/java/quarks/samples/connectors/iotf/IotfQuickstart.java">code</a>, <a href="http://quarks-edge.github.io/quarks/docs/javadoc/index.html?quarks/samples/connectors/iotf/IotfQuickstart.html">JavaDocs</a>.</p>
-<p>You can execute the class directly from Eclipse, or using the script: <code>quarks/java8/scripts/connectors/iotf/runiotfquickstart.sh</code></p>
+<p>You can execute the class directly from Eclipse, or using the script: <a href="https://github.com/quarks-edge/quarks/blob/master/scripts/connectors/iotf/runiotfquickstart.sh"><code>quarks/java8/scripts/connectors/iotf/runiotfquickstart.sh</code></a></p>
<p>When run it produces output like this, with a URL as the third line.</p>
@@ -592,22 +591,22 @@ to the Quickstart Bluemix service.</p>
<a href="https://github.com/apache/incubator-quarks/blob/master/samples/connectors/src/main/java/quarks/samples/connectors/iotf/IotfQuickstart.java">IotfQuickstart.java</a></p>
<p>The first step to is to create a <code>IotDevice</code> instance that represents the connection to IBM Watson IoT Platform Qucikstart service.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java"> <span class="c1">// Declare a connection to IoTF Quickstart service</span>
- <span class="n">String</span> <span class="n">deviceId</span> <span class="o">=</span> <span class="s">"qs"</span> <span class="o">+</span> <span class="n">Long</span><span class="o">.</span><span class="na">toHexString</span><span class="o">(</span><span class="k">new</span> <span class="n">Random</span><span class="o">().</span><span class="na">nextLong</span><span class="o">());</span>
- <span class="n">IotDevice</span> <span class="n">device</span> <span class="o">=</span> <span class="n">IotfDevice</span><span class="o">.</span><span class="na">quickstart</span><span class="o">(</span><span class="n">topology</span><span class="o">,</span> <span class="n">deviceId</span><span class="o">);</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="c1">// Declare a connection to IoTF Quickstart service</span>
+<span class="n">String</span> <span class="n">deviceId</span> <span class="o">=</span> <span class="s">"qs"</span> <span class="o">+</span> <span class="n">Long</span><span class="o">.</span><span class="na">toHexString</span><span class="o">(</span><span class="k">new</span> <span class="n">Random</span><span class="o">().</span><span class="na">nextLong</span><span class="o">());</span>
+<span class="n">IotDevice</span> <span class="n">device</span> <span class="o">=</span> <span class="n">IotfDevice</span><span class="o">.</span><span class="na">quickstart</span><span class="o">(</span><span class="n">topology</span><span class="o">,</span> <span class="n">deviceId</span><span class="o">);</span>
</code></pre></div>
<p>Now any stream can send device events to the Quickstart service by simply calling its <code>events()</code> method.
Here we map a stream of random numbers into JSON as the payload for a device event is typically JSON.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java"> <span class="n">TStream</span><span class="o"><</span><span class="n">JsonObject</span><span class="o">></span> <span class="n">json</span> <span class="o">=</span> <span class="n">raw</span><span class="o">.</span><span class="na">map</span><span class="o">(</span><span class="n">v</span> <span class="o">-></span> <span class="o">{</span>
- <span class="n">JsonObject</span> <span class="n">j</span> <span class="o">=</span> <span class="k">new</span> <span class="n">JsonObject</span><span class="o">();</span>
- <span class="n">j</span><span class="o">.</span><span class="na">addProperty</span><span class="o">(</span><span class="s">"temp"</span><span class="o">,</span> <span class="n">v</span><span class="o">[</span><span class="mi">0</span><span class="o">]);</span>
- <span class="n">j</span><span class="o">.</span><span class="na">addProperty</span><span class="o">(</span><span class="s">"humidity"</span><span class="o">,</span> <span class="n">v</span><span class="o">[</span><span class="mi">1</span><span class="o">]);</span>
- <span class="n">j</span><span class="o">.</span><span class="na">addProperty</span><span class="o">(</span><span class="s">"objectTemp"</span><span class="o">,</span> <span class="n">v</span><span class="o">[</span><span class="mi">2</span><span class="o">]);</span>
- <span class="k">return</span> <span class="n">j</span><span class="o">;</span>
- <span class="o">});</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">TStream</span><span class="o"><</span><span class="n">JsonObject</span><span class="o">></span> <span class="n">json</span> <span class="o">=</span> <span class="n">raw</span><span class="o">.</span><span class="na">map</span><span class="o">(</span><span class="n">v</span> <span class="o">-></span> <span class="o">{</span>
+ <span class="n">JsonObject</span> <span class="n">j</span> <span class="o">=</span> <span class="k">new</span> <span class="n">JsonObject</span><span class="o">();</span>
+ <span class="n">j</span><span class="o">.</span><span class="na">addProperty</span><span class="o">(</span><span class="s">"temp"</span><span class="o">,</span> <span class="n">v</span><span class="o">[</span><span class="mi">0</span><span class="o">]);</span>
+ <span class="n">j</span><span class="o">.</span><span class="na">addProperty</span><span class="o">(</span><span class="s">"humidity"</span><span class="o">,</span> <span class="n">v</span><span class="o">[</span><span class="mi">1</span><span class="o">]);</span>
+ <span class="n">j</span><span class="o">.</span><span class="na">addProperty</span><span class="o">(</span><span class="s">"objectTemp"</span><span class="o">,</span> <span class="n">v</span><span class="o">[</span><span class="mi">2</span><span class="o">]);</span>
+ <span class="k">return</span> <span class="n">j</span><span class="o">;</span>
+<span class="o">});</span>
</code></pre></div>
<p>Now we have a stream of simulated sensor reading events as JSON tuples (<code>json</code>) we send them as events with event identifer (type) <code>sensors</code> using <code>device</code>.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java"> <span class="n">device</span><span class="o">.</span><span class="na">events</span><span class="o">(</span><span class="n">json</span><span class="o">,</span> <span class="s">"sensors"</span><span class="o">,</span> <span class="n">QoS</span><span class="o">.</span><span class="na">FIRE_AND_FORGET</span><span class="o">);</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">device</span><span class="o">.</span><span class="na">events</span><span class="o">(</span><span class="n">json</span><span class="o">,</span> <span class="s">"sensors"</span><span class="o">,</span> <span class="n">QoS</span><span class="o">.</span><span class="na">FIRE_AND_FORGET</span><span class="o">);</span>
</code></pre></div>
<p>It's that simple to send a Quarks stream to IBM Watson IoT Platform as device events.</p>