aboutsummaryrefslogtreecommitdiff
path: root/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2015-06-19 10:59:09 +0200
committerThomas Lenz <tlenz@iaik.tugraz.at>2015-06-19 11:10:50 +0200
commitc276e33e5ebdebc1c727dbd93ea1f876588a0dec (patch)
tree421ad087eefdea0848848012f4dce5efd7c93dce /id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config
parent8ec83e5be6888c9e5aeb8d21a35eb4d7ec040f67 (diff)
downloadmoa-id-spss-c276e33e5ebdebc1c727dbd93ea1f876588a0dec.tar.gz
moa-id-spss-c276e33e5ebdebc1c727dbd93ea1f876588a0dec.tar.bz2
moa-id-spss-c276e33e5ebdebc1c727dbd93ea1f876588a0dec.zip
refactor MOA-ID AuthConfiguration
Diffstat (limited to 'id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config')
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationUtil.java1
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java246
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/ConfigurationImpl.java161
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfiguration.java (renamed from id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/Configuration.java)50
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfigurationImpl.java136
5 files changed, 408 insertions, 186 deletions
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationUtil.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationUtil.java
index d8fde7eee..e794951d7 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationUtil.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationUtil.java
@@ -18,7 +18,6 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
import at.gv.egovernment.moa.id.commons.config.persistence.Configuration;
import at.gv.egovernment.moa.id.commons.config.persistence.JsonMapper;
-import at.gv.egovernment.moa.id.commons.db.MOAIDConfigurationConstants;
import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration;
import com.fasterxml.jackson.core.JsonProcessingException;
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java
new file mode 100644
index 000000000..6217c6c68
--- /dev/null
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java
@@ -0,0 +1,246 @@
+package at.gv.egovernment.moa.id.commons.config;
+
+/**
+ *
+ *
+ */
+public final class MOAIDConfigurationConstants {
+
+ private MOAIDConfigurationConstants() {
+ // restrict instantiation
+ }
+
+ //Basic key namespaces
+ public static final String PREFIX_MOAID = "moa.id";
+ public static final String PREFIX_GENERAL = "general";
+ public static final String PREFIX_SERVICES = "services";
+ public static final String PREFIX_OA = "oa";
+ public static final String PREFIX_VIDP = "vidp";
+ public static final String PREFIX_IIDP = "iidp";
+ public static final String PREFIX_GATEWAY = "gateway";
+
+ public static final String PREFIX_MOAID_GENERAL = PREFIX_MOAID + "." + PREFIX_GENERAL;
+ public static final String PREFIX_MOAID_SERVICES = PREFIX_MOAID + "." + PREFIX_SERVICES;
+ public static final String PREFIX_MOAID_SERVICES_OA = PREFIX_MOAID_SERVICES + "." + PREFIX_OA;
+ public static final String PREFIX_MOAID_SERVICES_VIDP = PREFIX_MOAID_SERVICES + "." + PREFIX_VIDP;
+ public static final String PREFIX_MOAID_SERVICES_IIDP = PREFIX_MOAID_SERVICES + "." + PREFIX_IIDP;
+ public static final String PREFIX_MOAID_SERVICES_GATEWAY = PREFIX_MOAID_SERVICES + "." + PREFIX_GATEWAY;
+
+ //Namespaces for online applications
+ public static final String SERVICE_UNIQUEIDENTIFIER = "uniqueID"; //publicURLPrefix
+ public static final String SERVICE_FRIENDLYNAME = "friendlyName"; //friendlyName
+ public static final String SERVICE_TYPE = "type"; //type
+ public static final String SERVICE_ISACTIVE = "isActive"; //isActive
+
+ //service authentication keys
+ private static final String AUTH = "auth";
+ private static final String TARGET = "target";
+ private static final String BKU = "bku";
+ private static final String TESTCREDENTIALS = "testcredentials";
+ private static final String MANDATES = "mandates";
+ private static final String FOREIGNBPK = "foreignbPK";
+ private static final String SSO = "sso";
+ private static final String STORK = "stork";
+ private static final String TEMPLATES = "templates";
+ private static final String INTERFEDERATION = "interfederation";
+
+ private static final String PROTOCOLS = "protocols";
+ private static final String SAML1 = "saml1";
+ private static final String PVP2X = "pvp2x";
+ private static final String OPENID = "openID";
+
+ public static final String SERVICE_AUTH_TARGET = AUTH + "." + TARGET;
+ public static final String SERVICE_AUTH_TARGET_TYPE = SERVICE_AUTH_TARGET + ".type"; //targetFriendlyName or IdentificationType
+ public static final String SERVICE_AUTH_TARGET_VALUE = SERVICE_AUTH_TARGET + ".value"; //target or IdentificationValue
+
+ private static final String SERVICE_AUTH_BKU = AUTH + "." + BKU;
+ public static final String SERVICE_AUTH_BKU_ONLINE = SERVICE_AUTH_BKU + ".onlineBKU";
+ public static final String SERVICE_AUTH_BKU_LOCAL = SERVICE_AUTH_BKU + ".localBKU";
+ public static final String SERVICE_AUTH_BKU_HANDY = SERVICE_AUTH_BKU + ".handyBKU";
+ public static final String SERVICE_AUTH_BKU_KEYBOXIDENTIFIER = SERVICE_AUTH_BKU + ".keyBoxIdentifier";
+ public static final String SERVICE_AUTH_BKU_TEMPLATE_LIST = SERVICE_AUTH_BKU + ".template"; //SecurityLayer Templates
+ public static final String SERVICE_AUTH_BKU_TEMPLATE_LIST_VALUE = "url";
+ public static final String SERVICE_AUTH_BKU_AUTHBLOCKTEXT = SERVICE_AUTH_BKU + "authblock.additionaltext";
+ public static final String SERVICE_AUTH_BKU_AUTHBLOCK_REMOVEBPK = SERVICE_AUTH_BKU + "authblock.removebPK";
+
+ private static final String SERVICE_AUTH_TEMPLATES = AUTH + "." + TEMPLATES;
+ public static final String SERVICE_AUTH_TEMPLATES_BKUSELECTION = SERVICE_AUTH_TEMPLATES + ".bkuselection";
+ public static final String SERVICE_AUTH_TEMPLATES_SENDASSERTION = SERVICE_AUTH_TEMPLATES + ".sendAssertion";
+ private static final String SERVICE_AUTH_TEMPLATES_CUSTOMIZATION = SERVICE_AUTH_TEMPLATES + ".customize";
+ public static final String SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_FONTTYPE = SERVICE_AUTH_TEMPLATES_CUSTOMIZATION + ".fonttype";
+ public static final String SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_BACKGROUNDCOLOR = SERVICE_AUTH_TEMPLATES_CUSTOMIZATION + ".color.back";
+ public static final String SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_FRONTCOLOR = SERVICE_AUTH_TEMPLATES_CUSTOMIZATION + ".color.front";
+ public static final String SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_HEADERBACKGROUNDCOLOR = SERVICE_AUTH_TEMPLATES_CUSTOMIZATION + ".header.color.back";
+ public static final String SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_HEADERFRONTCOLOR = SERVICE_AUTH_TEMPLATES_CUSTOMIZATION + ".header.color.front";
+ public static final String SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_HEADERTEXT = SERVICE_AUTH_TEMPLATES_CUSTOMIZATION + ".header.text";
+ public static final String SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_BUTTONBACKGROUNDCOLOR = SERVICE_AUTH_TEMPLATES_CUSTOMIZATION + ".button.color.back";
+ public static final String SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_BUTTONBACLGROUNDCOLORFOCUS = SERVICE_AUTH_TEMPLATES_CUSTOMIZATION + ".button.color.back.focus";
+ public static final String SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_BUTTONFRONTCOLOR = SERVICE_AUTH_TEMPLATES_CUSTOMIZATION + ".button.color.front";
+ public static final String SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_APPLETREDIRECTTARGET = SERVICE_AUTH_TEMPLATES_CUSTOMIZATION + ".applet.redirecttarget";
+ public static final String SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_APPLETHEIGHT = SERVICE_AUTH_TEMPLATES_CUSTOMIZATION + ".applet.hight";
+ public static final String SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_APPLETWIDTH = SERVICE_AUTH_TEMPLATES_CUSTOMIZATION + ".applet.width";
+
+ private static final String SERVICE_AUTH_TESTCREDENTIALS = AUTH + "." + TESTCREDENTIALS;
+ public static final String SERVICE_AUTH_TESTCREDENTIALS_ENABLED = SERVICE_AUTH_TESTCREDENTIALS + ".enabled";
+ public static final String SERVICE_AUTH_TESTCREDENTIALS_OIDs = SERVICE_AUTH_TESTCREDENTIALS + ".oids";
+
+ private static final String SERVICE_AUTH_MANDATES = AUTH + "." + MANDATES;
+ public static final String SERVICE_AUTH_MANDATES_ONLY = SERVICE_AUTH_MANDATES + "only";
+ public static final String SERVICE_AUTH_MANDATES_PROFILES = SERVICE_AUTH_MANDATES + "profiles";
+
+ public static final String SERVICE_AUTH_FOREIGNBPK = AUTH + "." + FOREIGNBPK; //complex attribute
+
+ private static final String SERVICE_AUTH_SSO = AUTH + "." + SSO;
+ public static final String SERVICE_AUTH_SSO_ENABLED = SERVICE_AUTH_SSO + ".enabled";
+ public static final String SERVICE_AUTH_SSO_USERREQUEST = SERVICE_AUTH_SSO + ".userRequest";
+
+ private static final String SERVICE_AUTH_STORK = AUTH + "." + STORK;
+ public static final String SERVICE_AUTH_STORK_ENABLED = SERVICE_AUTH_STORK + ".enabled";
+ public static final String SERVICE_AUTH_STORK_COUNTRIES_LIST = SERVICE_AUTH_STORK + ".countries";
+ public static final String SERVICE_AUTH_STORK_COUNTRIES_LIST_ENABLED = "enabled";
+ public static final String SERVICE_AUTH_STORK_ATTRIBUTES_LIST = SERVICE_AUTH_STORK + ".attributes";
+ public static final String SERVICE_AUTH_STORK_ATTRIBUTES_LIST_NAME = "name";
+ public static final String SERVICE_AUTH_STORK_ATTRIBUTES_LIST_MANDATORY = "mandatory";
+ public static final String SERVICE_AUTH_STORK_REQUIRECONSENT = SERVICE_AUTH_STORK + ".requireConsent";
+ public static final String SERVICE_AUTH_STORK_ATTRIBUTPROVIDER_LIST = SERVICE_AUTH_STORK + ".attributeprovider";
+ public static final String SERVICE_AUTH_STORK_ATTRIBUTPROVIDER_LIST_NAME = "name";
+ public static final String SERVICE_AUTH_STORK_ATTRIBUTPROVIDER_LIST_URL = "url";
+ public static final String SERVICE_AUTH_STORK_ATTRIBUTPROVIDER_LIST_ATTRIBUTES = "attributes";
+
+ private static final String SERVICE_PROTOCOLS_SAML1 = PROTOCOLS + "." + SAML1;
+ public static final String SERVICE_PROTOCOLS_SAML1_ENABLED = SERVICE_PROTOCOLS_SAML1 + ".enabled";
+ public static final String SERVICE_PROTOCOLS_SAML1_IDL = SERVICE_PROTOCOLS_SAML1 + ".idl";
+ public static final String SERVICE_PROTOCOLS_SAML1_BASEID = SERVICE_PROTOCOLS_SAML1 + ".baseid";
+ public static final String SERVICE_PROTOCOLS_SAML1_AUTHBLOCK = SERVICE_PROTOCOLS_SAML1 + ".authblock";
+ public static final String SERVICE_PROTOCOLS_SAML1_CERTIFICATE = SERVICE_PROTOCOLS_SAML1 + ".certificate";
+ public static final String SERVICE_PROTOCOLS_SAML1_MANDATE = SERVICE_PROTOCOLS_SAML1 + ".mandate";
+ public static final String SERVICE_PROTOCOLS_SAML1_RETURNERROR = SERVICE_PROTOCOLS_SAML1 + ".returnError";
+
+ private static final String SERVICE_PROTOCOLS_PVP2X = PROTOCOLS + "." + PVP2X;
+ public static final String SERVICE_PROTOCOLS_PVP2X_RELOAD = SERVICE_PROTOCOLS_PVP2X + ".reload";
+ public static final String SERVICE_PROTOCOLS_PVP2X_URL = SERVICE_PROTOCOLS_PVP2X + ".URL";
+ public static final String SERVICE_PROTOCOLS_PVP2X_CERTIFICATE = SERVICE_PROTOCOLS_PVP2X + ".certificate";
+
+ private static final String SERVICE_PROTOCOLS_OPENID = PROTOCOLS + "." + OPENID;
+ public static final String SERVICE_PROTOCOLS_OPENID_CLIENTID = SERVICE_PROTOCOLS_OPENID + ".clientID";
+ public static final String SERVICE_PROTOCOLS_OPENID_CLIENTSECRET = SERVICE_PROTOCOLS_OPENID + ".secret";
+ public static final String SERVICE_PROTOCOLS_OPENID_REDIRECTURL = SERVICE_PROTOCOLS_OPENID + ".redirectURL";
+
+ public static final String SERVICE_INTERFEDERATION_SSO_INBOUND = INTERFEDERATION + ".SSO.inbound";
+ public static final String SERVICE_INTERFEDERATION_SSO_OUTBOUND = INTERFEDERATION + ".SSO.outbound";
+ public static final String SERVICE_INTERFEDERATION_SSO_STORE = INTERFEDERATION + ".SSO.store";
+ public static final String SERVICE_INTERFEDERATION_ATTRIBUTQUERY_URL = INTERFEDERATION + ".attributequery.url";
+
+ public static final String SERVICE_INTERFEDERATION_PASSIVEREQUEST = INTERFEDERATION + ".passiveReqeust";
+ public static final String SERVICE_INTERFEDERATION_LOCALAUTHONERROR = INTERFEDERATION + ".localAuthOnError";
+ public static final String SERVICE_INTERFEDERATION_FORWARD_IDPIDENTIFIER = INTERFEDERATION + ".forward.IDP";
+ public static final String SERVICE_INTERFEDERATION_FORWARD_PROTOCOL = INTERFEDERATION + ".forward.protocol";
+
+
+
+ //Namespaces for general MOA-ID config
+ public static final String GENERAL_PUBLICURLPREFIX = "publicURLPrefix";
+
+ private static final String GENERAL_DEFAULTS = "defaults";
+ private static final String GENERAL_DEFAULTS_BKU = GENERAL_DEFAULTS + "." + BKU;
+ public static final String GENERAL_DEFAULTS_BKU_ONLINE = GENERAL_DEFAULTS_BKU + ".onlineBKU";
+ public static final String GENERAL_DEFAULTS_BKU_HANDY = GENERAL_DEFAULTS_BKU + ".handyBKU";
+ public static final String GENERAL_DEFAULTS_BKU_LOCAL = GENERAL_DEFAULTS_BKU + ".localBKU";
+ private static final String GENERAL_DEFAULTS_TEMPLATES = GENERAL_DEFAULTS + "." + TEMPLATES;
+ public static final String GENERAL_DEFAULTS_TEMPLATES_LOCAL = GENERAL_DEFAULTS_TEMPLATES + ".localBKU";
+ public static final String GENERAL_DEFAULTS_TEMPLATES_HANDY = GENERAL_DEFAULTS_TEMPLATES + ".handyBKU";
+ public static final String GENERAL_DEFAULTS_TEMPLATES_ONLINE = GENERAL_DEFAULTS_TEMPLATES + ".onlineBKU";
+
+ private static final String GENERAL_AUTH = "auth";
+ public static final String GENERAL_AUTH_CERTSTORE_URL = GENERAL_AUTH + ".certstore.url";
+ public static final String GENERAL_AUTH_TRUSTSTORE_URL = GENERAL_AUTH + ".truststore.url";
+ public static final String GENERAL_AUTH_REVOCATIONCHECKING = GENERAL_AUTH + ".revocationchecking";
+
+ public static final String GENERAL_AUTH_TIMEOUTS_TRANSACTION = GENERAL_AUTH + ".timeouts.transaction"; //Anmeldedaten
+ public static final String GENERAL_AUTH_TIMEOUS_SSO_CREATE = GENERAL_AUTH + ".timeouts.sso.create";
+ public static final String GENERAL_AUTH_TIMEOUS_SSO_UPDATE = GENERAL_AUTH + ".timeouts.sso.update";
+
+ public static final String GENERAL_AUTH_MOASP_TRUSTPROFILE_IDL_PROD = GENERAL_AUTH + ".moasp.trustprofile.idl.prod";
+ public static final String GENERAL_AUTH_MOASP_TRUSTPROFILE_IDL_TEST = GENERAL_AUTH + ".moasp.trustprofile.idl.test";
+ public static final String GENERAL_AUTH_MOASP_TRUSTPROFILE_AUTHBLOCK_PROD = GENERAL_AUTH + ".moasp.trustprofile.authblock.prod";
+ public static final String GENERAL_AUTH_MOASP_TRUSTPROFILE_AUTHBLOCK_TEST = GENERAL_AUTH + ".moasp.trustprofile.authblock.test";
+ public static final String GENERAL_AUTH_MOASP_AUTHBLOCK_TRANSFORM = GENERAL_AUTH + ".moasp.authblock.transform";
+ public static final String GENERAL_AUTH_MOASP_URL = GENERAL_AUTH + ".moasp.url";
+
+ public static final String GENERAL_AUTH_SERVICES_OVS_URL = GENERAL_AUTH + ".services.ovs.url";
+ public static final String GENERAL_AUTH_SERVICES_SZRGW_URL = GENERAL_AUTH + ".services.szrgw.url";
+
+
+ public static final String GENERAL_AUTH_SSO_SERVICENAME = GENERAL_AUTH + "." + SSO + ".servicename";
+ public static final String GENERAL_AUTH_SSO_TARGET = GENERAL_AUTH + "." + SSO + ".target";
+ public static final String GENERAL_AUTH_SSO_AUTHBLOCK_TEXT = GENERAL_AUTH + "." + SSO + ".authblock.text";
+
+ private static final String GENERAL_PROTOCOLS = PROTOCOLS;
+ private static final String GENERAL_PROTOCOLS_SAML1 = GENERAL_PROTOCOLS + "." + SAML1;
+ private static final String GENERAL_PROTOCOLS_PVP2X = GENERAL_PROTOCOLS + "." + PVP2X;
+ private static final String GENERAL_PROTOCOLS_OPENID = GENERAL_PROTOCOLS + "." + OPENID;
+ public static final String GENERAL_PROTOCOLS_SAML1_ENABLED = GENERAL_PROTOCOLS_SAML1 + ".enabled";
+ public static final String GENERAL_PROTOCOLS_SAML1_LEGACY = GENERAL_PROTOCOLS_SAML1 + ".legacy";
+ public static final String GENERAL_PROTOCOLS_SAML1_SOURCEID = GENERAL_PROTOCOLS_SAML1 + ".sourceID";
+ public static final String GENERAL_PROTOCOLS_OPENID_ENABLED = GENERAL_PROTOCOLS_OPENID + ".enabled";
+ public static final String GENERAL_PROTOCOLS_OPENID_LEGACY = GENERAL_PROTOCOLS_OPENID + ".legacy";
+
+ public static final String GENERAL_PROTOCOLS_PVP2X_ENABLED = GENERAL_PROTOCOLS_PVP2X + ".enabled";
+ public static final String GENERAL_PROTOCOLS_PVP2X_LEGACY = GENERAL_PROTOCOLS_PVP2X + ".legacy";
+ public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_SERVICENAMME = GENERAL_PROTOCOLS_PVP2X + ".metadata.servicename";
+ public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_ORG_SHORTNAME = GENERAL_PROTOCOLS_PVP2X + ".metadata.org.name.short";
+ public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_ORG_FULLNAME = GENERAL_PROTOCOLS_PVP2X + ".metadata.org.name.full";
+ public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_ORG_URL = GENERAL_PROTOCOLS_PVP2X + ".metadata.org.url";
+
+ public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_FAMLIYNAME = GENERAL_PROTOCOLS_PVP2X + ".metadata.contact.familyname";
+ public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_GIVENNAME = GENERAL_PROTOCOLS_PVP2X + ".metadata.contact.givenname";
+ public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_MAIL = GENERAL_PROTOCOLS_PVP2X + ".metadata.contact.mail";
+ public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_PHONE = GENERAL_PROTOCOLS_PVP2X + ".metadata.contact.phone";
+ public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_COMPANY = GENERAL_PROTOCOLS_PVP2X + ".metadata.contact.company";
+ public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_TYPE = GENERAL_PROTOCOLS_PVP2X + ".metadata.contact.type";
+
+ public static final String GENERAL_AUTH_AUTHBLOCK_TRANSFORMATION_NAME = GENERAL_AUTH + ".authblock.transformation.name";
+ public static final String GENERAL_AUTH_AUTHBLOCK_TRANSFORMATION_BASE64 = GENERAL_AUTH + ".authblock.transformation.base64";
+
+ public static final String GENERAL_AUTH_STORK = GENERAL_AUTH + "." + STORK;
+ public static final String GENERAL_AUTH_STORK_QAA = GENERAL_AUTH + "." + STORK + ".qaa";
+ public static final String GENERAL_AUTH_STORK_CPEPS_LIST = GENERAL_AUTH + "." + STORK + ".cpeps";
+ public static final String GENERAL_AUTH_STORK_CPEPS_LIST_COUNTRY = "countrycode";
+ public static final String GENERAL_AUTH_STORK_CPEPS_LIST_URL = "url";
+ public static final String GENERAL_AUTH_STORK_CPEPS_LIST_SUPPORT_XMLDSIG = "support.xmldsig";
+
+ public static final String GENERAL_AUTH_STORK_ATTRIBUTES_LIST = GENERAL_AUTH + "." + STORK + ".attributes";
+ public static final String GENERAL_AUTH_STORK_ATTRIBUTES_LIST_NAME = "friendlyname";
+ public static final String GENERAL_AUTH_STORK_ATTRIBUTES_LIST_MANDATORY = "mandatory";
+
+// // old!!!!!!!!!!! //
+// // keys for the object in the key-value database
+// public static final String ONLINE_APPLICATIONS_KEY = "OnlineApplications";
+// public static final String AUTH_COMPONENT_GENERAL_KEY = "AuthComponentGeneral";
+// public static final String CHAINING_MODES_KEY = "ChainingModes";
+// public static final String TRUSTED_CERTIFICATES_KEY = "TruestedCertificates";
+// public static final String DEFAULT_BKUS_KEY = "DefaultBKUs";
+// public static final String SLREQUEST_TEMPLATES_KEY = "SLRequestTemplates";
+// public static final String TIMESTAMP_ITEM_KEY = "TimestampItem";
+// public static final String PVP2REFRESH_ITEM_KEY = "Pvp2RefreshItem";
+// public static final String GENERIC_CONFIGURATION_KEY = "GenericConfiguration";
+//
+// /**
+// * Returns all relevant (database-) keys that {@link MOAIDConfiguration} contains.
+// * @return the keys as {@code String[]}
+// */
+// public static final String[] getMOAIDConfigurationKeys() {
+// return new String[] { AUTH_COMPONENT_GENERAL_KEY, CHAINING_MODES_KEY, TRUSTED_CERTIFICATES_KEY,
+// DEFAULT_BKUS_KEY, SLREQUEST_TEMPLATES_KEY, TIMESTAMP_ITEM_KEY, PVP2REFRESH_ITEM_KEY };
+// }
+//
+// /**
+// * Returns all (database-) keys that {@link MOAIDConfiguration} contains.
+// * @return the keys as {@code String[]}
+// */
+// public static final String[] getAllMOAIDConfigurationKeys() {
+// return new String[] { ONLINE_APPLICATIONS_KEY, AUTH_COMPONENT_GENERAL_KEY, CHAINING_MODES_KEY,
+// TRUSTED_CERTIFICATES_KEY, DEFAULT_BKUS_KEY, SLREQUEST_TEMPLATES_KEY, TIMESTAMP_ITEM_KEY,
+// PVP2REFRESH_ITEM_KEY };
+// }
+}
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/ConfigurationImpl.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/ConfigurationImpl.java
deleted file mode 100644
index c90b60440..000000000
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/ConfigurationImpl.java
+++ /dev/null
@@ -1,161 +0,0 @@
-package at.gv.egovernment.moa.id.commons.config.persistence;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.persistence.EntityExistsException;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Required;
-import org.springframework.stereotype.Component;
-
-import at.gv.egovernment.moa.id.commons.db.dao.config.ConfigProperty;
-import at.gv.egovernment.moa.id.commons.db.dao.config.ConfigPropertyDao;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.JsonMappingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.type.CollectionType;
-import com.fasterxml.jackson.databind.type.TypeFactory;
-
-/**
- * The implementation of a key-value configuration implementing the {@link Configuration} interface.
- * It employs the {@link ConfigPropertyDao} to persist configuration data.
- */
-@Component
-public class ConfigurationImpl implements Configuration {
-
- private final Logger log = LoggerFactory.getLogger(getClass());
-
- ConfigPropertyDao configPropertyDao;
- private JsonMapper mapper = new JsonMapper();
-
- /**
- * Sets the {@link ConfigPropertyDao}.
- * @param configPropertyDao the ConfigPropertyDao
- */
- @Required
- public void setConfigPropertyDao(ConfigPropertyDao configPropertyDao) {
- this.configPropertyDao = configPropertyDao;
- }
-
- @Override
- public List<String> getAllKeys(){
- try {
- return this.configPropertyDao.getAllKeys();
- } catch (Exception e) {
- log.debug("Error while retrieving a list of all keys in the database.");
- return null;
- }
- }
-
- @Override
- public Object get(String key) {
- // return null if key does not exist
- try {
- ConfigProperty property = configPropertyDao.getProperty(key);
- if (property != null && property.getValue() != null) {
- return mapper.deserialize(property.getValue(), null);
- } else {
- return null;
- }
- } catch (IllegalArgumentException e) {
- log.debug("Error while searching for key '{}' in the database.", key);
- return null;
- } catch (Exception e) {
- log.debug("Error while deserializing value of key '{}' to object.", key);
- return null;
- }
- }
-
- @Override
- public <T> T get(String key, Class<T> clazz) {
- // return null if key does not exist
- try {
- ConfigProperty property = configPropertyDao.getProperty(key);
- if (property != null && property.getValue() != null) {
- return clazz.cast(mapper.deserialize(property.getValue(), clazz));
- } else {
- return null;
- }
- } catch (IllegalArgumentException e) {
- log.debug("Error while searching for key '{}' in the database.", key);
- return null;
- } catch (Exception e) {
- log.debug("Error while deserializing value of key '{}' to object of type {}.", key, clazz.getClass());
- return null;
- }
- }
-
- @Override
- public boolean set(String key, Object value) {
-
- try {
- if (value == null) {
- configPropertyDao.delete(key);
- return true;
- } else {
-
- ConfigProperty keyValue = new ConfigProperty();
- keyValue.setKey(key);
-
- keyValue.setValue(mapper.serialize(value));
- configPropertyDao.saveProperty(keyValue);
- return true;
- }
- } catch (JsonProcessingException e) {
- log.debug("Error while serializing object for key '{}'.", key);
- return false;
- } catch (EntityExistsException e) {
- log.debug("Property '{}' already exists!", key);
- return false;
- } catch (Exception e) {
- log.debug("Error while setting value for key '{}' in the database.", key);
- return false;
- }
- }
-
- @Override
- public <T> T get(String key, Class<T> clazz, Object defaultValue) {
-
- T value = get(key, clazz);
- if (value != null) {
- return value;
- } else {
- return clazz.cast(defaultValue);
- }
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public <T> List<T> getList(String key, Class<T> clazz) {
-
- CollectionType listType = TypeFactory.defaultInstance().constructCollectionType(List.class, clazz);
- try {
- if ((configPropertyDao.getProperty(key) == null)
- || (configPropertyDao.getProperty(key).getValue() == null)) {
- return new ArrayList<T>();
- }
- String json = configPropertyDao.getProperty(key).getValue();
- ObjectMapper mapper = new ObjectMapper();
-
- return (List<T>) mapper.readValue(json, listType);
- } catch (JsonMappingException e) {
- ArrayList<T> tmp = new ArrayList<T>();
- T value = get(key, clazz);
- if (value != null) {
- tmp.add(value);
- }
- return tmp;
- } catch (IOException e) {
- log.debug("Error while deserializing value for key '{}' to List<{}>.", key, clazz.getClass());
- return new ArrayList<T>();
- } catch (Exception e){
- log.debug("Error while searching key '{}' in the database.", key);
- return new ArrayList<T>();
- }
- }
-
-}
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/Configuration.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfiguration.java
index f357fc570..45f37ef97 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/Configuration.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfiguration.java
@@ -2,10 +2,12 @@ package at.gv.egovernment.moa.id.commons.config.persistence;
import java.util.List;
+import at.gv.egiz.components.configuration.api.Configuration;
+
/**
* An interface for a key-value configuration.
*/
-public interface Configuration {
+public interface MOAIDConfiguration {
/**
* Gets all keys in the database. NOTE: may return an empty list or {@code null}.
@@ -16,9 +18,9 @@ public interface Configuration {
/**
* Get the value associated with the given key as {@link Object}.
* @param key the key
- * @return the object associated with the given key or {@code null} if the key does not exist or does not have a value.
+ * @return the String associated with the given key or {@code null} if the key does not exist or does not have a value.
*/
- Object get(String key);
+ String get(String key);
/**
* Get the object of type {@code T} associated with the given key.
@@ -33,28 +35,28 @@ public interface Configuration {
* Store an object associated with a key. If the given object is set to {@code null} then the entry associated with the key is deleted.
*
* @param key the key under which the value is stored, respectively key determining the entry to be deleted.
- * @param value the object to store. if value is set to {@code null} then the entry associated with key {@code key} is deleted.
+ * @param value the String to store. if value is set to {@code null} then the entry associated with key {@code key} is deleted.
* @return {@code true} if the operation was carried out successfully, {@code false} otherwise.
*/
- boolean set(String key, Object value);
-
- /**
- * Get the object of type {@code T} associated with the given key from the database. If the key does not exist or does not have a value, the given default
- * value is returned.
- *
- * @param key the key
- * @param clazz the type of the requested object
- * @param defaultValue the default value to return
- * @return the object associated with the given key or {@code defaultValue} if the key does not exist or does not have a value.
- */
- <T> T get(String key, Class<T> clazz, Object defaultValue);
-
- /**
- * Get a list of objects associated with the given key. The list may be empty or contain only a single object.
- * @param key the key
- * @param clazz the type of the requested object
- * @return a list containing objects of type {@code T} or an empty list if no objects are associated with the key.
- */
- <T> List<T> getList(String key, Class<T> clazz);
+ boolean set(String key, String value);
+//
+// /**
+// * Get the object of type {@code T} associated with the given key from the database. If the key does not exist or does not have a value, the given default
+// * value is returned.
+// *
+// * @param key the key
+// * @param clazz the type of the requested object
+// * @param defaultValue the default value to return
+// * @return the object associated with the given key or {@code defaultValue} if the key does not exist or does not have a value.
+// */
+// <T> T get(String key, Class<T> clazz, Object defaultValue);
+//
+// /**
+// * Get a list of objects associated with the given key. The list may be empty or contain only a single object.
+// * @param key the key
+// * @param clazz the type of the requested object
+// * @return a list containing objects of type {@code T} or an empty list if no objects are associated with the key.
+// */
+// <T> List<T> getList(String key, Class<T> clazz);
} \ No newline at end of file
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfigurationImpl.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfigurationImpl.java
new file mode 100644
index 000000000..10ed19f83
--- /dev/null
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfigurationImpl.java
@@ -0,0 +1,136 @@
+package at.gv.egovernment.moa.id.commons.config.persistence;
+
+import java.util.Arrays;
+import java.util.List;
+
+import javax.persistence.EntityExistsException;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Required;
+import org.springframework.stereotype.Component;
+
+import at.gv.egiz.components.configuration.api.Configuration;
+
+/**
+ * The implementation of a key-value configuration implementing the {@link Configuration} interface.
+ * It employs the {@link ConfigPropertyDao} to persist configuration data.
+ */
+@Component
+public class MOAIDConfigurationImpl implements MOAIDConfiguration {
+
+ private final Logger log = LoggerFactory.getLogger(getClass());
+
+ Configuration configPropertyDao;
+// private JsonMapper mapper = new JsonMapper();
+
+ /**
+ * Sets the {@link ConfigPropertyDao}.
+ * @param configPropertyDao the ConfigPropertyDao
+ */
+ @Required
+ public void setConfigPropertyDao(Configuration configPropertyDao) {
+ this.configPropertyDao = configPropertyDao;
+ }
+
+ @Override
+ public List<String> getAllKeys(){
+ try {
+ return Arrays.asList(this.configPropertyDao.getConfigurationIds());
+ } catch (Exception e) {
+ log.debug("Error while retrieving a list of all keys in the database.");
+ return null;
+ }
+ }
+
+ @Override
+ public String get(String key) {
+ // return null if key does not exist
+ try {
+ return configPropertyDao.getStringValue(key);
+
+ } catch (Exception e) {
+ log.debug("Error while searching value of key '{}' to object.", key);
+ return null;
+ }
+ }
+
+ @Override
+ public <T> T get(String key, Class<T> clazz) {
+ // return null if key does not exist
+ try {
+ T property = configPropertyDao.getObjectValue(key, clazz);
+ return property;
+
+ } catch (IllegalArgumentException e) {
+ log.debug("Error while searching for key '{}' in the database.", key);
+ return null;
+ } catch (Exception e) {
+ log.debug("Error while deserializing value of key '{}' to object of type {}.", key, clazz.getClass());
+ return null;
+ }
+ }
+
+ @Override
+ public boolean set(String key, String value) {
+
+ try {
+ //TODO: add delete
+ if (value == null) {
+ //configPropertyDao.delete(key);
+ return true;
+ } else {
+ configPropertyDao.setStringValue(key, value);
+ return true;
+ }
+ } catch (EntityExistsException e) {
+ log.debug("Property '{}' already exists!", key);
+ return false;
+ } catch (Exception e) {
+ log.debug("Error while setting value for key '{}' in the database.", key);
+ return false;
+ }
+ }
+
+// @Override
+// public <T> T get(String key, Class<T> clazz, Object defaultValue) {
+//
+// T value = get(key, clazz);
+// if (value != null) {
+// return value;
+// } else {
+// return clazz.cast(defaultValue);
+// }
+// }
+//
+// @SuppressWarnings("unchecked")
+// @Override
+// public <T> List<T> getList(String key, Class<T> clazz) {
+//
+// CollectionType listType = TypeFactory.defaultInstance().constructCollectionType(List.class, clazz);
+// try {
+// if ((configPropertyDao.getProperty(key) == null)
+// || (configPropertyDao.getProperty(key).getValue() == null)) {
+// return new ArrayList<T>();
+// }
+// String json = configPropertyDao.getProperty(key).getValue();
+// ObjectMapper mapper = new ObjectMapper();
+//
+// return (List<T>) mapper.readValue(json, listType);
+// } catch (JsonMappingException e) {
+// ArrayList<T> tmp = new ArrayList<T>();
+// T value = get(key, clazz);
+// if (value != null) {
+// tmp.add(value);
+// }
+// return tmp;
+// } catch (IOException e) {
+// log.debug("Error while deserializing value for key '{}' to List<{}>.", key, clazz.getClass());
+// return new ArrayList<T>();
+// } catch (Exception e){
+// log.debug("Error while searching key '{}' in the database.", key);
+// return new ArrayList<T>();
+// }
+// }
+
+}