de.janrufmonitor.framework.configuration
Interface IConfigManager

All Superinterfaces:
IManager, IRepositoryManager

public interface IConfigManager
extends IRepositoryManager

This interface must be implemented by a Configuration Manager object, which should be used in the framework. A configuration manager has to handle all configuration settings for the framework. They have to be kept consistent and valid.

Author:
Thilo Brandt

Method Summary
 String[] getConfigurationNamespaces()
          Gets all namespaces supported by the configuration manager.
 Object getConfigurationSource()
          Gets the source object for the properties
 Properties getProperties(String namespace)
          Gets a list of all properties for a given namespace.
 Properties getProperties(String namespace, boolean selected)
          Gets a list of selectable properties for a given namespace.
 Properties getProperties(String namespace, String name)
          Gets a list of all properties for a given namespace and names.
 Properties getProperties(String namespace, String name, boolean selected)
          Gets a list of selectable properties for a given namespace and names.
 String getProperty(String namespace, String name)
          Gets a certain property with a given namespace and name.
 String getProperty(String namespace, String name, String metadata)
          Gets a certain property with a given namespace, name and metadata.
 void loadConfiguration()
          Loads the configuration from the source object.
 void removeProperties(String namespace)
          Removes all properties for the given namespace.
 void removeProperty(String namespace, String name)
          Removes a certain property with a given namespace and name.
 void removeProperty(String namespace, String name, String metadata)
          Removes a certain property with a given namespace, name and metadata.
 void saveConfiguration()
          Saves the configuration in the source object.
 void setConfigurationSource(Object obj)
          Sets the source object to store the properties in.
 void setProperties(String namespace, Properties props)
          Sets a list of properties for a given namespace.
 void setProperty(String namespace, String name, String value)
          Sets a certain property with a given namespace, name and a value.
 void setProperty(String namespace, String name, String metadata, String value)
          Sets a certain property with a given namespace, name, metadata and a value.
 void setProperty(String namespace, String name, String metadata, String value, boolean overwrite)
          Sets a certain property with a given namespace, name, metadata and a value.
 
Methods inherited from interface de.janrufmonitor.framework.manager.IRepositoryManager
isActive, isSupported
 
Methods inherited from interface de.janrufmonitor.framework.manager.IManager
getManagerID, getPriority, restart, setManagerID, shutdown, startup
 

Method Detail

setProperty

void setProperty(String namespace,
                 String name,
                 String value)
Sets a certain property with a given namespace, name and a value. The namespace is neccessary to avoid name collisions for properties from different modules / plugins.

Parameters:
namespace - the namespace of the property
name - the name of the property
value - the value of the property

setProperty

void setProperty(String namespace,
                 String name,
                 String metadata,
                 String value)
Sets a certain property with a given namespace, name, metadata and a value. The namespace is neccessary to avoid name collisions for properties from different modules / plugins. The metadat can be used by a module / plugin for handling different information for one property e.g., value = 555 and type = integer.
 Example: namespace = de.development.myPlugin
                        name = counter
                        metadata = value
                        value = 99999
 
                        namespace = de.development.myPlugin
                        name = counter
                        metadata = type
                        value = integer
 

Parameters:
namespace - the namespace of the property
name - the name of the property
metadata - the metadata of the property
value - the value of the property

setProperty

void setProperty(String namespace,
                 String name,
                 String metadata,
                 String value,
                 boolean overwrite)
Sets a certain property with a given namespace, name, metadata and a value. The namespace is neccessary to avoid name collisions for properties from different modules / plugins. The metadat can be used by a module / plugin for handling different information for one property e.g., value = 555 and type = integer.
 Example: namespace = de.development.myPlugin
                        name = counter
                        metadata = value
                        value = 99999
 
                        namespace = de.development.myPlugin
                        name = counter
                        metadata = type
                        value = integer
 

Parameters:
namespace - the namespace of the property
name - the name of the property
metadata - the metadata of the property
value - the value of the property
overwrite - if the property already exists it can be overwritten or left by its old value.

getProperty

String getProperty(String namespace,
                   String name)
Gets a certain property with a given namespace and name. The namespace is neccessary to avoid name collisions for properties from different modules / plugins.

Parameters:
namespace - the namespace of the property
name - the name of the property
Returns:
the value of the property

getProperty

String getProperty(String namespace,
                   String name,
                   String metadata)
Gets a certain property with a given namespace, name and metadata. The namespace is neccessary to avoid name collisions for properties from different modules / plugins. The metadat can be used by a module / plugin for handling different information for one property e.g., value = 555 and type = integer.
 Example: namespace = de.development.myPlugin
                        name = counter
                        metadata = value
                        value = 99999
 
                        namespace = de.development.myPlugin
                        name = counter
                        metadata = type
                        value = integer
 

Parameters:
namespace - the namespace of the property
name - the name of the property
metadata - the metadata of the property
Returns:
the value of the property

removeProperty

void removeProperty(String namespace,
                    String name)
Removes a certain property with a given namespace and name. The namespace is neccessary to avoid name collisions for properties from different modules / plugins.

Parameters:
namespace - the namespace of the property
name - the name of the property

removeProperty

void removeProperty(String namespace,
                    String name,
                    String metadata)
Removes a certain property with a given namespace, name and metadata. The namespace is neccessary to avoid name collisions for properties from different modules / plugins. The metadat can be used by a module / plugin for handling different information for one property e.g., value = 555 and type = integer.

Parameters:
namespace - the namespace of the property
name - the name of the property
metadata - the metadata of the property

setProperties

void setProperties(String namespace,
                   Properties props)
Sets a list of properties for a given namespace.

Parameters:
namespace - the namespace to set the list for
props - list of properties

getProperties

Properties getProperties(String namespace)
Gets a list of all properties for a given namespace.

Parameters:
namespace - the namespace to retrieve the list for
Returns:

getProperties

Properties getProperties(String namespace,
                         boolean selected)
Gets a list of selectable properties for a given namespace.

Parameters:
namespace - the namespace to retrieve the list for
selected - a selected set of properties could be returned, e.g. for security reasons
Returns:

getProperties

Properties getProperties(String namespace,
                         String name)
Gets a list of all properties for a given namespace and names. This method is neccessary to get all metadata information for a certain property.

Parameters:
namespace - the namespace to retrieve the list for
name - the name to retrieve the list for
Returns:

getProperties

Properties getProperties(String namespace,
                         String name,
                         boolean selected)
Gets a list of selectable properties for a given namespace and names. This method is neccessary to get all metadata information for a certain property.

Parameters:
namespace - the namespace to retrieve the list for
name - the name to retrieve the list for
selected - a selected set of properties could be returned, e.g. for security reasons
Returns:

removeProperties

void removeProperties(String namespace)
Removes all properties for the given namespace.

Parameters:
namespace - the namespace to be removed

setConfigurationSource

void setConfigurationSource(Object obj)
Sets the source object to store the properties in. This could be a DB connection, a file or what ever you can imagine for persistency.

Parameters:
obj - the source object to store the properties

getConfigurationSource

Object getConfigurationSource()
Gets the source object for the properties

Returns:
the source object

loadConfiguration

void loadConfiguration()
Loads the configuration from the source object.


saveConfiguration

void saveConfiguration()
Saves the configuration in the source object.


getConfigurationNamespaces

String[] getConfigurationNamespaces()
Gets all namespaces supported by the configuration manager.

Returns:
Array of all namespaces.


Copyright © 2010 by Thilo Brandt. All Rights Reserved.