[KARAF-2974] Specify the syntax format in OBR commands
Project: http://git-wip-us.apache.org/repos/asf/karaf/repo Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/64278398 Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/64278398 Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/64278398 Branch: refs/heads/karaf-3.0.x Commit: 64278398a2678baab51208e5c8df211898962eaa Parents: 91ae802 Author: Jean-Baptiste Onofré <[email protected]> Authored: Sat May 17 11:08:42 2014 +0200 Committer: Jean-Baptiste Onofré <[email protected]> Committed: Sat May 17 18:42:36 2014 +0200 ---------------------------------------------------------------------- manual/src/main/webapp/users-guide/obr.conf | 71 ++++++++++++++++++++ .../apache/karaf/obr/command/DeployCommand.java | 2 +- .../apache/karaf/obr/command/InfoCommand.java | 2 +- .../apache/karaf/obr/command/SourceCommand.java | 2 +- .../apache/karaf/obr/command/StartCommand.java | 2 +- 5 files changed, 75 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/karaf/blob/64278398/manual/src/main/webapp/users-guide/obr.conf ---------------------------------------------------------------------- diff --git a/manual/src/main/webapp/users-guide/obr.conf b/manual/src/main/webapp/users-guide/obr.conf index f6a0fd0..788189d 100644 --- a/manual/src/main/webapp/users-guide/obr.conf +++ b/manual/src/main/webapp/users-guide/obr.conf @@ -168,6 +168,21 @@ Capabilities: package:{package=org.apache.karaf.wrapper.management, uses:=javax.management, version=3.0.0} {code} +The {{obr:info}} command uses the following syntax to identify the bundles: {{symbolic_name,version}} where {{version}} is optional. +It means that you have to use the following command to see the info about the wrapper core bundle with version 3.0.0: + +{code} +karaf@root()> obr:info org.apache.karaf.wrapper.core,3.0.0 +... +{code} + +You can specific multiple bundles separated by space: + +{code} +karaf@root()> obr:info org.apache.karaf.wrapper.core,3.0.0 org.apache.karaf.wrapper.command,3.0.0 +... +{code} + h3. {{obr:source}} In addition of the bundles executable, the OBR service can also store the bundles sources. @@ -178,6 +193,20 @@ The {{obr:source}} command check the source URL in the OBR metadata for a given karaf@root()> obr:source /tmp org.apache.karaf.wrapper.core {code} +The {{obr:source}} command uses the following syntax to identify the bundles: {{symbolic_name,version}} where {{version}} is optional. +It means that you have to use the following command to download the source of wrapper core bundle with version 3.0.0: + +{code} +karaf@root()> obr:source /tmp org.apache.karaf.wrapper.core,3.0.0 +{code} + +You can specify multiple bundles separated by space: + +{code} +karaf@root()> obr:source /tmp org.apache.karaf.wrapper.core,3.0.0 org.apache.karaf.wrapper.command,3.0.0 +... +{code} + h3. {{obr:resolve}} The {{obr:resolve}} command displays the resolution output for a given set of requirements. Actually, it show the bundles providing @@ -252,11 +281,53 @@ Deploying...done. By default, the bundles are just installed, not started. You can use the {{-s}} option to start the bundles. +The {{obr:deploy}} command uses the following syntax to identify the bundles: {{symbolic_name,version}} where {{version}} is optional. +It means that you have to use the following command to deploy the wrapper core bundle with version 3.0.0: + +{code} +karaf@root()> obr:deploy org.apache.karaf.wrapper.core,3.0.0 +{code} + +You can specify multiple bundles separated by space: + +{code} +karaf@root()> obr:deploy org.apache.karaf.wrapper.core,3.0.0 org.apache.karaf.wrapper.command,3.0.0 +... +{code} + h2. {{obr:start}} The {{obr:start}} command does the same as {{obr:deploy -s}} command. It installs the bundle (and all required bundles to satisfy the requirements) and starts all installed bundles. +{code} +karaf@root()> obr:start org.ops4j.pax.web.samples.helloworld-hs +Target resource(s): +------------------- + OPS4J Pax Web - Samples - Hello World - HttpService (4.0.0.SNAPSHOT) + +Required resource(s): +--------------------- + Apache ServiceMix :: Specs :: Activation API 1.4 (2.3.0.SNAPSHOT) + OPS4J Pax Web - Jetty Bundle (4.0.0.SNAPSHOT) + +Deploying...done. +{code} + +The {{obr:start}} command uses the following syntax to identify the bundles: {{symbolic_name,version}} where {{version}} is optional. +It means that you have to use the following command to deploy and start the wrapper core bundle with version 3.0.0: + +{code} +karaf@root()> obr:start org.apache.karaf.wrapper.core,3.0.0 +{code} + +You can specify multiple bundles separated by space: + +{code} +karaf@root()> obr:start org.apache.karaf.wrapper.core,3.0.0 org.apache.karaf.wrapper.command,3.0.0 +... +{code} + h2. JMX ObrMBean On the JMX layer, Apache Karaf provides a MBean dedicated to the management of the OBR service: the ObrMBean. http://git-wip-us.apache.org/repos/asf/karaf/blob/64278398/obr/command/src/main/java/org/apache/karaf/obr/command/DeployCommand.java ---------------------------------------------------------------------- diff --git a/obr/command/src/main/java/org/apache/karaf/obr/command/DeployCommand.java b/obr/command/src/main/java/org/apache/karaf/obr/command/DeployCommand.java index a008004..a092b48 100644 --- a/obr/command/src/main/java/org/apache/karaf/obr/command/DeployCommand.java +++ b/obr/command/src/main/java/org/apache/karaf/obr/command/DeployCommand.java @@ -26,7 +26,7 @@ import org.apache.karaf.shell.commands.Option; @Command(scope = "obr", name = "deploy", description = "Deploys a list of bundles using OBR service.") public class DeployCommand extends ObrCommandSupport { - @Argument(index = 0, name = "bundles", description = "List of bundle names to deploy (separated by whitespaces)", required = true, multiValued = true) + @Argument(index = 0, name = "bundles", description = "List of bundle names to deploy (separated by whitespaces). The bundles are identified using the following syntax: symbolic_name,version where version is optional.", required = true, multiValued = true) protected List<String> bundles; @Option(name = "-s", aliases = { "--start" }, description = "Start the deployed bundles", required = false, multiValued = false) http://git-wip-us.apache.org/repos/asf/karaf/blob/64278398/obr/command/src/main/java/org/apache/karaf/obr/command/InfoCommand.java ---------------------------------------------------------------------- diff --git a/obr/command/src/main/java/org/apache/karaf/obr/command/InfoCommand.java b/obr/command/src/main/java/org/apache/karaf/obr/command/InfoCommand.java index d91830a..7a280f2 100644 --- a/obr/command/src/main/java/org/apache/karaf/obr/command/InfoCommand.java +++ b/obr/command/src/main/java/org/apache/karaf/obr/command/InfoCommand.java @@ -32,7 +32,7 @@ import org.apache.karaf.shell.commands.Command; @Command(scope = "obr", name = "info", description = "Prints information about OBR bundles.") public class InfoCommand extends ObrCommandSupport { - @Argument(index = 0, name = "bundles", description = "Specify bundles to query for information (separated by whitespaces)", required = true, multiValued = true) + @Argument(index = 0, name = "bundles", description = "Specify bundles to query for information (separated by whitespaces). The bundles are identified using the following syntax: symbolic_name,version where version is optional.", required = true, multiValued = true) List<String> bundles; protected void doExecute(RepositoryAdmin admin) throws Exception { http://git-wip-us.apache.org/repos/asf/karaf/blob/64278398/obr/command/src/main/java/org/apache/karaf/obr/command/SourceCommand.java ---------------------------------------------------------------------- diff --git a/obr/command/src/main/java/org/apache/karaf/obr/command/SourceCommand.java b/obr/command/src/main/java/org/apache/karaf/obr/command/SourceCommand.java index 307cbad..feb172c 100644 --- a/obr/command/src/main/java/org/apache/karaf/obr/command/SourceCommand.java +++ b/obr/command/src/main/java/org/apache/karaf/obr/command/SourceCommand.java @@ -35,7 +35,7 @@ public class SourceCommand extends ObrCommandSupport { @Argument(index = 0, name = "folder", description = "Local folder for storing sources", required = true, multiValued = false) String localDir; - @Argument(index = 1, name = "bundles", description = "List of bundles to download the sources for", required = true, multiValued = true) + @Argument(index = 1, name = "bundles", description = "List of bundles to download the sources for. The bundles are identified using the following syntax: symbolic_name,version where version is optional.", required = true, multiValued = true) List<String> bundles; protected void doExecute(RepositoryAdmin admin) throws Exception { http://git-wip-us.apache.org/repos/asf/karaf/blob/64278398/obr/command/src/main/java/org/apache/karaf/obr/command/StartCommand.java ---------------------------------------------------------------------- diff --git a/obr/command/src/main/java/org/apache/karaf/obr/command/StartCommand.java b/obr/command/src/main/java/org/apache/karaf/obr/command/StartCommand.java index ec631d6..e0a08a9 100644 --- a/obr/command/src/main/java/org/apache/karaf/obr/command/StartCommand.java +++ b/obr/command/src/main/java/org/apache/karaf/obr/command/StartCommand.java @@ -26,7 +26,7 @@ import java.util.List; @Command(scope = "obr", name = "start", description = "Deploys and starts a list of bundles using OBR.") public class StartCommand extends ObrCommandSupport { - @Argument(index = 0, name = "bundles", description = "List of bundles to deploy (separated by whitespaces)", required = true, multiValued = true) + @Argument(index = 0, name = "bundles", description = "List of bundles to deploy (separated by whitespaces). The bundles are identified using the following syntax: symbolic_name,version where version is optional.", required = true, multiValued = true) protected List<String> bundles; @Option(name = "-d", aliases = { "--deployOptional" }, description = "Deploy optional bundles", required = false, multiValued = false)
