nl.gx.webmanager.services.config
Interface ConfigurationManagement


public interface ConfigurationManagement

Configuration Management service interface. This interface defines how the rest of the system interacts with the configuration subsystem.

Author:
arjansc

Method Summary
 void addConfigurationSet(ConfigurationSet set, java.lang.String setName, java.lang.String configurationDefinition)
          Add a ConfigurationSet to the persistant storage.
 void addConfigurationSetDefinition(org.osgi.service.metatype.ObjectClassDefinition configurationDefinition)
          Add the definition of a new ConfigurationSet.
 void addConfigurationSetDefinition(java.net.URL configurationDefinition)
          Add the definitino of a new ConfigurationSet based on the supplied MetaType xml document.
 void addListener(ConfigurationManagementListener listener, java.lang.String relativePath)
          Add a listener to (a subset of) the configuration data.
 ConfigurationEntry getConfigurationEntry(java.lang.String entryPath)
          Return a configuration entry given a dot expression.
 ConfigurationSet getConfigurationSet(java.lang.String relativePath)
          Returns the ConfigurationSet, if available, on the relative path.
 java.lang.String[] getConfigurationSetDefinitions()
          Returns an array of the names of all registered ConfigurationSet definitions.
 ConfigurationSet[] getConfigurationSets(java.lang.String relativePath)
          Returns all configuration sets under the relative path.
 ConfigurationSet[] getConfigurationSets(java.lang.String definition, java.util.Map<java.lang.String,java.lang.String> context)
          Returns the ConfigurationSets, if available, of the requested definition, whose criteria match the context.
 ConfigurationSet getConfigurationSetTemplate(java.lang.String configurationDefinition)
          Return an empty ConfigurationSet based on the given definition.
 java.lang.String getParameter(java.lang.String parameter)
          TODO
 java.lang.String getParameter(java.lang.String parameter, java.util.Map<java.lang.String,java.lang.String> context)
          TODO
 java.lang.String getParameter(java.lang.String parameter, java.util.Map<java.lang.String,java.lang.String> context, java.lang.String confSetName)
          TODO
 java.lang.String[] getParameters(java.lang.String parameter)
          TODO
 java.lang.String[] getParameters(java.lang.String parameter, java.util.Map<java.lang.String,java.lang.String> context)
           
 java.lang.String[] getParameters(java.lang.String parameter, java.util.Map<java.lang.String,java.lang.String> context, java.lang.String confSetName)
          TODO
 void parseAndAddConfigurationSets(java.io.File path, boolean overwrite)
          This method reads and parses an XML document given a File containing default configuration sets for a particular configuration set definition.
 void parseAndAddConfigurationSets(java.net.URL path, boolean overwrite)
          This method reads and parses an XML document given a URL to a file containing default configuration sets for a particular configuration set definition.
 void removeConfigurationSet(java.lang.String relativePath)
          Remove a ConfigurationSet from the persistant storage.
 void removeListener(ConfigurationManagementListener listener)
          Removes the ConfigurationManagementListener from the administration of listeners.
 void setConfigurationEntry(java.lang.String entryPath, java.lang.String[] value)
          Update the configurationentry with the given path with the given value.
 void updateConfigurationSet(ConfigurationSet set, java.lang.String relativePath)
          Updates the contents of the ConfigurationSet stored in the persistant storage.
 

Method Detail

addConfigurationSetDefinition

void addConfigurationSetDefinition(org.osgi.service.metatype.ObjectClassDefinition configurationDefinition)
Add the definition of a new ConfigurationSet. This definition is based on the OSGi MetaType specification.

Parameters:
configurationDefinition - MetaType ObjectClass definition.

addConfigurationSetDefinition

void addConfigurationSetDefinition(java.net.URL configurationDefinition)
Add the definitino of a new ConfigurationSet based on the supplied MetaType xml document.

Parameters:
configurationDefinition - Path the MetaType XML document.

parseAndAddConfigurationSets

void parseAndAddConfigurationSets(java.io.File path,
                                  boolean overwrite)
This method reads and parses an XML document given a File containing default configuration sets for a particular configuration set definition.

Parameters:
path - Path of the file with default configuration sets to load
overwrite - Indicates if configuration entries that have already a value should be overwritten or not. Configuration entries do not have a value yet for example if the corresponding property definition is just created.
Throws:
java.io.IOException
org.jdom.JDOMException

parseAndAddConfigurationSets

void parseAndAddConfigurationSets(java.net.URL path,
                                  boolean overwrite)
This method reads and parses an XML document given a URL to a file containing default configuration sets for a particular configuration set definition.

Parameters:
path - Path of the file with default configuration sets to load
overwrite - Indicates if configuration entries that have already a value should be overwritten or not. Configuration entries do not have a value yet for example if the corresponding property definition is just created.
Throws:
java.io.IOException
org.jdom.JDOMException

getConfigurationSetDefinitions

java.lang.String[] getConfigurationSetDefinitions()
Returns an array of the names of all registered ConfigurationSet definitions.

Returns:
array of all ConfigurationSet definition names.

getConfigurationSetTemplate

ConfigurationSet getConfigurationSetTemplate(java.lang.String configurationDefinition)
Return an empty ConfigurationSet based on the given definition.

Parameters:
configurationDefinition - Relative path identifying the definition of the required ConfigurationSet
Returns:

addConfigurationSet

void addConfigurationSet(ConfigurationSet set,
                         java.lang.String setName,
                         java.lang.String configurationDefinition)
Add a ConfigurationSet to the persistant storage. The set is stored at the location of its ConfigurationSet definition under the given set name.

Parameters:
set - The ConfigurationSet containing the configuration data.
setName - The name under which the set should be stored.
configurationDefinition - The definition dictating the structure of the ConfigurationSet.

removeConfigurationSet

void removeConfigurationSet(java.lang.String relativePath)
Remove a ConfigurationSet from the persistant storage. The set at the given (relative to the configuration path) path is deleted.

Parameters:
relativePath - The path to the set, relative to the configuration path.

updateConfigurationSet

void updateConfigurationSet(ConfigurationSet set,
                            java.lang.String relativePath)
Updates the contents of the ConfigurationSet stored in the persistant storage.

Parameters:
relativePath - The path to the set, relative to the configuration path.

getConfigurationSet

ConfigurationSet getConfigurationSet(java.lang.String relativePath)
Returns the ConfigurationSet, if available, on the relative path.

Parameters:
relativePath - The path to the set, relative to the configuration path.

getConfigurationSets

ConfigurationSet[] getConfigurationSets(java.lang.String definition,
                                        java.util.Map<java.lang.String,java.lang.String> context)
Returns the ConfigurationSets, if available, of the requested definition, whose criteria match the context.

Parameters:
definition - the definition type of the set
context - the context to be applied when matching for criteria
Returns:
a set matching the context or null if none was found

getConfigurationSets

ConfigurationSet[] getConfigurationSets(java.lang.String relativePath)
Returns all configuration sets under the relative path. Meaning all sets of a giving configuration definition (linked to the relative path) are returned.

Parameters:
relativePath - The path to the set, relative to the configuration path.

getConfigurationEntry

ConfigurationEntry getConfigurationEntry(java.lang.String entryPath)
Return a configuration entry given a dot expression. The expression must follow the syntax configurationsetdefinitionname.configurationsetname.configurationentryname

Parameters:
propertyPath - Expression to retrieve entry for
Returns:
ConfigurationEntry that meets the expression

setConfigurationEntry

void setConfigurationEntry(java.lang.String entryPath,
                           java.lang.String[] value)
Update the configurationentry with the given path with the given value. The path must follow the syntax configurationsetdefinitionname.configurationsetname.configurationentryname

Parameters:
entryPath - Expression to retrieve entry for
value - String array of values to set

addListener

void addListener(ConfigurationManagementListener listener,
                 java.lang.String relativePath)
                 throws ConfigurationManagementException
Add a listener to (a subset of) the configuration data. Any changes in the stored configuration data will result in a notification of the relevant listeners.

Parameters:
listener - ConfigurationManagementListener to add to the set of listeners.
relativePath - The subtree of configuration data, relative to the configuration path.
Throws:
ConfigurationManagementException

removeListener

void removeListener(ConfigurationManagementListener listener)
Removes the ConfigurationManagementListener from the administration of listeners.

Parameters:
listener - ConfigurationManagementListener to remove.

getParameter

java.lang.String getParameter(java.lang.String parameter)
                              throws ConfigurationManagementException
TODO

Parameters:
parameter -
Returns:
Throws:
ConfigurationManagementException

getParameter

java.lang.String getParameter(java.lang.String parameter,
                              java.util.Map<java.lang.String,java.lang.String> context)
                              throws ConfigurationManagementException
TODO

Parameters:
parameter -
context -
Returns:
Throws:
ConfigurationManagementException

getParameter

java.lang.String getParameter(java.lang.String parameter,
                              java.util.Map<java.lang.String,java.lang.String> context,
                              java.lang.String confSetName)
                              throws ConfigurationManagementException
TODO

Parameters:
parameter -
context -
Returns:
Throws:
ConfigurationManagementException

getParameters

java.lang.String[] getParameters(java.lang.String parameter)
                                 throws ConfigurationManagementException
TODO

Parameters:
parameter -
Returns:
Throws:
ConfigurationManagementException

getParameters

java.lang.String[] getParameters(java.lang.String parameter,
                                 java.util.Map<java.lang.String,java.lang.String> context)
                                 throws ConfigurationManagementException
Parameters:
parameter -
context -
Returns:
Throws:
ConfigurationManagementException

getParameters

java.lang.String[] getParameters(java.lang.String parameter,
                                 java.util.Map<java.lang.String,java.lang.String> context,
                                 java.lang.String confSetName)
                                 throws ConfigurationManagementException
TODO

Parameters:
parameter -
context -
Returns:
Throws:
ConfigurationManagementException


Copyright © 2007-2010 GX creative online development BV. All Rights Reserved.