aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2015-11-16 15:24:18 +0100
committerThomas Lenz <tlenz@iaik.tugraz.at>2015-11-16 15:24:18 +0100
commitcd65ea06223d596e817e63167e91a94b05e35be4 (patch)
tree453357793f6b06f937e615b725d34eea5be89ef8
parent65e35acfc2c548a14f4bf33bbc106b3754752272 (diff)
downloadmoa-id-spss-cd65ea06223d596e817e63167e91a94b05e35be4.tar.gz
moa-id-spss-cd65ea06223d596e817e63167e91a94b05e35be4.tar.bz2
moa-id-spss-cd65ea06223d596e817e63167e91a94b05e35be4.zip
fix possible NullPointerException with STORK configuration
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java40
1 files changed, 24 insertions, 16 deletions
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java
index d99f826b6..c175253af 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java
@@ -738,6 +738,7 @@ public class ConfigurationMigrationUtils {
}
dbOA.setIsActive(Boolean.valueOf(oa.get(MOAIDConfigurationConstants.SERVICE_ISACTIVE)));
+ dbOA.setIsAdminRequired(false);
dbOA.setPublicURLPrefix(oa.get(MOAIDConfigurationConstants.SERVICE_UNIQUEIDENTIFIER));
dbOA.setFriendlyName(oa.get(MOAIDConfigurationConstants.SERVICE_FRIENDLYNAME));
@@ -1679,35 +1680,42 @@ public class ConfigurationMigrationUtils {
String index = KeyValueUtils.getFirstChildAfterPrefix(key, MOAIDConfigurationConstants.GENERAL_AUTH_STORK_ATTRIBUTES_LIST);
if (!attrMap.containsKey(index)) {
StorkAttribute attr = new StorkAttribute();
- attr.setName(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_ATTRIBUTES_LIST
+ String attrName = moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_ATTRIBUTES_LIST
+ "." + index + "."
- + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_ATTRIBUTES_LIST_NAME));
- attr.setMandatory(Boolean.parseBoolean(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_ATTRIBUTES_LIST
- + "." + index + "."
- + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_ATTRIBUTES_LIST_MANDATORY)));
- attr.setHjid(Long.valueOf(index));
- attrMap.put(index, attr);
+ + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_ATTRIBUTES_LIST_NAME);
+ if (MiscUtil.isNotEmpty(attrName)) {
+ attr.setName(attrName);
+ attr.setMandatory(Boolean.parseBoolean(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_ATTRIBUTES_LIST
+ + "." + index + "."
+ + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_ATTRIBUTES_LIST_MANDATORY)));
+ attr.setHjid(Long.valueOf(index));
+ attrMap.put(index, attr);
+ }
}
} else if (key.startsWith(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST)) {
String index = KeyValueUtils.getFirstChildAfterPrefix(key, MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST);
if (!cpepsMap.containsKey(index)) {
CPEPS attr = new CPEPS();
- attr.setCountryCode(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST
- + "." + index + "."
- + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST_COUNTRY));
-
- attr.setURL(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST
+
+ String countryCode = moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST
+ "." + index + "."
- + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST_URL));
+ + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST_COUNTRY);
- attr.setSupportsXMLSignature(Boolean.parseBoolean(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST
+ String pepsURL = moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST
+ "." + index + "."
- + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST_SUPPORT_XMLDSIG)));
+ + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST_URL);
- attr.setHjid(Long.valueOf(index));
+ if (MiscUtil.isNotEmpty(countryCode) && MiscUtil.isNotEmpty(pepsURL)) {
+ attr.setCountryCode(countryCode);
+ attr.setURL(pepsURL);
+ attr.setSupportsXMLSignature(Boolean.parseBoolean(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST
+ + "." + index + "."
+ + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST_SUPPORT_XMLDSIG)));
+ attr.setHjid(Long.valueOf(index));
cpepsMap.put(index, attr);
+ }
}
}