Bundle: cm_cmd
Version 5.0.1

CM Commands

Console command group for Configuration Management

Description

The CM Commands bundle provides the configuration console command group. The command group defines a set of console commands available for interacting with the Configuration Manager. The list below gives a short description of what the commands do, for complete details on parameters, use help on each command in the console.

The Knopflerfish CM implementation provides a legacy XML DTD, cm_data.dtd, that specifies one format for storing configurations as XML-documents. The Java package org.knopflerfish.shared.cm contains helper classes for writing and reading this XML format.

The import and export commands works with XML-documents following the cm_data.dtd. See cm for a description of this format.

Available configuration commands:
  create [-help] [-f] <pid> [<template>] - Create a configuration and open it for editing.
  current [-help] [-t] - Show the currently open configuration.
  delete [-help] <selection> - Delete an existing configuration.
  edit [-help] <selection> - Edit an existing configuration.
  export [-help] <file>] [<selection>] ... - Export configurations in xml format to file.
  import [-help] <url> - Import configuration data from xml file at url.
  list [-help] [<selection>] ... - List the PIDs of existing configurations.
  save [-help] [-force] - Save the currently open configuration in the CM.
  set [-help] <property> <value> [<type>] - Set a property in the currently open configuration.
  show [-help]  [-t] [<selection>] ... - Show the saved versions of configurations.
  unset [-help] <property> - Remove a property from the currently open configuration.

Examples

The following lists the PIDs of all configurations in CM, then shows the configuration properties of the second configuration in the output of list (using the list index on the beginning of the line).

configuration> list
Available configurations:
[0] org.knopflerfish.bundle.consoletelnet.TelnetServer
[1] org.knopflerfish.bundle.consoletelnet.TelnetServer|org.knopflerfish.bundle.consoletelnet-IMPL
[2] org.knopflerfish.bundle.http.factory.HttpServer.2
configuration> show 1
[1] org.knopflerfish.bundle.consoletelnet.TelnetServer|org.knopflerfish.bundle.consoletelnet-IMPL
 location: file:jars/consoletelnet/consoletelnet-4.0.1.jar
 change count: 11
 properties:
  busywait= false
  defaultPassword= admin
  defaultUser= admin
  forbiddenGroup= 
  host= localhost
  port= 2321
  requiredGroup= 
  service.pid= org.knopflerfish.bundle.consoletelnet.TelnetServer|org.knopflerfish.bundle.consoletelnet-IMPL
  um= false
configuration> 

Now create a new targeted configuration that will use [1] above as template to initialize its properties. Then we change the port property and saves the edited configuration.

configuration> create 'org.knopflerfish.bundle.consoletelnet.TelnetServer|org.knopflerfish.bundle.consoletelnet-IMPL|file:jars/consoletelnet/consoletelnet-4.0.1.jar' 1
configuration> current -t
[-] org.knopflerfish.bundle.consoletelnet.TelnetServer|org.knopflerfish.bundle.consoletelnet-IMPL|file:jars/consoletelnet/consoletelnet-4.0.1.jar
 location: -
 change count: 1
 properties:
  busywait:Boolean= false
  defaultPassword:String= admin
  defaultUser:String= admin
  forbiddenGroup:String= 
  host:String= localhost
  port:Short= 2321
  requiredGroup:String= 
  service.pid:String= org.knopflerfish.bundle.consoletelnet.TelnetServer|org.knopflerfish.bundle.consoletelnet-IMPL|file:jars/consoletelnet/consoletelnet-4.0.1.jar
  um:Boolean= false
configuration> set port 2322
configuration> save
configuration> l
Available configurations:
[0] org.knopflerfish.bundle.consoletelnet.TelnetServer
[1] org.knopflerfish.bundle.consoletelnet.TelnetServer|org.knopflerfish.bundle.consoletelnet-IMPL
[2] org.knopflerfish.bundle.consoletelnet.TelnetServer|org.knopflerfish.bundle.consoletelnet-IMPL|file:jars/consoletelnet/consoletelnet-4.0.1.jar
[3] org.knopflerfish.bundle.http.factory.HttpServer.2
configuration> 

See Also

CM - Configuration Management

Bundle Jar docs

cm_cmd-5.0.1

Exported Packages

No exported packages.