Repository: incubator-edgent Updated Branches: refs/heads/master 4c293470c -> 689a09592
[Edgent-250] Update IotProvider control service commands doc Project: http://git-wip-us.apache.org/repos/asf/incubator-edgent/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-edgent/commit/c300b6f5 Tree: http://git-wip-us.apache.org/repos/asf/incubator-edgent/tree/c300b6f5 Diff: http://git-wip-us.apache.org/repos/asf/incubator-edgent/diff/c300b6f5 Branch: refs/heads/master Commit: c300b6f5ae6b8314b0dec5328cdbec42b87502d4 Parents: ec6ccb2 Author: Dale LaBossiere <dlab...@us.ibm.com> Authored: Tue Feb 28 16:24:41 2017 -0500 Committer: Dale LaBossiere <dlab...@us.ibm.com> Committed: Tue Feb 28 16:24:41 2017 -0500 ---------------------------------------------------------------------- .../edgent/providers/iot/IotProvider.java | 10 ++++-- .../edgent/providers/iot/package-info.java | 37 ++++++++++++++++++-- 2 files changed, 42 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/c300b6f5/providers/iot/src/main/java/org/apache/edgent/providers/iot/IotProvider.java ---------------------------------------------------------------------- diff --git a/providers/iot/src/main/java/org/apache/edgent/providers/iot/IotProvider.java b/providers/iot/src/main/java/org/apache/edgent/providers/iot/IotProvider.java index de4debb..5126b8c 100644 --- a/providers/iot/src/main/java/org/apache/edgent/providers/iot/IotProvider.java +++ b/providers/iot/src/main/java/org/apache/edgent/providers/iot/IotProvider.java @@ -66,21 +66,25 @@ import com.google.gson.JsonObject; * <LI>{@link ControlService control} - An instance of {@link JsonControlService}.</LI> * <LI>{@link ApplicationService application} - An instance of {@link AppService}.</LI> * <LI>{@link PublishSubscribeService publish-subscribe} - An instance of {@link ProviderPubSub}</LI> - * <LI>preferences (optional) - An instance of {@code java.util.pref.Preferences} to store application + * <LI>{@code preferences} (optional) - An instance of {@code java.util.prefs.Preferences} to store application * and service preferences. A {@code Preferences} node is created if the provider is created with * a name that is not {@code null}. If the preferences implementation supports persistence * then any preferences will be maintained across provider and JVM restarts when creating a * provider with the same name. The {@code Preferences} node is a user node. * </UL> - * System applications provide this functionality: + * <P> + * System applications provide: * <UL> * <LI>Single connection to the message hub using an {@code IotDevice} * using {@link IotDevicePubSub}. * Applications using this provider that want to connect * to the message hub for device events and commands must create an instance of - * {@code IotDevice} using {@link IotDevicePubSub#addIotDevice(org.apache.edgent.topology.TopologyElement)}</LI> + * {@code IotDevice} using {@link IotDevicePubSub#addIotDevice(org.apache.edgent.topology.TopologyElement) addIotDevice()}</LI> * <LI>Access to the control service through device commands from the message hub using command * identifier {@link Commands#CONTROL_SERVICE edgentControl}. + * See the + * <a href="{@docRoot}/org/apache/edgent/providers/iot/package-summary.html">package documentation</a> + * for more information. * </UL> * <P> * An {@code IotProvider} is created with a provider and submitter that it delegates http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/c300b6f5/providers/iot/src/main/java/org/apache/edgent/providers/iot/package-info.java ---------------------------------------------------------------------- diff --git a/providers/iot/src/main/java/org/apache/edgent/providers/iot/package-info.java b/providers/iot/src/main/java/org/apache/edgent/providers/iot/package-info.java index 479b121..ff09cc8 100644 --- a/providers/iot/src/main/java/org/apache/edgent/providers/iot/package-info.java +++ b/providers/iot/src/main/java/org/apache/edgent/providers/iot/package-info.java @@ -28,6 +28,10 @@ under the License. * to be registered by name. Once registered an application can be started (and stopped) remotely * through the control service using a device command. * + * <p>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. + * * <H3>Supported device commands</H3> * This provider supports a number of system level device commands to control the applications * running within it. @@ -36,11 +40,10 @@ under the License. * are sent to the provider's control service, an instance of {@link org.apache.edgent.runtime.jsoncontrol.JsonControlService JsonControlService}. * This allows invocation of an operation against a control mbean registered with the * control service, either by an application or the provider itself. - * <BR> + * <P> * 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. - * <BR> * Thus any control operation can be remotely invoked through a {@code edgentControl} device command, * including arbitrary control mbeans registered by applications. * @@ -67,6 +70,21 @@ under the License. * <tr></tr> * * <tr> + * <td rowspan="2" headers="operation"><strong>Register an applications Jar</strong></td> + * <td headers="cmdIdentifier">{@code edgentControl}</td> + * <td headers="type">{@code appService}</td> + * <td headers="alias">{@code edgent}</td> + * <td headers="op">{@link org.apache.edgent.topology.mbeans.ApplicationServiceMXBean#registerJar(String, String) registerJar}</td> + * <td headers="args"><em>{@code [jarURL, configJSONObject]}</em></td> + * <td headers="controlMbean">{@link org.apache.edgent.topology.mbeans.ApplicationServiceMXBean ApplicationServiceMXBean}</td> + * </tr> + * <tr> + * <td headers="cmdIdentifier"><strong>Sample command data</strong></td> + * <td colspan=5 headers="type alias op args controlMbean">{@code {"type":"appService","alias":"edgent","op":"registerJar","args":["https://myHost/path/to/myApp.jar",{}]}}</td> + * </tr> + * <tr></tr> + * + * <tr> * <td rowspan="2" headers="operation"><strong>Close (stop) a running registered application</strong></td> * <td headers="cmdIdentifier">{@code edgentControl}</td> * <td headers="type">{@code job}</td> @@ -80,6 +98,21 @@ under the License. * <td colspan=5 headers="type alias op args controlMbean">{@code {"type":"job","alias":"Heartbeat","op":"stateChange","args":["CLOSE"]}}</td> * </tr> * <tr></tr> + * + * <tr> + * <td rowspan="2" headers="operation"><strong>Change a period control</strong></td> + * <td headers="cmdIdentifier">{@code edgentControl}</td> + * <td headers="type"><em>{@code varies}</em></td> + * <td headers="alias"><em>{@code varies}</em></td> + * <td headers="op">{@link org.apache.edgent.execution.mbeans.PeriodMXBean#setPeriod(long, java.util.concurrent.TimeUnit) setPeriod}</td> + * <td headers="args"><em>{@code [period, timeUnit]}</em></td> + * <td headers="controlMbean">{@link org.apache.edgent.execution.mbeans.PeriodMXBean PeriodMXBean}</td> + * </tr> + * <tr> + * <td headers="cmdIdentifier"><strong>Sample command data (TStream.poll())</strong></td> + * <td colspan=5 headers="type alias op args controlMbean">{@code {"type":"stream","alias":"myStreamAlias","op":"setPeriod","args":[10, "SECONDS"]}}</td> + * </tr> + * <tr></tr> * </table> * */