Package org.n52.faroe

Interface SettingsService

    • 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
        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:
        Configurable, Setting
      • deleteAll

        void deleteAll()
        Deletes all settings and users.
      • 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
      • 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.