de.smartics.properties.api.config.domain
Interface ConfigurationRepositoryManagement

Package class diagram package ConfigurationRepositoryManagement
All Superinterfaces:
ConfigurationRepository
All Known Implementing Classes:
InMemoryConfigurationRepositoryManagement

public interface ConfigurationRepositoryManagement
     
     
extends ConfigurationRepository

Management interface to change configuration properties.

Implementations are not required to be thread-safe, but usually should be.


Method Summary
 ConfigurationPropertiesManagement deregisterProperties(ConfigurationKey<?> key)
          Removes the configuration properties for the given configuration key.
 Collection<ConfigurationKey<?>> getKeys()
          Returns the list of keys with configuration properties.
 ConfigurationPropertiesManagement getPropertiesManagement(ConfigurationKey<?> key)
          Fetches the properties management for the given configuration key.
 ConfigurationPropertiesManagement getPropertiesManagementWithDefaults(ConfigurationKey<?> key)
          Fetches the properties management for the given configuration key.
 PropertyDescriptorRegistry getRegistry()
          Returns the registry to resolve property descriptors.
 boolean hasPropertiesManagement(ConfigurationKey<?> key)
          Checks if a properties management for the given configuration key is present.
 void registerProperties(ConfigurationKey<?> key, ConfigurationPropertiesManagement configurationProperties)
          Registers the given configuration properties for the given configuration key.
 void release()
          Releases resources acquired by this instance.
 
Methods inherited from interface de.smartics.properties.api.config.domain.ConfigurationRepository
getProperties
 

Method Detail

registerProperties

void registerProperties(ConfigurationKey<?> key,
                        ConfigurationPropertiesManagement configurationProperties)
                        throws de.smartics.util.lang.NullArgumentException,
                               DuplicateConfigurationException
Registers the given configuration properties for the given configuration key.

Parameters:
key - the key that specifies an application in its environment.
configurationProperties - the configuration properties to register by the given key.
Throws:
de.smartics.util.lang.NullArgumentException - if key or configurationProperties is null.
DuplicateConfigurationException - if a configuration with the given key is already registered.

deregisterProperties

ConfigurationPropertiesManagement deregisterProperties(ConfigurationKey<?> key)
                                                       throws de.smartics.util.lang.NullArgumentException
Removes the configuration properties for the given configuration key.

Parameters:
key - the key that specifies an application in its environment.
Returns:
the configuration properties that has been removed. May be null.
Throws:
de.smartics.util.lang.NullArgumentException - if key is null.

getKeys

Collection<ConfigurationKey<?>> getKeys()
Returns the list of keys with configuration properties.

Returns:
the list of keys with configuration properties.

getPropertiesManagementWithDefaults

ConfigurationPropertiesManagement getPropertiesManagementWithDefaults(ConfigurationKey<?> key)
                                                                      throws de.smartics.util.lang.NullArgumentException,
                                                                             MissingConfigurationException
Fetches the properties management for the given configuration key. The default values for partial key are also attached.

Parameters:
key - the key that specifies an application in its environment.
Returns:
the requested configuration properties. Never null.
Throws:
de.smartics.util.lang.NullArgumentException - if key is null.
MissingConfigurationException - if there is no configuration for the given key.
See Also:
ConfigurationRepository.getProperties(ConfigurationKey)

getPropertiesManagement

ConfigurationPropertiesManagement getPropertiesManagement(ConfigurationKey<?> key)
                                                          throws de.smartics.util.lang.NullArgumentException,
                                                                 MissingConfigurationException
Fetches the properties management for the given configuration key.

Parameters:
key - the key that specifies an application in its environment.
Returns:
the requested configuration properties. Never null.
Throws:
de.smartics.util.lang.NullArgumentException - if key is null.
MissingConfigurationException - if there is no configuration for the given key.
See Also:
ConfigurationRepository.getProperties(ConfigurationKey)

hasPropertiesManagement

boolean hasPropertiesManagement(ConfigurationKey<?> key)
                                throws de.smartics.util.lang.NullArgumentException
Checks if a properties management for the given configuration key is present.

Parameters:
key - the key that specifies an application in its environment.
Returns:
true if the configuration is present, false if not.
Throws:
de.smartics.util.lang.NullArgumentException - if key is null.

getRegistry

PropertyDescriptorRegistry getRegistry()
Returns the registry to resolve property descriptors.

Returns:
the registry to resolve property descriptors.

release

void release()
Releases resources acquired by this instance.

Specified by:
release in interface ConfigurationRepository


Copyright © 2012-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.