Skip to content

Client libraries and samples for connecting to IBM Watson IoT using Java

License

Notifications You must be signed in to change notification settings

crobertob/iot-java

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Client Library - Introduction

This Java Client Library can be used to simplify interactions with the [IBM Watson IoT Platform] (https://internetofthings.ibmcloud.com). The documentation is divided into following sections:

  • The [Device section] (docs/java_cli_for_devices.rst) contains information on how devices publish events and handle commands using the Java ibmiotf Client Library.
  • The [Managed Device section] (docs/java_cli_for_manageddevice.rst) contains information on how devices can connect to the Watson IoT Platform Device Management service using Java ibmiotf Client Library and perform device management operations like firmware update, location update, and diagnostics update.
  • The [Gateway section] (docs/java_cli_for_gateway.rst) contains information on how gateways publish events and handle commands for itself and for the attached devices using the Java ibmiotf Client Library.
  • The [Gateway Management section] (docs/java_cli_for_managedgateway.rst) contains information on how to connect the gateway as Managed Gateway to IBM Watson IoT Platform and manage the attached devices.
  • The [Application section] (docs/java_cli_for_applications.rst) details how applications can use the Java ibmiotf Client Library to interact with devices.
  • The [API section] (docs/java_cli_for_api.rst) contains information on how applications can use the Java ibmiotf Client Library to interact with the organization in the Watson IoT Platform through ReST APIs

This Java Client Library requires following version of Java,


Migration from release 0.1.5 to 0.2.1

Starting from release 0.2.1 the library doesn't add parent Json Element "d" in front of the actual event published. For example,

{"temp":56,"hum":70}

But incase, if you need the old behavior run the application with the property com.ibm.iotf.enableCustomFormat set to false as follows,

java -Dcom.ibm.iotf.enableCustomFormat=false <...>

This will publish the message in old behavior as follows,

{"d":{"temp":56,"hum":70}}

Maven support

The library artifact is pushed to the maven. Use the following maven dependency to include this library in your java application.

<dependency>
    <groupId>com.ibm.messaging</groupId>
    <artifactId>watson-iot</artifactId>
    <version>0.2.2</version>
</dependency>

However if you want to build the library by yourself, use the following maven command,

mvn clean package -Dmaven.test.skip=true

The above command quickly builds the library by skipping the tests and the target directory contains the output jar files. However, if you want to run the tests as well, then modify the property files present under directory src/test/resources and run the following maven command,

mvn clean package

Download

Refer to the maven secion for how to use this library in your project. Also, you can download the library manually from the maven repository.

When you use maven, the dependencies are downloaded automatically.


Samples

In order to search & find the samples easily, we moved the samples to corresponding repositories and

Dependencies


License

The library is shipped with Eclipse Public License and refer to the [License file] (LICENSE) for more information about the licensing.

About

Client libraries and samples for connecting to IBM Watson IoT using Java

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%