diff options
-rw-r--r-- | id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java | 60 |
1 files changed, 33 insertions, 27 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 c175253af..c53aeff3f 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 @@ -1395,41 +1395,46 @@ public class ConfigurationMigrationUtils { // to foreclose lazyloading session timeouts if (stork.getCPEPS() != null) { for (int i=0; i<stork.getCPEPS().size(); i++) { - result.put(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST - + "." + String.valueOf(i) + "." - + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST_COUNTRY, - stork.getCPEPS().get(i).getCountryCode()); - result.put(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST - + "." + String.valueOf(i) + "." - + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST_URL, - stork.getCPEPS().get(i).getURL()); - result.put(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST - + "." + String.valueOf(i) + "." - + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST_SUPPORT_XMLDSIG, - String.valueOf(stork.getCPEPS().get(i).isSupportsXMLSignature())); + if( !(stork.getCPEPS().get(i).getURL() == null || + MiscUtil.isEmpty(stork.getCPEPS().get(i).getCountryCode()) || + stork.getCPEPS().get(i).getURL().endsWith("http://")) ) { + result.put(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST + + "." + String.valueOf(i) + "." + + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST_COUNTRY, + stork.getCPEPS().get(i).getCountryCode()); + result.put(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST + + "." + String.valueOf(i) + "." + + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST_URL, + stork.getCPEPS().get(i).getURL()); + result.put(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST + + "." + String.valueOf(i) + "." + + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST_SUPPORT_XMLDSIG, + String.valueOf(stork.getCPEPS().get(i).isSupportsXMLSignature())); + } } } List<StorkAttribute> tmp = stork.getAttributes(); - if(null != tmp) { + if(null != tmp && tmp.size() > 0) { for (int i=0; i<tmp.size(); i++) { - result.put(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_ATTRIBUTES_LIST - + "." + String.valueOf(i) + "." - + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_ATTRIBUTES_LIST_NAME, - tmp.get(i).getName()); - - if (tmp.get(i).isMandatory() != null) - result.put(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_ATTRIBUTES_LIST - + "." + String.valueOf(i) + "." - + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_ATTRIBUTES_LIST_MANDATORY, - tmp.get(i).isMandatory().toString()); - else + if (MiscUtil.isNotEmpty(tmp.get(i).getName())) { result.put(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_ATTRIBUTES_LIST + "." + String.valueOf(i) + "." - + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_ATTRIBUTES_LIST_MANDATORY, - Boolean.FALSE.toString()); + + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_ATTRIBUTES_LIST_NAME, + tmp.get(i).getName()); + if (tmp.get(i).isMandatory() != null) + result.put(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_ATTRIBUTES_LIST + + "." + String.valueOf(i) + "." + + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_ATTRIBUTES_LIST_MANDATORY, + tmp.get(i).isMandatory().toString()); + else + result.put(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_ATTRIBUTES_LIST + + "." + String.valueOf(i) + "." + + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_ATTRIBUTES_LIST_MANDATORY, + Boolean.FALSE.toString()); + } } } @@ -1706,7 +1711,8 @@ public class ConfigurationMigrationUtils { + "." + index + "." + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST_URL); - if (MiscUtil.isNotEmpty(countryCode) && MiscUtil.isNotEmpty(pepsURL)) { + if (MiscUtil.isNotEmpty(countryCode) && MiscUtil.isNotEmpty(pepsURL) && + !pepsURL.endsWith("http://")) { attr.setCountryCode(countryCode); attr.setURL(pepsURL); attr.setSupportsXMLSignature(Boolean.parseBoolean(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST |