|
Knopflerfish OSGi 1.3.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knopflerfish.util.cm.CMDataManager
Loads/saves Configuration Management data from/to XML files that uses the cm_data DTD.
Public methods in this class intentionally avoids throwing any XML related exceptions. However, at any XML parse error, IllegalArgumentException is thrown instead, with a nice descriptive string of the error.
Field Summary | |
static java.lang.String |
BUNDLE_LOCATION
This should really be in org.osgi.framework.Constants
but it is not. |
static java.lang.String |
CM_DATA_0_1_ID
The Public ID of the cm_data DTD. |
static java.lang.String |
CM_DATA_0_1_URI
The file name of the cm_data DTD. |
static java.lang.String |
CM_DATA_ARRAY_NAME
Name of a 'array' element. |
static java.lang.String |
CM_DATA_CONFIGRUATION_NAME
Name of a 'configuration' node. |
static java.lang.String |
CM_DATA_FACTORYCONFIGRUATION_NAME
Name of a 'factoryconfiguration' node. |
static java.lang.String |
CM_DATA_FILTER_NAME
Name of a 'filter' node. |
static java.lang.String |
CM_DATA_INCLUDE_NAME
Name of a 'include' node. |
static java.lang.String |
CM_DATA_PRIMITIVEVALUE_NAME
Name of a 'primitveValue' element. |
static java.lang.String |
CM_DATA_PROPERTY_NAME
Name of a 'property' element. |
static java.lang.String |
CM_DATA_ROOT_NAME
Name of the root node in cm_data |
static java.lang.String |
CM_DATA_VALUE_NAME
Name of a 'value' element. |
static java.lang.String |
CM_DATA_VECTOR_NAME
Name of a 'value' element. |
static java.lang.String |
CM_DATA_VERSION_ANAME
Name of 'version' attribute. |
static java.lang.String |
FACTORY_PID
This should really be in org.osgi.framework.Constants
but it is not. |
Method Summary | |
static void |
exportCMData(Configuration[] configs,
boolean deleteAllOldConfigs,
boolean template,
ConfigurationAdmin cfgAdmin,
java.io.OutputStream output)
Exports the specified configurations in a cm_data XML file. |
static void |
exportCMData(Configuration[] configs,
boolean deleteAllOldConfigs,
java.io.OutputStream output)
Exports the specified configurations in a cm_data XML file. |
static void |
exportCMData(java.lang.String pid,
java.lang.String factoryPid,
java.lang.String ldapfilter,
java.util.Dictionary properties,
java.io.OutputStream output)
Exports a configuration into a cm_data XML file. |
static void |
handleCMData(java.io.InputStream is,
ConfigurationAdmin cfgAdmin)
Parses an cm_data DTD XML-stream and updates CM using the specified cfgAdmin service. |
static void |
handleCMData(java.io.InputStream is,
java.lang.String url,
ConfigurationAdmin cfgAdmin)
Parses an cm_data DTD XML-stream and updates CM using the specified cfgAdmin service. |
static void |
handleCMData(java.lang.String url,
ConfigurationAdmin cfgAdmin)
Parses an cm_data DTD XML-file and updates CM using the specified cfgAdmin service. |
static java.util.Collection |
parseCMData(java.io.InputStream is)
Parses a cm_data DTD XML-stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String CM_DATA_0_1_ID
public static final java.lang.String CM_DATA_0_1_URI
public static final java.lang.String CM_DATA_ROOT_NAME
public static final java.lang.String CM_DATA_CONFIGRUATION_NAME
public static final java.lang.String CM_DATA_FACTORYCONFIGRUATION_NAME
public static final java.lang.String CM_DATA_FILTER_NAME
public static final java.lang.String CM_DATA_INCLUDE_NAME
public static final java.lang.String CM_DATA_PROPERTY_NAME
public static final java.lang.String CM_DATA_VALUE_NAME
public static final java.lang.String CM_DATA_PRIMITIVEVALUE_NAME
public static final java.lang.String CM_DATA_ARRAY_NAME
public static final java.lang.String CM_DATA_VECTOR_NAME
public static final java.lang.String CM_DATA_VERSION_ANAME
public static final java.lang.String FACTORY_PID
org.osgi.framework.Constants
but it is not.
public static final java.lang.String BUNDLE_LOCATION
org.osgi.framework.Constants
but it is not.
Method Detail |
public static void handleCMData(java.lang.String url, ConfigurationAdmin cfgAdmin) throws java.io.IOException
url
- String with URL syntax pointing to the XML-file
to parse.cfgAdmin
- Configuration admin service to use when updating
CM with data from the specified XML-file.
java.io.IOException
java.lang.IllegalArgumentException
- If the cfgAdmin is
null or the root element of the XML-file is not named
'cm_data', or if the XML parse failed.public static void handleCMData(java.io.InputStream is, ConfigurationAdmin cfgAdmin) throws java.io.IOException
is
- XML stream to parse.cfgAdmin
- Configuration admin service to use when updating
CM with data from the specified XML-file.
java.io.IOException
java.lang.IllegalArgumentException
- If the cfgAdmin is
null or the root element of the XML-file is not named
'cm_data', or if the XML parse failed.public static void handleCMData(java.io.InputStream is, java.lang.String url, ConfigurationAdmin cfgAdmin) throws java.io.IOException
is
- XML stream to parse.url
- URL of the stream to parse, must be a correct
value if the document contains an
<include> element with a realtive URL.cfgAdmin
- Configuration admin service to use when updating
CM with data from the specified XML-file.
java.io.IOException
java.lang.IllegalArgumentException
- If the cfgAdmin is
null or the root element of the XML-file is not named
'cm_data', or if the XML parse failed.public static java.util.Collection parseCMData(java.io.InputStream is) throws java.io.IOException
is
- XML stream to parse.
java.io.IOException
java.lang.IllegalArgumentException
- If the root element
of the XML-file is not named 'cm_data', or if the XML parse failed.public static void exportCMData(Configuration[] configs, boolean deleteAllOldConfigs, java.io.OutputStream output) throws java.io.IOException
configs
- Array with configurations to export.deleteAllOldConfigs
- If true start the generated file with
an instruction to delete all existing configurations.output
- An output stream to write to.
java.io.IOException
java.lang.IllegalArgumentException
public static void exportCMData(Configuration[] configs, boolean deleteAllOldConfigs, boolean template, ConfigurationAdmin cfgAdmin, java.io.OutputStream output) throws java.io.IOException
The template saves a configuration where some data is left out so that it can be filled in by GDSPconf based on information from the system platform that the template is used on.
The follwoing data is left out
configs
- Array with configurations to export.deleteAllOldConfigs
- If true start the generated file with
an instruction to delete all existing
configurations. Also sets the mode of all
(factory) configurations to 'new' and not 'update'.template
- If true create an XML file suitable as a
GDSPconf template.cfgAdmin
- If template
is true then a
configuration admin service is required. Used to
determine template details from configuration data.output
- An output stream to write to.
java.io.IOException
public static void exportCMData(java.lang.String pid, java.lang.String factoryPid, java.lang.String ldapfilter, java.util.Dictionary properties, java.io.OutputStream output) throws java.io.IOException
If pid != null
, factorypPid and ldapFilter are
ignored and the properties contained in properties are exported
into a non factory configuration.
If pid == null
, a factory configuration will be
exported. factorypPid
and ldapFilter
must in this case not be null
.
pid
- Configiration pidfactoryPid
- Configuration factory pidldapfilter
- Filter for the factory configurationproperties
- Properties for the configurationoutput
- An output stream to write to.
java.io.IOException
|
Knopflerfish OSGi 1.3.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |