Package org.europa.together.business
Interface ConfigurationDAO
- All Superinterfaces:
GenericDAO<ConfigurationDO,
,String> Serializable
- All Known Implementing Classes:
ConfigurationHbmDAO
@API(status=STABLE,
since="1.0",
consumers="ConfigurationHbmDAO")
@Component
public interface ConfigurationDAO
extends GenericDAO<ConfigurationDO,String>
The ConfigurationDAO provides all functionality for an application wide
configuration. An configuration entry is a simple key=value pair in context
of a module. The domain object supports features for versioning the
entries.
Domain Object: ID, CONF_KEY, CONF_VALUE, DEFAULT_VALUE, CONF_SET, MODUL_NAME, MODUL_VERSION, DEPRECATED, COMMENT
The keys are stored as SHA-256 hash, to protect the database against direct editing.
Domain Object: ID, CONF_KEY, CONF_VALUE, DEFAULT_VALUE, CONF_SET, MODUL_NAME, MODUL_VERSION, DEPRECATED, COMMENT
The keys are stored as SHA-256 hash, to protect the database against direct editing.
- Since:
- 1.0
- Version:
- 1.2
- Author:
- elmar.dott@gmail.com
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongetAllConfigurationSetEntries
(String module, String version, String configSet) Return a List with all configuration objects of a ConfigurationSet.A ConfigurationSet is a collection of all configuration entries of one version for a service like email inside a module.Return a List of all deprecated ConfigurationDO.getAllModuleEntries
(String module) Get all configuration entries for a module.getConfigurationByKey
(String key, String module, String version) Get the whole configuration object by a given key, module and the version of the module.getHistoryOfAEntry
(String module, String key, String configSet) In the case that for a module exist more versions than one.getValueByKey
(String key, String module, String version) Return the value of a key from a module.void
Restore a single entry to his default value.void
updateConfigurationEntries
(List<ConfigurationDO> configuration) Update a List of existing configuration entries.Methods inherited from interface org.europa.together.business.GenericDAO
countAllElements, create, delete, deserializeJsonAsList, deserializeJsonAsObject, find, getPrimaryKeyOfObject, listAllElements, serializeAsJson, update
-
Field Details
-
FEATURE_ID
Identifier for the given feature.- See Also:
-
-
Method Details
-
getConfigurationByKey
@API(status=STABLE, since="1.0") ConfigurationDO getConfigurationByKey(String key, String module, String version) Get the whole configuration object by a given key, module and the version of the module.- Parameters:
key
- as Stringmodule
- as Stringversion
- as String- Returns:
- configuration as Object
-
getAllConfigurationSetEntries
@API(status=STABLE, since="1.0") List<ConfigurationDO> getAllConfigurationSetEntries(String module, String version, String configSet) Return a List with all configuration objects of a ConfigurationSet.A ConfigurationSet is a collection of all configuration entries of one version for a service like email inside a module.- Parameters:
module
- as Stringversion
- as StringconfigSet
- as Sting- Returns:
- ConfigurationSet as List<Configuration>
-
getAllModuleEntries
Get all configuration entries for a module.- Parameters:
module
- as String- Returns:
- ConfigurationSet as List<Configuration>
-
getAllDeprecatedEntries
Return a List of all deprecated ConfigurationDO.- Returns:
- deprecated as List<Configuration>
-
getHistoryOfAEntry
@API(status=STABLE, since="1.0") List<ConfigurationDO> getHistoryOfAEntry(String module, String key, String configSet) In the case that for a module exist more versions than one. For example after some upgrades, this method supports a history function of the previous configuration.- Parameters:
module
- as Stringkey
- as StringconfigSet
- as String- Returns:
- history as List<Configuration>
-
getValueByKey
Return the value of a key from a module. The hashing of the key will be done in this function, so the usage is more easy. The identifier for a configuration entry is a combination of the key itself, the module-name and the module-version were the DAO stored who use the module. e. g.: E-Mail Configuration is implemented in core, since version 1.0 In the case a entry exist but the value is empty, then the default value will used.- Parameters:
key
- as Stringmodule
- as Stringversion
- as String- Returns:
- value as String
-
restoreKeyToDefault
@API(status=STABLE, since="1.0") void restoreKeyToDefault(ConfigurationDO entry) throws DAOException Restore a single entry to his default value.- Parameters:
entry
- as Configuration- Throws:
DAOException
-
updateConfigurationEntries
@API(status=STABLE, since="1.0") void updateConfigurationEntries(List<ConfigurationDO> configuration) throws DAOException Update a List of existing configuration entries.- Parameters:
configuration
- as List<Configuration>- Throws:
DAOException
-