Package org.n52.faroe
Interface SettingsService
- All Known Implementing Classes:
SettingsServiceImpl
public interface SettingsService
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddSetting(SettingDefinition<?> def) voidaddSettings(Collection<SettingDefinition<?>> defs) voidchangeSetting(SettingValue<?> newValue) Changes a setting.voidConfigureowith the required settings.voidconfigureOnce(Object object) Configureowith the required settings.voidDeletes all settings and users.voiddeleteSetting(SettingDefinition<?> setting) Deletes the setting defined bysetting.getDefinitionByKey(String key) Get the definition that is defined with the specified key.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<?>> Gets allSettingDefinitions known by this class.Map<SettingDefinition<?>, SettingValue<?>> Gets all values for all definitions.voidGets all values for all definitions and udpates (changes or configures) all configured objets.
-
Method Details
-
changeSetting
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
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:
-
configureOnce
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:
-
deleteAll
void deleteAll()Deletes all settings and users. -
deleteSetting
Deletes the setting defined bysetting.- Parameters:
setting- the definition- Throws:
ConfigurationError- if there is a problem deleting the setting
-
getDefinitionByKey
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
-
getKeys
- Returns:
- the keys for all definitions
-
getSetting
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
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
-
addSettings
-