ibm-messaging/iot-java

IBM Watson IoT client library to simplify device/gateway/application interactions with the IoT Platform

License

License

Categories

Categories

Messaging Application Layer Libs
GroupId

GroupId

com.ibm.messaging
ArtifactId

ArtifactId

watson-iot
Last Version

Last Version

0.2.6
Release Date

Release Date

Type

Type

jar
Description

Description

ibm-messaging/iot-java
IBM Watson IoT client library to simplify device/gateway/application interactions with the IoT Platform
Project URL

Project URL

https://github.com/ibm-messaging/iot-java
Source Code Management

Source Code Management

https://github.com/ibm-messaging/iot-java

Download watson-iot

How to add to project

<!-- https://jarcasting.com/artifacts/com.ibm.messaging/watson-iot/ -->
<dependency>
    <groupId>com.ibm.messaging</groupId>
    <artifactId>watson-iot</artifactId>
    <version>0.2.6</version>
</dependency>
// https://jarcasting.com/artifacts/com.ibm.messaging/watson-iot/
implementation 'com.ibm.messaging:watson-iot:0.2.6'
// https://jarcasting.com/artifacts/com.ibm.messaging/watson-iot/
implementation ("com.ibm.messaging:watson-iot:0.2.6")
'com.ibm.messaging:watson-iot:jar:0.2.6'
<dependency org="com.ibm.messaging" name="watson-iot" rev="0.2.6">
  <artifact name="watson-iot" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.ibm.messaging', module='watson-iot', version='0.2.6')
)
libraryDependencies += "com.ibm.messaging" % "watson-iot" % "0.2.6"
[com.ibm.messaging/watson-iot "0.2.6"]

Dependencies

compile (11)

Group / Artifact Type Version
com.google.code.gson : gson jar 2.6.1
log4j : log4j jar 1.2.17
org.eclipse.paho : org.eclipse.paho.client.mqttv3 jar 1.1.2-SNAPSHOT
commons-net : commons-net jar 3.3
commons-logging : commons-logging jar 1.2
org.apache.commons : commons-lang3 jar 3.4
commons-codec : commons-codec jar 1.10
org.apache.httpcomponents : httpclient jar 4.5.1
joda-time : joda-time jar 2.9.2
org.bouncycastle : bcprov-jdk16 jar 1.45
org.apache.httpcomponents : httpmime jar 4.3.1

test (2)

Group / Artifact Type Version
junit : junit jar 4.12
org.hamcrest : hamcrest-core jar 1.3

Project Modules

There are no modules declared in this project.

Java for IBM Watson IoT Platform

Build Status Coverage Status GitHub issues GitHub Maven Central

Overview

Documentation

https://ibm-watson-iot.github.io/iot-java/

Usage

Add a dependency on com.ibm.wiotp.sdk to your project's pom.xml:

<dependency>
  <groupId>com.ibm.wiotp</groupId>
  <artifactId>com.ibm.wiotp.sdk</artifactId>
  <version>0.4.1</version>
</dependency>

Applications

Simple example that initialises an application client from environment variables, connects, sends 1 command to a device, and then disconnects.

import com.google.gson.JsonObject;
import com.ibm.wiotp.sdk.app.ApplicationClient;
import com.ibm.wiotp.sdk.codecs.JsonCodec;

class simpleTest {
	public static void main(String[] args) {
		ApplicationClient appClient = new ApplicationClient();
		appClient.registerCodec(new JsonCodec());
		appClient.connect();
		JsonObject data = new JsonObject();
		data.addProperty("distance", 10);
		appClient.publishCommand("myDeviceType", "myDeviceId", "myCommand", data);
		appClient.disconnect();
	}
}

Devices

Simple example that initialises a device client from environment variables, connects, sends 1 event, and then disconnects.

import com.google.gson.JsonObject;
import com.ibm.wiotp.sdk.device.DeviceClient;
import com.ibm.wiotp.sdk.codecs.JsonCodec;

class simpleTest {
	public static void main(String[] args) {
		DeviceClient deviceClient = new DeviceClient();
		deviceClient.registerCodec(new JsonCodec());
		deviceClient.connect();
		JsonObject data = new JsonObject();
		data.addProperty("distance", 10);
		deviceClient.publishEvent("myEvent", data);
		deviceClient.disconnect();
	}
}
com.ibm.messaging
Community around IBM Messaging products

Versions

Version
0.2.6
0.2.5
0.2.4
0.2.3
0.2.2
0.2.1
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0