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

Package class diagram package ConfigurationPropertiesManagement
All Superinterfaces:
ConfigurationProperties
All Known Subinterfaces:
ConfigurationPropertiesManagementSpi, SerializableConfigurationPropertiesManagement, SerializableConfigurationPropertiesManagementSpi
All Known Implementing Classes:
AbstractAdminModeConfigurationProperties, AbstractAdminModeSupportedPropertiesManagement, AbstractCacheConfigurationPropertiesManagement, AbstractConfigurationPropertiesManagement, AbstractExternalConfigurationPropertiesManagement, AbstractInMemoryConfigurationProperties, BootConfigurationProperties, CacheConfigurationPropertiesManagement, ClasspathConfigurationProperties, ConfigurationPropertiesManagementProxy, ConfigurationPropertiesManagementWithDefaults, DataSourceConfigurationProperties, JndiConfigurationProperties, PropertiesConfigurationProperties, SerializableCacheConfigurationPropertiesManagement

public interface ConfigurationPropertiesManagement
     
     
extends ConfigurationProperties

Provides management access to the configuration properties. Allows to add properties and other functions not related with accessing property values.

Implementation Notes:
This interface is intended to be implemented by service providers. API users are intended to us this interface to access properties. For details on creating instances of classes implementing this interface please refer to de.smartics.properties.api.config.

Method Summary
 ConfigurationPropertiesManagement addDefinitions(PropertyProvider properties)
          Adds the given definitions to this configuration.
 void addDescriptors(Class<?> declaringType)
          Adds all property descriptors declared in the given type.
 void flush()
          Signal to flush properties changed in memory to be written to a secondary storage.
 de.smartics.properties.api.core.domain.PropertyDescriptor getDescriptor(de.smartics.properties.api.core.domain.PropertyKey key)
          Returns the descriptor for the given key.
 de.smartics.properties.api.core.domain.PropertyDescriptor getDescriptor(String key)
          Returns the descriptor for the given key.
 List<de.smartics.properties.api.core.domain.PropertyDescriptor> getMandatoryPropertyDescriptors()
          Returns the list of mandatory properties.
 PropertyStoreAccessor getPropertyStoreAccessor()
          Provides direct access to the properties in the underlying store.
 de.smartics.properties.api.core.security.PropertyValueSecurity getPropertyValueSecurity()
          Returns the property value security helper to en- and decrypt property values.
 de.smartics.properties.api.core.domain.PropertyDescriptorRegistry getRegistry()
          Returns the registry to resolve property descriptors.
 Property setProperty(de.smartics.properties.api.core.domain.PropertyKey key, String value)
          Sets the property value for the given key.
 void setToAdminMode(boolean newMode)
          Sets the administration mode for this configuration.
 ConfigurationPropertiesManagement toRepresentative()
          Creates an representative of this configuration.
 SerializableConfigurationPropertiesManagement toSerializable()
          Creates a serializable variant of this implementation.
 Property unsetProperty(de.smartics.properties.api.core.domain.PropertyKey key)
          Unsets the property value for the given key.
 
Methods inherited from interface de.smartics.properties.api.config.domain.ConfigurationProperties
addPropertyChangeListener, addPropertyChangeListener, getContext, getContext, getKey, getProperties, getProperty, getProperty, getProperty, getProperty, getProperty, getPropertyAsType, getPropertyValue, getPropertyValue, getPropertyValue, getPropertyValue, getPropertyValue, getPropertyValueAsString, getPropertyValueAsString, getPropertyValueAsString, getPropertyValueAsString, getValidatedProperty, getValidatedProperty, getValidatedProperty, isInAdminMode, removePropertyChangeListener, removePropertyChangeListener, validate, validate, validate, validate, validate
 

Method Detail

getRegistry

de.smartics.properties.api.core.domain.PropertyDescriptorRegistry getRegistry()
Returns the registry to resolve property descriptors.

Returns:
the registry to resolve property descriptors.

getPropertyValueSecurity

de.smartics.properties.api.core.security.PropertyValueSecurity getPropertyValueSecurity()
Returns the property value security helper to en- and decrypt property values.

Returns:
the property value security helper to en- and decrypt property values.

setToAdminMode

void setToAdminMode(boolean newMode)
Sets the administration mode for this configuration.

Parameters:
newMode - the new value of the mode true if the configuration is to be set in administration mode, false if not.
See Also:
ConfigurationProperties.isInAdminMode()

addDescriptors

void addDescriptors(Class<?> declaringType)
                    throws de.smartics.properties.api.core.domain.DuplicatePropertyDeclarationsException
Adds all property descriptors declared in the given type.

Parameters:
declaringType - the type that declares the descriptors.
Throws:
de.smartics.properties.api.core.domain.DuplicatePropertyDeclarationsException - if any of the descriptors declare the same property.

getDescriptor

de.smartics.properties.api.core.domain.PropertyDescriptor getDescriptor(String key)
                                                                        throws UnknownPropertyException
Returns the descriptor for the given key.

Parameters:
key - the of the requested descriptor.
Returns:
the descriptor whose key matches the given key.
Throws:
UnknownPropertyException - if the property is not known.

getDescriptor

de.smartics.properties.api.core.domain.PropertyDescriptor getDescriptor(de.smartics.properties.api.core.domain.PropertyKey key)
                                                                        throws UnknownPropertyException
Returns the descriptor for the given key.

Parameters:
key - the of the requested descriptor.
Returns:
the descriptor whose key matches the given key.
Throws:
UnknownPropertyException - if the property is not known.

getMandatoryPropertyDescriptors

List<de.smartics.properties.api.core.domain.PropertyDescriptor> getMandatoryPropertyDescriptors()
Returns the list of mandatory properties.

Returns a copy that can be edited.

Returns:
the list of mandatory properties.

addDefinitions

ConfigurationPropertiesManagement addDefinitions(PropertyProvider properties)
                                                 throws NullPointerException
Adds the given definitions to this configuration.

Parameters:
properties - the property definitions to add.
Returns:
a reference to this configuration for chaining.
Throws:
NullPointerException - if properties is null.

setProperty

Property setProperty(de.smartics.properties.api.core.domain.PropertyKey key,
                     String value)
                     throws NullPointerException,
                            de.smartics.properties.api.core.domain.PropertyValidationException,
                            de.smartics.properties.api.core.domain.ReadOnlyPropertyException
Sets the property value for the given key.

Parameters:
key - the key to the property.
value - the value to the property.
Returns:
the old value to the property. A value of null is returned if the property had no value prior to this call.
Throws:
NullPointerException - if key is null.
de.smartics.properties.api.core.domain.PropertyValidationException - if the property value is invalid according to its constraints.
de.smartics.properties.api.core.domain.ReadOnlyPropertyException - if the property to update is read-only.

unsetProperty

Property unsetProperty(de.smartics.properties.api.core.domain.PropertyKey key)
                       throws NullPointerException,
                              de.smartics.properties.api.core.domain.ReadOnlyPropertyException
Unsets the property value for the given key.

Parameters:
key - the key to the property.
Returns:
the old value to the property. A value of null is returned if the property had no value prior to this call.
Throws:
NullPointerException - if key is null.
de.smartics.properties.api.core.domain.ReadOnlyPropertyException - if the property to update is read-only.

flush

void flush()
Signal to flush properties changed in memory to be written to a secondary storage.

Implementations are not required to only write on a flush. They have to make sure that after the flush is called, all data is transfered to the secondary storage.


getPropertyStoreAccessor

PropertyStoreAccessor getPropertyStoreAccessor()
Provides direct access to the properties in the underlying store.

Returns:
direct access to the properties in the underlying store.

toSerializable

SerializableConfigurationPropertiesManagement toSerializable()
Creates a serializable variant of this implementation.

Specified by:
toSerializable in interface ConfigurationProperties
Returns:
a serializable variant of this implementation.
See Also:
ConfigurationPropertiesProxy, ConfigurationPropertiesManagementProxy

toRepresentative

ConfigurationPropertiesManagement toRepresentative()
Creates an representative of this configuration. If the configuration serves for a specific configuration key, this instance will be returned. If the configuration servers for multiple configuration keys, the representative is returned. The representative is usually the configuration that is associated with the full key.

Specified by:
toRepresentative in interface ConfigurationProperties
Returns:
the representative (may be this).


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