Interface ConfigStoreDao<T>

  • Type Parameters:
    T - data type store in database
    All Known Implementing Classes:
    JsonConfigStoreDaoImpl

    public interface ConfigStoreDao<T>
    It handles storing config data in database by generic datatype It also validates config before persist. (add & update)
    • Method Detail

      • register

        void register​(ConfigDefinition configDefinition)
        register service to config manager
        Parameters:
        configDefinition -
      • getConfigNames

        Set<String> getConfigNames()
        get all config names managing by config manager
        Returns:
        list of config name
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException
      • getConfigDefinition

        Optional<ConfigDefinition> getConfigDefinition​(String configName)
        get configs meta by configName
        Parameters:
        configName -
        Returns:
        status
      • getConfigs

        Optional<ConfigData<T>> getConfigs​(String configName)
        get configs data by configName It gives the raw ConfigData object. If you only want to get the specific config, you should use getConfig(String, String)
        Parameters:
        configName -
        Returns:
        config object
        See Also:
        getConfig(String, String), ConfigData
      • addConfig

        void addConfig​(String configName,
                       String configId,
                       org.json.JSONObject configObject)
                throws ValidationException
        add new config to a registered service name
        Parameters:
        configName -
        configId -
        configObject - (JSONObject)
        Throws:
        ValidationException
      • deleteConfig

        void deleteConfig​(String configName,
                          String configId)
        delete one config from registered service name
        Parameters:
        configName -
        configId -
      • unregister

        void unregister​(String configName)
        unregister a service from config manager, it will remove both schema and configs
        Parameters:
        configName -
      • get

        Map<String,​T> get​(String configName)
        get all configs by registered config name
        Parameters:
        configName -
        Returns:
        configs