diff options
Diffstat (limited to 'id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigPropertyDao.java')
-rw-r--r-- | id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigPropertyDao.java | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigPropertyDao.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigPropertyDao.java new file mode 100644 index 000000000..db35ba1df --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigPropertyDao.java @@ -0,0 +1,58 @@ +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.util.List; +import java.util.Set; + +/** + * DAO interface providing means for accessing MOAID configuration properties. + * + */ +public interface ConfigPropertyDao { + + /** + * Gets all keys in the database. + * @return a List containing all keys in the database. + */ + List<String> getAllKeys(); + + /** + * Returns the {@link ConfigProperty} associated with {@code key} or {@code null} if the entry does not exist. + * + * @param key The configuration key. + * @return The configuration property value or {@code null}. + */ + ConfigProperty getProperty(String key); + + /** + * Persists a given {@link ConfigProperty}. + * @param property The property to be persisted. + */ + void saveProperty(ConfigProperty property); + + /** + * Returns a {@link List} containing all stored {@linkplain ConfigProperty ConfigProperties}. + * @return The list with the properties. + */ + List<ConfigProperty> getProperties(); + + /** + * Returns the value for the configuration property associated with {@code key} or {@code null} if the entry does not exist or its value is {@code null}. + * + * @param key The configuration key. + * @return The configuration property value or {@code null}. + */ + String getPropertyValue(String key); + + /** + * Persists a {@link List} of {@linkplain ConfigProperty ConfigProperties}. + * @param properties The list containing all the properties to be persisted. + */ + void saveProperties(Set<ConfigProperty> properties); + + /** + * Deletes the object associated with the given key. + * @param key the key + */ + void delete(String key); + +} |