diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2016-10-21 10:13:42 +0200 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2016-11-03 10:45:37 +0100 |
commit | 0b513625b19ba63e5c23b60fbb505cd4a7c232ab (patch) | |
tree | 3d0b305cc976f745f3e6da5c79de943d2e4fa9c3 /id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralMOAIDConfig.java | |
parent | 3ca1a273b2ebc279ec3ad94d9ed38d0b39477679 (diff) | |
download | moa-id-spss-0b513625b19ba63e5c23b60fbb505cd4a7c232ab.tar.gz moa-id-spss-0b513625b19ba63e5c23b60fbb505cd4a7c232ab.tar.bz2 moa-id-spss-0b513625b19ba63e5c23b60fbb505cd4a7c232ab.zip |
update ConfigTool to support more than one ELGA mandate-service
Diffstat (limited to 'id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralMOAIDConfig.java')
-rw-r--r-- | id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralMOAIDConfig.java | 84 |
1 files changed, 79 insertions, 5 deletions
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralMOAIDConfig.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralMOAIDConfig.java index ebd2d6283..86ac6f779 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralMOAIDConfig.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralMOAIDConfig.java @@ -68,7 +68,6 @@ public class GeneralMOAIDConfig { public static final String LINE_DELIMITER = ";"; - private String szrgwURL = null; private String alternativeSourceID = null; private String certStoreDirectory = null; private boolean trustmanagerrevocationcheck = true; @@ -87,6 +86,8 @@ public class GeneralMOAIDConfig { private String moaspssAuthTrustProfileTest = null; private String mandateURL = null; + private String szrgwURL = null; + private String elgaMandateServiceURL = null; private boolean protocolActiveSAML1 = false; private boolean protocolActivePVP21 = true; @@ -163,13 +164,47 @@ public class GeneralMOAIDConfig { if (config != null) { AuthComponentGeneral auth = config.getAuthComponentGeneral(); + //get ELGA mandate service URLs from configuration + if (MiscUtil.isNotEmpty(config.getElgaMandateServiceURLs())) { + if (KeyValueUtils.isCSVValueString(config.getElgaMandateServiceURLs())) + elgaMandateServiceURL = KeyValueUtils.normalizeCSVValueString(config.getElgaMandateServiceURLs()); + + else { + if (config.getElgaMandateServiceURLs().contains(KeyValueUtils.CSV_DELIMITER)) { + //remove trailing comma if exist + elgaMandateServiceURL = config.getElgaMandateServiceURLs().substring(0, + config.getElgaMandateServiceURLs().indexOf(KeyValueUtils.CSV_DELIMITER)); + + } else + elgaMandateServiceURL = config.getElgaMandateServiceURLs(); + + } + } + + + if (auth != null) { ForeignIdentities foreign = auth.getForeignIdentities(); if (foreign != null) { ConnectionParameterClientAuthType connect_foreign = foreign.getConnectionParameter(); if (connect_foreign != null) { - szrgwURL = connect_foreign.getURL(); + if (MiscUtil.isNotEmpty(connect_foreign.getURL())) { + if (KeyValueUtils.isCSVValueString(connect_foreign.getURL())) + szrgwURL = KeyValueUtils.normalizeCSVValueString(connect_foreign.getURL()); + + else { + if (connect_foreign.getURL().contains(KeyValueUtils.CSV_DELIMITER)) { + //remove trailing comma if exist + szrgwURL = connect_foreign.getURL().substring(0, + connect_foreign.getURL().indexOf(KeyValueUtils.CSV_DELIMITER)); + + } else + szrgwURL = connect_foreign.getURL(); + + } + + } } STORK stork = foreign.getSTORK(); @@ -251,7 +286,23 @@ public class GeneralMOAIDConfig { if (mandates != null) { ConnectionParameterClientAuthType con = mandates.getConnectionParameter(); if (con != null) { - mandateURL = con.getURL(); + if (MiscUtil.isNotEmpty(con.getURL())) { + if (KeyValueUtils.isCSVValueString(con.getURL())) + mandateURL = KeyValueUtils.normalizeCSVValueString(con.getURL()); + + else { + if (con.getURL().contains(KeyValueUtils.CSV_DELIMITER)) { + //remove trailing comma if exist + mandateURL = con.getURL().substring(0, + con.getURL().indexOf(KeyValueUtils.CSV_DELIMITER)); + + } else + mandateURL = con.getURL(); + + } + + } + } } @@ -392,7 +443,10 @@ public class GeneralMOAIDConfig { * @param szrgwURL the szrgwURL to set */ public void setSzrgwURL(String szrgwURL) { - this.szrgwURL = szrgwURL; + if (MiscUtil.isNotEmpty(szrgwURL)) + this.szrgwURL = KeyValueUtils.removeAllNewlineFromString(szrgwURL); + else + this.szrgwURL = szrgwURL; } /** @@ -518,7 +572,10 @@ public class GeneralMOAIDConfig { * @param mandateURL the mandateURL to set */ public void setMandateURL(String mandateURL) { - this.mandateURL = mandateURL; + if (MiscUtil.isNotEmpty(mandateURL)) + this.mandateURL = KeyValueUtils.removeAllNewlineFromString(mandateURL); + else + this.mandateURL = mandateURL; } /** @@ -1024,6 +1081,23 @@ public class GeneralMOAIDConfig { boolean virtualPublicURLPrefixEnabled) { this.virtualPublicURLPrefixEnabled = virtualPublicURLPrefixEnabled; } + + /** + * @return the elgaMandateServiceURL + */ + public String getElgaMandateServiceURL() { + return elgaMandateServiceURL; + } + + /** + * @param elgaMandateServiceURL the elgaMandateServiceURL to set + */ + public void setElgaMandateServiceURL(String elgaMandateServiceURL) { + if (MiscUtil.isNotEmpty(elgaMandateServiceURL)) + this.elgaMandateServiceURL = KeyValueUtils.removeAllNewlineFromString(elgaMandateServiceURL); + else + this.elgaMandateServiceURL = elgaMandateServiceURL; + } |