Package org.n52.faroe

Interface SettingsService

All Known Implementing Classes:
SettingsServiceImpl

public interface SettingsService
  • Method Details

    • 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
      Configure o with 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

      void configureOnce(Object object) throws ConfigurationError
      Configure o with 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

      void deleteSetting(SettingDefinition<?> setting) throws ConfigurationError
      Deletes the setting defined by setting.
      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 null if there is no definition for the key
    • getKeys

      Set<String> getKeys()
      Returns:
      the keys for all definitions
    • getSetting

      <T> SettingValue<T> getSetting(SettingDefinition<T> key)
      Gets the value of the setting defined by key.
      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 by key.
      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 all SettingDefinitions known by this class.
      Returns:
      the definitions
    • getSettingFactory

      SettingValueFactory getSettingFactory()
      Returns:
      the SettingValueFactory to produce values
    • getSettings

      Map<SettingDefinition<?>,SettingValue<?>> getSettings()
      Gets all values for all definitions. If there is no value for a definition null is 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)