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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addConfig(String configName, String configId, org.json.JSONObject configObject)
add new config to a registered service namevoid
addConfigs(String configName, ConfigData<T> configData)
add configs for the registered service name, throws exception if config already existvoid
deleteConfig(String configName, String configId)
delete one config from registered service nameMap<String,T>
get(String configName)
get all configs by registered config nameMap<String,ConfigDefinition>
getAllConfigDefinitions()
Optional<T>
getConfig(String configName, String configId)
Optional<ConfigDefinition>
getConfigDefinition(String configName)
get configs meta by configNameSet<String>
getConfigNames()
get all config names managing by config managerOptional<ConfigData<T>>
getConfigs(String configName)
get configs data by configName It gives the raw ConfigData object.void
register(ConfigDefinition configDefinition)
register service to config managervoid
unregister(String configName)
unregister a service from config manager, it will remove both schema and configsvoid
updateConfigDefinition(ConfigDefinition configDefinition)
update configs meta by configNamevoid
updateConfigs(String configName, ConfigData<T> configData)
**replace** all configs for the registered service name
-
-
-
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
-
getAllConfigDefinitions
Map<String,ConfigDefinition> getAllConfigDefinitions()
-
getConfigDefinition
Optional<ConfigDefinition> getConfigDefinition(String configName)
get configs meta by configName- Parameters:
configName
-- Returns:
- status
-
updateConfigDefinition
void updateConfigDefinition(ConfigDefinition configDefinition) throws ValidationException
update configs meta by configName- Parameters:
configDefinition
-- Throws:
com.fasterxml.jackson.core.JsonProcessingException
ClassNotFoundException
ValidationException
-
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
-
addConfigs
void addConfigs(String configName, ConfigData<T> configData) throws ValidationException
add configs for the registered service name, throws exception if config already exist- Parameters:
configName
-configData
-- Throws:
ValidationException
-
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
-
updateConfigs
void updateConfigs(String configName, ConfigData<T> configData) throws ValidationException
**replace** all configs for the registered service name- Parameters:
configName
-configData
-- 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
-
-
-