Skip navigation links

Package org.apache.edgent.providers.iot

Iot provider that allows multiple applications to share an IotDevice.

See: Description

Package org.apache.edgent.providers.iot Description

Iot provider that allows multiple applications to share an IotDevice.

IoT device

Application registration

The provider includes an ApplicationService that allows applications to be registered by name. Once registered an application can be started (and stopped) remotely through the control service using a device command.

A jar may be registered remotely through a control service device command. Applications in the jar are registered with the ApplicationService and may then be started and stopped remotely.

Supported device commands

This provider supports a number of system level device commands to control the applications running within it.

Control service

Device commands with the command identifier 'edgentControl' are sent to the provider's control service, an instance of JsonControlService. This allows invocation of an operation against a control MBean registered with the control service, either by an application or the provider itself.

The command's data (JSON) uniquely identifies a control MBean through its type and alias, and indicates the operation to call on the MBean and the arguments to pass to the operation. Thus any control operation can be remotely invoked through a edgentControl device command, including arbitrary control MBeans registered by applications.

Provider operations

OperationCommand identifier typealiasopargs Control MBean
Submit (start) a registered application edgentControl appService edgent submit [applicationName, configJSONObject] ApplicationServiceMXBean
Sample command data {"type":"appService","alias":"edgent","op":"submit","args":["Heartbeat",{}]}
Register an applications Jar edgentControl appService edgent registerJar [jarURL, configJSONObject] ApplicationServiceMXBean
Sample command data {"type":"appService","alias":"edgent","op":"registerJar","args":["https://myHost/path/to/myApp.jar",{}]}
Close (stop) a running registered application edgentControl job applicationName stateChange ["CLOSE"] JobMXBean
Sample command data {"type":"job","alias":"Heartbeat","op":"stateChange","args":["CLOSE"]}
Change a period control edgentControl varies varies setPeriod [period, timeUnit] PeriodMXBean
Sample command data (TStream.poll()) {"type":"stream","alias":"myStreamAlias","op":"setPeriod","args":[10, "SECONDS"]}
Skip navigation links

Copyright © 2016–2017 The Apache Software Foundation. All rights reserved.