Package org.n52.faroe
Interface SettingsService
-
- All Known Implementing Classes:
SettingsServiceImpl
public interface SettingsService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddSetting(SettingDefinition<?> def)voidaddSettings(Collection<SettingDefinition<?>> defs)voidchangeSetting(SettingValue<?> newValue)Changes a setting.voidconfigure(Object object)Configureowith the required settings.voidconfigureOnce(Object object)Configureowith the required settings.voiddeleteAll()Deletes all settings and users.voiddeleteSetting(SettingDefinition<?> setting)Deletes the setting defined bysetting.SettingDefinition<?>getDefinitionByKey(String key)Get the definition that is defined with the specified key.Set<String>getKeys()<T> SettingValue<T>getSetting(String key)Gets the value of the setting defined bykey.<T> SettingValue<T>getSetting(SettingDefinition<T> key)Gets the value of the setting defined bykey.Set<SettingDefinition<?>>getSettingDefinitions()Gets allSettingDefinitions known by this class.SettingValueFactorygetSettingFactory()Map<SettingDefinition<?>,SettingValue<?>>getSettings()Gets all values for all definitions.voidreconfigure()Gets all values for all definitions and udpates (changes or configures) all configured objets.
-
-
-
Method Detail
-
changeSetting
void changeSetting(SettingValue<?> newValue) throws ConfigurationError
Changes a setting. The change is propagated to all Objects that are configured. If the change fails for one of these objects, the setting is reverted to the old value of the setting for all objects.- Parameters:
newValue- the new value of the setting- Throws:
ConfigurationError- if there is a problem changing the setting.
-
configure
void configure(Object object) throws ConfigurationError
Configureowith the required settings. All changes to a setting required by the object will be applied.- Parameters:
object- the object to configure- Throws:
ConfigurationError- if there is a problem configuring the object- See Also:
Configurable,Setting
-
configureOnce
void configureOnce(Object object) throws ConfigurationError
Configureowith the required settings. Future changes to settings will not be propagated to the object.- Parameters:
object- the object to configure- Throws:
ConfigurationError- if there is a problem configuring the object- See Also:
configure(java.lang.Object)
-
deleteAll
void deleteAll()
Deletes all settings and users.
-
deleteSetting
void deleteSetting(SettingDefinition<?> setting) throws ConfigurationError
Deletes the setting defined bysetting.- Parameters:
setting- the definition- Throws:
ConfigurationError- if there is a problem deleting the setting
-
getDefinitionByKey
SettingDefinition<?> getDefinitionByKey(String key)
Get the definition that is defined with the specified key.- Parameters:
key- the key- Returns:
- the definition or
nullif there is no definition for the key
-
getSetting
<T> SettingValue<T> getSetting(SettingDefinition<T> key)
Gets the value of the setting defined bykey.- Type Parameters:
T- the type of the setting and value- Parameters:
key- the definition of the setting- Returns:
- the value of the setting
-
getSetting
<T> SettingValue<T> getSetting(String key)
Gets the value of the setting defined bykey.- Type Parameters:
T- the type of the setting and value- Parameters:
key- the id of the setting- Returns:
- the value of the setting
-
getSettingDefinitions
Set<SettingDefinition<?>> getSettingDefinitions()
Gets allSettingDefinitions known by this class.- Returns:
- the definitions
-
getSettingFactory
SettingValueFactory getSettingFactory()
- Returns:
- the
SettingValueFactoryto produce values
-
getSettings
Map<SettingDefinition<?>,SettingValue<?>> getSettings()
Gets all values for all definitions. If there is no value for a definitionnullis added to the map.- Returns:
- all values by definition
-
reconfigure
void reconfigure()
Gets all values for all definitions and udpates (changes or configures) all configured objets.
-
addSetting
void addSetting(SettingDefinition<?> def)
-
addSettings
void addSettings(Collection<SettingDefinition<?>> defs)
-
-