From b59207a8718709b7b27570bb02e7d8b942882cb4 Mon Sep 17 00:00:00 2001 From: Gerwin Gsenger Date: Wed, 21 Jan 2015 13:51:44 +0100 Subject: small change to workings of delete, small bugfix --- .../moa/id/commons/db/NewConfigurationDBWrite.java | 44 ++++++---------------- 1 file changed, 12 insertions(+), 32 deletions(-) (limited to 'id/server/moa-id-commons/src/main/java/at/gv') diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBWrite.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBWrite.java index d8ac55b4e..e1b51ee9b 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBWrite.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBWrite.java @@ -18,8 +18,7 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.UserDatabase; import com.datentechnik.moa.id.conf.persistence.Configuration; /** - * - * + * This class is used for writing to the key-value database. */ @Component public class NewConfigurationDBWrite { @@ -33,61 +32,45 @@ public class NewConfigurationDBWrite { } private static boolean saveAuthComponentGeneral(AuthComponentGeneral dbo) { - - conf.set(MOAIDConfigurationConstants.AUTH_COMPONENT_GENERAL_KEY, dbo); - return true; + return conf.set(MOAIDConfigurationConstants.AUTH_COMPONENT_GENERAL_KEY, dbo); } private static boolean saveChainingModes(ChainingModes dbo) { - conf.set(MOAIDConfigurationConstants.CHAINING_MODES_KEY, dbo); - return true; + return conf.set(MOAIDConfigurationConstants.CHAINING_MODES_KEY, dbo); } private static boolean saveOnlineApplication(OnlineApplication dbo) { List storedObjects = conf.getList(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, OnlineApplication.class); storedObjects.add(dbo); - conf.set(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, storedObjects); - - return true; + return conf.set(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, storedObjects); } private static boolean saveGenericConfiguration(GenericConfiguration dbo) { List storedObjects = conf.getList(MOAIDConfigurationConstants.GENERIC_CONFIGURATION_KEY, GenericConfiguration.class); storedObjects.add(dbo); - conf.set(MOAIDConfigurationConstants.GENERIC_CONFIGURATION_KEY, storedObjects); - return true; + return conf.set(MOAIDConfigurationConstants.GENERIC_CONFIGURATION_KEY, storedObjects); } private static boolean saveTrustedCACertificates(String dbo) { - - conf.set(MOAIDConfigurationConstants.TRUSTED_CERTIFICATES_KEY, dbo); - return true; + return conf.set(MOAIDConfigurationConstants.TRUSTED_CERTIFICATES_KEY, dbo); } private static boolean saveDefaultBKUs(DefaultBKUs dbo) { - - conf.set(MOAIDConfigurationConstants.DEFAULT_BKUS_KEY, dbo); - return true; + return conf.set(MOAIDConfigurationConstants.DEFAULT_BKUS_KEY, dbo); } private static boolean saveSLRequestTemplates(SLRequestTemplates dbo) { - - conf.set(MOAIDConfigurationConstants.SLREQUEST_TEMPLATES_KEY, dbo); - return true; + return conf.set(MOAIDConfigurationConstants.SLREQUEST_TEMPLATES_KEY, dbo); } private static boolean saveTimeStampItem(Date dbo) { - - conf.set(MOAIDConfigurationConstants.TIMESTAMP_ITEM_KEY, dbo); - return true; + return conf.set(MOAIDConfigurationConstants.TIMESTAMP_ITEM_KEY, dbo); } private static boolean savePvp2RefreshItem(Date dbo) { - - conf.set(MOAIDConfigurationConstants.PVP2REFRESH_ITEM_KEY, dbo); - return true; + return conf.set(MOAIDConfigurationConstants.PVP2REFRESH_ITEM_KEY, dbo); } /** @@ -96,9 +79,7 @@ public class NewConfigurationDBWrite { * @return {@code true} on success; {@code false} otherwise. */ public static boolean saveOnlineApplications(List oas) { - - conf.set(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, oas); - return true; + return conf.set(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, oas); } /** @@ -107,7 +88,6 @@ public class NewConfigurationDBWrite { * @return {@code true} on success; {@code false} otherwise. */ public static boolean saveGenericConfigurations(List gcs) { - return conf.set(MOAIDConfigurationConstants.GENERIC_CONFIGURATION_KEY, gcs); } @@ -151,7 +131,7 @@ public class NewConfigurationDBWrite { * @param key the key */ public static void delete(String key) { - conf.delete(key); + conf.set(key, null); } } -- cgit v1.2.3