Interface CmJaxbConfigDao<E>
-
- All Known Implementing Classes:
AbstractCmJaxbConfigDao,DefaultProvisiondConfigurationDao
public interface CmJaxbConfigDao<E>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description EgetConfig(String configId)It will the config in cache, if nothing found it will load from db.StringgetConfigName()ConfigName use for the Config and Schemadefault StringgetDefaultConfigId()The default configId when getConfig without passing configIddefault java.util.function.Consumer<ConfigUpdateInfo>getUpdateCallback()It will provide the callback for all update, you can simplydefault java.util.function.Consumer<E>getValidationCallback()It will return null validation callback for all ConfigDao.EloadConfig()It will load the default configEloadConfig(String configId)loadConfig from database by CM.voidupdateConfig(String configId, String jsonConfigString, boolean isReplace)
-
-
-
Method Detail
-
getConfigName
String getConfigName()
ConfigName use for the Config and Schema- Returns:
- ConfigName
-
getUpdateCallback
default java.util.function.Consumer<ConfigUpdateInfo> getUpdateCallback()
It will provide the callback for all update, you can simply- Returns:
- Consumer
-
getValidationCallback
default java.util.function.Consumer<E> getValidationCallback()
It will return null validation callback for all ConfigDao. By default, it is no needed. Validation will rely on openAPI schema. (xsd) Override if you need to do extra validation logic. e.g. quartz expression is not possible to validate by pattern.- Returns:
- Consumer
-
getDefaultConfigId
default String getDefaultConfigId()
The default configId when getConfig without passing configId- Returns:
- configId
-
loadConfig
E loadConfig()
It will load the default config- Returns:
- ConfigObject
-
loadConfig
E loadConfig(String configId)
loadConfig from database by CM. If it is already in cache, it will update the cache.- Parameters:
configId-- Returns:
- ConfigObject
-
getConfig
E getConfig(String configId)
It will the config in cache, if nothing found it will load from db. Please notice that, config can be different in db.- Parameters:
configId-- Returns:
- config
-
updateConfig
void updateConfig(String configId, String jsonConfigString, boolean isReplace) throws ValidationException
- Throws:
ValidationException
-
-