com.esf.core.configuration.service
Interface IConfigurationManagerService


public interface IConfigurationManagerService

The Configuration Manager Service provides an API for software components to request and store configuration data as well as request that configurations be archived within the Configuration Manager. Copyright © 2009 Eurotech Inc. All rights reserved.


Field Summary
static java.lang.String NEW_CONFIGURATION_TOPIC_BASE
          A static string representing the base topic that is published when a bundle accepts a new configuration by not throwing an EsfConfigurationException.
static java.lang.String SERVICE_NAME
          Reports the class name representing this interface.
 
Method Summary
 boolean configChangePending(java.lang.String name)
          This method is used to find out if the configuration manager has sent a new configuration to a component and is waiting for a response.
 java.lang.Object getConfiguration(java.lang.String name)
          This method returns a configuration @Object.
 java.lang.Object rejectConfiguration(java.lang.String name)
          Deprecated. As of ESF 1.1.0 replaced by This method is used to inform that Configuration Manager that a component has rejected a configuration. A component must specify a String representing its symbolic name. The Configuration Manager will then issue a configuration error corresponding to the specified component and return a Configuration Object representing the most recent stored configuration in the archive. If no stored or default configuration exists in the archive, the method will return null
 void requestConfigurationUpdate(java.lang.String name)
          This method is used to request an update of a configuration from the configuration source/back-end.
 void storeConfiguration(java.lang.String name)
          Deprecated. As of ESF 1.1.0 replaced by This method is used to inform that Configuration Manager that the last supplied configuration @Object was accepted and should be stored in the archive. The Configuration Manager will then store the configuration @Object as in the archive as the current configuration.
 void storeConfiguration(java.lang.String name, IConfigurableComponentService configurableComponent, long bundleId, java.lang.Object config)
          This is used to store a configuration from a given configurable component.
 

Field Detail

SERVICE_NAME

static final java.lang.String SERVICE_NAME
Reports the class name representing this interface.


NEW_CONFIGURATION_TOPIC_BASE

static final java.lang.String NEW_CONFIGURATION_TOPIC_BASE
A static string representing the base topic that is published when a bundle accepts a new configuration by not throwing an EsfConfigurationException. So, if it returns null or an @Object representing its config to be archived, this event will be published along with a payload that includes the bundle ID that has accepted its configuration. This should be used by bundles that are interested in configuration change events. The bundle ID is the number assigned to the component bundle when installed in OSGi. A component can obtain it's bundle ID by methods supplied by the BundleContext class.

See Also:
Constant Field Values
Method Detail

getConfiguration

java.lang.Object getConfiguration(java.lang.String name)
This method returns a configuration @Object. The component must specify a String representing its symbolic name. The configuration @Object will contain the current configuration data stored in the manager for the specified component. A component will use this method to obtain a new configuration after receiving a “new configuration” event.

Parameters:
name - A @String representing the symbolic name of the requesting component.
Returns:
A configuration @Object containing typed configuration data. null if no configuration exists.

requestConfigurationUpdate

void requestConfigurationUpdate(java.lang.String name)
This method is used to request an update of a configuration from the configuration source/back-end. A component must specify a String representing its symbolic name. The Configuration Manager will respond by issuing a request for new configuration data from the configuration source/back-end. Upon arrival of the updated configuration data, a “new configuration” event will be published to the requesting component. The requesting component can then use the getConfiguration() method to obtain the configuration @Object containing the updated configuration data.

Parameters:
name - A @String representing the symbolic name of the requesting component.

rejectConfiguration

java.lang.Object rejectConfiguration(java.lang.String name)
Deprecated. As of ESF 1.1.0 replaced by This method is used to inform that Configuration Manager that a component has rejected a configuration. A component must specify a String representing its symbolic name. The Configuration Manager will then issue a configuration error corresponding to the specified component and return a Configuration Object representing the most recent stored configuration in the archive. If no stored or default configuration exists in the archive, the method will return null

Parameters:
name - A @String representing the symbolic name of the rejecting component.
Returns:
A configuration @Object containing typed configuration data. Null if no configuration exists.

storeConfiguration

void storeConfiguration(java.lang.String name)
Deprecated. As of ESF 1.1.0 replaced by This method is used to inform that Configuration Manager that the last supplied configuration @Object was accepted and should be stored in the archive. The Configuration Manager will then store the configuration @Object as in the archive as the current configuration.

Parameters:
name - A @String representing the symbolic name of the requesting component.

storeConfiguration

void storeConfiguration(java.lang.String name,
                        IConfigurableComponentService configurableComponent,
                        long bundleId,
                        java.lang.Object config)
                        throws java.lang.Exception
This is used to store a configuration from a given configurable component. This can only be used by the instance of the @IConfigurableComponentService that is updating its configuration

Parameters:
name - the symbolic name of the bundle to be configured
configurableComponent - the instance of the configurable component
bundleId - the bundle id of the bundle being configured
config - the configuration to be stored
Throws:
java.lang.Exception - if the configuration can not be stored

configChangePending

boolean configChangePending(java.lang.String name)
This method is used to find out if the configuration manager has sent a new configuration to a component and is waiting for a response. If the configuration manager has sent a configuration to a component and has not yet received a response it will return true. Otherwise it will return false.

Parameters:
name - A @String representing the symbolic name of the requesting component.
Returns:
true if a configuration change is pending, otherwise false.