aboutsummaryrefslogtreecommitdiff
path: root/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralMOAIDConfig.java
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2016-10-21 10:13:42 +0200
committerThomas Lenz <tlenz@iaik.tugraz.at>2016-10-21 10:13:42 +0200
commit87be1b91493b0b5f4a03f049dfa99f7ba3c6f35e (patch)
treec0d13564029955028694eb7924c7ea37b164ce92 /id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralMOAIDConfig.java
parentf4bc3a6fb1c1b9b07b74e2254d6acb71985d8c39 (diff)
downloadmoa-id-spss-87be1b91493b0b5f4a03f049dfa99f7ba3c6f35e.tar.gz
moa-id-spss-87be1b91493b0b5f4a03f049dfa99f7ba3c6f35e.tar.bz2
moa-id-spss-87be1b91493b0b5f4a03f049dfa99f7ba3c6f35e.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.java84
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;
+ }