A Java HTTP server library.
LIBRARY for IOT
Supported MicroEJ Version: 4.1
Supported MicroEJ Edition: Studio & SDK
Last updated:
29 August 2017
# Overview
This repository contains the Hoka HTTP server and dependencies as well as an example of use to set up a HTTP server.

### Structure
Structure of the repository :

- LibraryJava-hoka
   - hoka
   - hoka-example

Each folder is an Eclipse/MicroEJ project. Each project has its own README and LICENSE requirements.

## Setup
Import the projects in MicroEJ.

### Requirements
- JRE 7 x86
- a Java platform with NET EMBEDDED 1.0. There is currently no platform with NET EMBEDDED 1.0 delivered in MicroEJ 3.1
- MicroEJ 4.1 or later

## Usage
Import the projects. The example project should be run with a MicroEJ launch by:

- Right-clicking the SimpleServer main class
- Selecting Run As > Run Configurations...
- Double-clicking on MicroEJ Application
- Adding the resources (/html/index.html and /png/microej.png) on the Main tab
- Selecting a platform with net embedded in the Execution tab
- Running!

## Changes
Feb 2015: initial release
Share Hoka and its simple example.

A REST server library.
LIBRARY for IOT
Supported MicroEJ Version: 4.1
Supported MicroEJ Edition: Studio & SDK
Last updated:
29 August 2017
# Overview
This repository contains the REST HTTP server and dependencies as well as an example of use to set up a REST HTTP server.

### Structure
Structure of the repository :

- Rest-Server
   - restserver
   - restserver-example

Each folder is an Eclipse/MicroEJ project. Each project has its own README and LICENSE requirements.

## Setup
Import the projects in MicroEJ.

### Requirements
- JRE 7 x86
- a Java platform with NET EMBEDDED 1.0. There is currently no platform with NET EMBEDDED 1.0 delivered in MicroEJ 4.1
- MicroEJ 4.1 or later

## Usage
Import the projects. The example project should be run with a MicroEJ launch by:

- Right-clicking the RestServerExample main class
- Selecting Run As > Run Configurations...
- Double-clicking on MicroEJ Application
- Selecting a platform with net embedded in the Execution tab
- Running!

## Changes
Aug 2017: initial release
Share REST HTTP and its simple example.

Using IOT Libraries APIs (Sandboxed)

This project gathers simple Sandboxed application using net libraries.
EXAMPLE for IOT
Supported MicroEJ Version: 4.1
Supported MicroEJ Edition: Studio & SDK
Last updated:
29 August 2017
# Overview
This project gathers simple sandboxed applications using net libraries.

## Requirements
* MicroEJ Studio or SDK 4.1 or later

# Usage
Each subfolder contains a distinct IOT application.

# Changes
- See the change log file [CHANGELOG.md](CHANGELOG.md) located at the root of this repository.

# License
- See the license file [LICENSE.md](LICENSE.md) located at the root of this repository.
Paho MicroEJ Client for MQTT v3.
LIBRARY for IOT
Supported MicroEJ Version: 4.1
Supported MicroEJ Edition: Studio & SDK
Last updated:
6 July 2017
<!--
	Markdown
	Copyright 2014-2016 IS2T. All rights reserved.
	IS2T PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
-->

# Overview
Paho MicroEJ client for MQTT:
  - This is a fork of Paho: https://eclipse.org/paho/clients/java/ from commit 496f94a58a41557ba2401d4ba94bc099a75ba8ef (just after version 1.0.2).
  - Implements MQTT 3.1.1

# Setup
In addition of adding the library in your buildpath, you have to configure your launch.

## Dependency injection:
The library requires some implementations. It comes with default implementations but you can precise yours. 
To precise your own implementation you have to create a system property with the required interface as the key and the corresponding implementation as the value.
To define a system property see the section 6.1 of the MicroEJ Platform Architecture Reference Manual.
	
The library requires an implementation for the following interfaces:
  - org.eclipse.paho.client.mqttv3.MqttClientPersistence
  - org.eclipse.paho.client.mqttv3.internal.NetworkModuleFactory
  - org.eclipse.paho.client.mqttv3.internal.MessageCatalog
  - org.eclipse.paho.client.mqttv3.logging.InternalLoggerFactory
  - org.eclipse.paho.client.mqttv3.util.SystemProperties

For information about this interfaces see the corresponding javadoc.

example: org.eclipse.paho.client.mqttv3.MqttClientPersistence=org.eclipse.paho.client.mqttv3.persist.MemoryPersistence

The default implementations are defined in the `dependencyinjection.properties` file in the package `org.eclipse.paho.client.mqttv3.internal.dependencyinjection` of `mqttv3-microej-version.jar`.
	
In your launch, in the `Main` tab:
- add the chosen implementations in the `Required types` part.
- add the file containing the default implementations in the `Resources` part.

## Threads
Paho requires 4 threads to run. You have to adapt the value `Number of threads` of your launch to take this in account. You can modify this value by going in the `Configuration` tab in the `Target > Memory` section.

## UTF-8
Paho requires UTF-8 encoding to run. In the `Configuration` tab in the `EDC` section check `Embed UTF-8 encoding`.

# Usage
Add the following line to your `module.ivy` or your `ivy.xml`:
> `<dependency org="org.eclipse.paho" name="mqttv3-microej" rev="1.+"/>`

# Requirements
  - EDC-1.2 or higher

# Dependencies
_All dependencies are retrieved transitively by Ivy resolver_.

# Source
N/A

# Restrictions
None.

MQTT SSL Client

SSL Add-on for Paho MicroEJ Client for MQTT v3.
LIBRARY for IOT
Supported MicroEJ Version: 4.1
Supported MicroEJ Edition: Studio & SDK
Last updated:
6 July 2017
<!--
	Markdown
	Copyright 2014-2016 IS2T. All rights reserved.
	IS2T PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
-->

# Overview
Paho MicroEJ client for MQTT:
  - This is a fork of Paho: https://eclipse.org/paho/clients/java/ from commit 496f94a58a41557ba2401d4ba94bc099a75ba8ef (just after version 1.0.2).
  - Implements MQTT 3.1.1

# Setup
In addition of adding the library in your buildpath, you have to configure your launch.

## Dependency injection:
The library requires some implementations. It comes with default implementations but you can precise yours. 
To precise your own implementation you have to create a system property with the required interface as the key and the corresponding implementation as the value.
To define a system property see the section 6.1 of the MicroEJ Platform Architecture Reference Manual.
	
The library requires an implementation for the following interfaces:
  - org.eclipse.paho.client.mqttv3.MqttClientPersistence
  - org.eclipse.paho.client.mqttv3.internal.NetworkModuleFactory
  - org.eclipse.paho.client.mqttv3.internal.MessageCatalog
  - org.eclipse.paho.client.mqttv3.logging.InternalLoggerFactory
  - org.eclipse.paho.client.mqttv3.util.SystemProperties

For information about this interfaces see the corresponding javadoc.

example: org.eclipse.paho.client.mqttv3.MqttClientPersistence=org.eclipse.paho.client.mqttv3.persist.MemoryPersistence

The default implementations are defined in the `dependencyinjection.properties` file in the package `org.eclipse.paho.client.mqttv3.internal.dependencyinjection` of `mqttv3-microej-version.jar`.
	
In your launch, in the `Main` tab:
- add the chosen implementations in the `Required types` part.
- add the file containing the default implementations in the `Resources` part.

## Threads
Paho requires 4 threads to run. You have to adapt the value `Number of threads` of your launch to take this in account. You can modify this value by going in the `Configuration` tab in the `Target > Memory` section.

## UTF-8
Paho requires UTF-8 encoding to run. In the `Configuration` tab in the `EDC` section check `Embed UTF-8 encoding`.

# Usage
Add the following line to your `module.ivy` or your `ivy.xml`:
> `<dependency org="org.eclipse.paho" name="mqttv3-ssl-microej" rev="1.+"/>`

## SSL
The path to the certificate list is defined by the System property `org.eclipse.paho.certificates` by default it is `/certificates/paho.certificates.list`
Your application must embed this file. this file is a list of path to the certificates you want to use (one certificate per line).

# Requirements
  - EDC-1.2 or higher
  - SSL-2.0 or higher

# Dependencies
_All dependencies are retrieved transitively by Ivy resolver_.

# Source
N/A

# Restrictions
None.

Z-Wave Base Driver

Library containing ZWave implementation for base driver.
LIBRARY for IOT
Supported MicroEJ Version: 4.1
Supported MicroEJ Edition: Studio & SDK
Last updated:
6 July 2017
# Overview
Library containing ZWave implementation for base driver

# Usage
Add the following line to your `module.ivy` or your `ivy.xml`:
> `<dependency org="ej.library.iot.basedriver" name="zwave" rev="..."/>`

# Requirements
  - EDC-1.2 or higher
  - BON-1.2 or higher
  - ECOM-1.1 or higher
  - KF-1.3 or higher

# Dependencies
_All dependencies are retrieved transitively by Ivy resolver_.

# Source
N/A

# Restrictions
None.
RESTful services client.
LIBRARY for IOT
Supported MicroEJ Version: 4.1
Supported MicroEJ Edition: Studio & SDK
Last updated:
6 July 2017
<!--
	Markdown
	Copyright 2015-2016 IS2T. All rights reserved.
	IS2T PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
-->

# Overview
ej.rest is a tiny RESTful services client. 

## Features
- GET, POST, PUT, DELETE for text, JSON, binary
- Fluent-style API to follow hyperlinks easily
- Complex path queries for JSON (simple tests on fields with operators >,=,< and full boolean expressions (&&,||,!))
- Full support for multipart/form-data

# Usage
Add the following line to your `module.ivy` or your `ivy.xml`:
> `<dependency org="ej.library.iot" name="restclient" rev="1.+"/>`
	
# Requirements
  - EDC 1.2 or later
  - NET 1.0 or later

# Dependencies
_All dependencies are retrieved transitively by Ivy resolver_.

# Source
- Derived from http://beders.github.com/Resty

# Restrictions
None.

# Embedded constraints
Embedded execution environment has a limited amount of memory (RAM, Flash, etc.). Using Resty library in a such environment encourages the developer to precisely manage resources like sockets, files, etc.

Since HTTP 2.0, server defines keep-alive connections for every HTTP connection. When using Resty, developer has to take care of the number of opened sockets. In fact, many sockets can be opened at the same time and stay alive for a long time (keep-alive). To prevent having too much sockets opened, developers have to close the underlying HTTP connection of each REST call. The following code snippet shows how to correctly close such connection:

Resty allows to create access paths into a JSON object with a JSON query path. The parser of these expressions needs RAM buffers. Two different sizes can be configured:
	- The size of the buffers, through the property `ej.rest.jsonquerypath.buffersize`.
	- The expand size of the buffers, through the property `ej.rest.jsonquerypath.expandbuffersize`.

```java
Resty rest = new Resty();
try {
    // Do a REST call
    RawResource raw = this.rest.raw("http://my.url/data");
    // Close the underlying http connection
    raw.http().disconnect();
} catch (IOException e) {
    // something went horribly wrong
    e.printStackTrace();
}
```

Protocol Buffers (protobuf)

This library contains the lite part of Google Protocol Buffer library for java.
LIBRARY for IOT
Supported MicroEJ Version: 4.1
Supported MicroEJ Edition: Studio & SDK
Last updated:
5 July 2017
<!--
	Markdown
	Copyright 2014-2016 IS2T. All rights reserved.
	IS2T PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
-->
# Overview
This library contains the lite part of Google Protocol Buffer library for java.

# Usage
Add the following line to your `module.ivy` or your `ivy.xml`:
> `<dependency org="com.google" name="protobuf" rev="2.5.0"/>`

And add the following option into your *.proto files :
> option optimize_for = LITE_RUNTIME;

# Requirements
  - EDC-1.2 or higher

# Dependencies
  - collections-1.0.0 or higher
  - collectionsutil-1.0.0 or higher
  - maps-1.0.0 or higher

# Source

This project was created with all the sources from protobuf-2.5.0.
We removed classes so as to only have the classes necessary for the lite version.
A few minors changes were made in the remaining classes to make it compile.
src contains these classes and the missing classes in EDC / Eclasspath

Differences between original sources and theses source of Protocol Buffer:
- ByteString.toString() has been modified to avoid String.format() (twice)
- GeneratedMessageLite.readResolve() has been commented out to avoid reflection on methods

# Restrictions