h1. Introduction
This bundle provides a command line interface to the standard OSGi Configuration Admin service, and can be used with the command line shell's that are bundled with most popular OSGi frameworks like [Felix|http://felix.apache.org] and Equinox.
The main goal of this bundle, is to provide a simple and convenient interface to the Configuration Admin service that can be used for experimenting with the Configuration Admin service and for setting up a simple configuration quickly. As such, it doesn't have any other dependencies.
h1. Installation
Just download the bundle and install it in the OSGi framework of your choice. No configuration, no dependencies, just use it!
(Of course, the bundle has a dependency on the {{org.osgi.service.cm}} package, but assuming you have a Configuration Admin service installed already, that package will be there too.)
h1. Usage
This bundle can be used together with the Apache Felix or Equinox command shell.
Provided that one of the command shells listed above is installed in your framework (which usually is the case when you started either Felix or Equinox with its default configuration), just install (and start) this bundle and type {{cm help}} on its command line. It will print the help message as shown below, which should speak for itself.
{noformat}
Usage:
cm help print this help message
cm list list all known configurations
cm get <pid> show configuration for service <pid>
cm getv <pid> verbose get (shows value types also)
cm put <pid> key value set string value for service <pid>
cm puts <pid> key value set "simple" value for service <pid>: value is "true", "false",
a char in single quotes, an int, or a number, with appended:
i (Integer), l (Long), f (Float), d (Double), b (Byte), s (Short)
cm del <pid> deletes configuration for service <pid>
cm create <pid> [<loc>] creates configuration for service <pid> (with optional bundle location)
{noformat}
*Examples*
To set the port of the [Apache Felix Http service|http://felix.apache.org/site/apache-felix-http-service.html] to 9389, enter
{noformat}
cm create org.apache.felix.http
cm put org.apache.felix.http org.osgi.service.http.port 9389
{noformat}
To set the password for the trustore (string values can contain spaces and other special characters) on Felix:
{noformat}
cm put org.apache.felix.http org.apache.felix.https.truststore.password This *is* a "strong" password!
{noformat}
and on Equinox:
{noformat}
cm put org.apache.felix.http org.apache.felix.https.truststore.password "This *is* a "strong" password!"
{noformat}
Note that according to the OSGi specification, neither the service pid nor the key can contain spaces.
*Creation*
The Configuration Admin service creates a configuration when someone "gets" it. This command line tool requires you to create a configuration explicitely, as shown in the example above.
*Limitations*
* It is not possible to set values of type array.
* On Felix it is not possible to set a string value that starts or ends with spaces.
h1. Download
* Binary: [^net.luminis.cmc-0.2.4.jar] (compiled for java 5)
* Source: [src|http://opensource.luminis.net/svn/BUNDLES/trunk/net.luminis.cmc/]
h1. Contact
Questions, problems, or other feedback? Mail the author (peter.doornbosch) at luminis.nl.
This bundle provides a command line interface to the standard OSGi Configuration Admin service, and can be used with the command line shell's that are bundled with most popular OSGi frameworks like [Felix|http://felix.apache.org] and Equinox.
The main goal of this bundle, is to provide a simple and convenient interface to the Configuration Admin service that can be used for experimenting with the Configuration Admin service and for setting up a simple configuration quickly. As such, it doesn't have any other dependencies.
h1. Installation
Just download the bundle and install it in the OSGi framework of your choice. No configuration, no dependencies, just use it!
(Of course, the bundle has a dependency on the {{org.osgi.service.cm}} package, but assuming you have a Configuration Admin service installed already, that package will be there too.)
h1. Usage
This bundle can be used together with the Apache Felix or Equinox command shell.
Provided that one of the command shells listed above is installed in your framework (which usually is the case when you started either Felix or Equinox with its default configuration), just install (and start) this bundle and type {{cm help}} on its command line. It will print the help message as shown below, which should speak for itself.
{noformat}
Usage:
cm help print this help message
cm list list all known configurations
cm get <pid> show configuration for service <pid>
cm getv <pid> verbose get (shows value types also)
cm put <pid> key value set string value for service <pid>
cm puts <pid> key value set "simple" value for service <pid>: value is "true", "false",
a char in single quotes, an int, or a number, with appended:
i (Integer), l (Long), f (Float), d (Double), b (Byte), s (Short)
cm del <pid> deletes configuration for service <pid>
cm create <pid> [<loc>] creates configuration for service <pid> (with optional bundle location)
{noformat}
*Examples*
To set the port of the [Apache Felix Http service|http://felix.apache.org/site/apache-felix-http-service.html] to 9389, enter
{noformat}
cm create org.apache.felix.http
cm put org.apache.felix.http org.osgi.service.http.port 9389
{noformat}
To set the password for the trustore (string values can contain spaces and other special characters) on Felix:
{noformat}
cm put org.apache.felix.http org.apache.felix.https.truststore.password This *is* a "strong" password!
{noformat}
and on Equinox:
{noformat}
cm put org.apache.felix.http org.apache.felix.https.truststore.password "This *is* a "strong" password!"
{noformat}
Note that according to the OSGi specification, neither the service pid nor the key can contain spaces.
*Creation*
The Configuration Admin service creates a configuration when someone "gets" it. This command line tool requires you to create a configuration explicitely, as shown in the example above.
*Limitations*
* It is not possible to set values of type array.
* On Felix it is not possible to set a string value that starts or ends with spaces.
h1. Download
* Binary: [^net.luminis.cmc-0.2.4.jar] (compiled for java 5)
* Source: [src|http://opensource.luminis.net/svn/BUNDLES/trunk/net.luminis.cmc/]
h1. Contact
Questions, problems, or other feedback? Mail the author (peter.doornbosch) at luminis.nl.