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

loocat/iot-java

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Client Library - Introduction

Use the Java Client Library to simplify interactions with [IBM Watson IoT Platform] (https://internetofthings.ibmcloud.com).

The following documentation is provided to help you to get started:

  • The Device section 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 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 contains information on how to connect the gateway as Managed Gateway to IBM Watson IoT Platform and manage the attached devices.
  • The Application section 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

The Java Client Library requires either of the following versions 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 that is published, as outlined in the following example:

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

If you need to revert back to the previous 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 format 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 test and the target directory contains the output jar files. However, if you also want to run the tests, modify the property files that are in the directory src/test/resources, and then 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

You can find samples in each of the corresponding repositories as follows:

Dependencies


License

The library is shipped with Eclipse Public License. For more information about the public licensing, see the License file.

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%