aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Marsalek <amarsalek@iaik.tugraz.at>2015-01-29 16:30:36 +0100
committerAlexander Marsalek <amarsalek@iaik.tugraz.at>2015-01-29 16:30:36 +0100
commit0fbc9476dfb70a1c542ba3491a329f6286fe949e (patch)
treedb00451eeca47b950c837de8d4910a3cd8fe3256
parenta34e3cc5ca505149d8de588de8d8a19b9a962845 (diff)
downloadmoa-id-spss-0fbc9476dfb70a1c542ba3491a329f6286fe949e.tar.gz
moa-id-spss-0fbc9476dfb70a1c542ba3491a329f6286fe949e.tar.bz2
moa-id-spss-0fbc9476dfb70a1c542ba3491a329f6286fe949e.zip
PEPSConnectorServlet: load document service url from moa properties instead of included included resource file
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java23
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java8
2 files changed, 24 insertions, 7 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java
index 4c587a5f6..e57bc0f8a 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java
@@ -58,6 +58,7 @@ import at.gv.egovernment.moa.id.auth.exception.MOAIDException;
import at.gv.egovernment.moa.id.auth.stork.STORKException;
import at.gv.egovernment.moa.id.auth.stork.STORKResponseProcessor;
import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils;
+import at.gv.egovernment.moa.id.config.ConfigurationException;
import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider;
import at.gv.egovernment.moa.id.config.auth.OAAuthParameter;
import at.gv.egovernment.moa.id.moduls.ModulUtils;
@@ -110,15 +111,25 @@ public class PEPSConnectorServlet extends AuthServlet {
public PEPSConnectorServlet()
{
super();
- Properties props = new Properties();
+
try {
- props.load(DatabaseConnectorMySQLImpl.class.getResourceAsStream("docservice.properties"));
- dtlUrl = props.getProperty("docservice.url");
- } catch (IOException e) {
+ AuthConfigurationProvider authConfigurationProvider = AuthConfigurationProvider.getInstance();
+ dtlUrl = authConfigurationProvider.getDocumentServiceUrl();
+ } catch (Exception e) {
dtlUrl = "http://testvidp.buergerkarte.at/DocumentService/DocumentService";
- Logger.error("Loading DTL config failed, using default value:"+dtlUrl);
e.printStackTrace();
- }
+ Logger.error("Loading documentservice url failed, using default value:"+dtlUrl);
+ }
+
+// Properties props = new Properties();
+// try {
+// props.load(DatabaseConnectorMySQLImpl.class.getResourceAsStream("docservice.properties"));
+// dtlUrl = props.getProperty("docservice.url");
+// } catch (IOException e) {
+// dtlUrl = "http://testvidp.buergerkarte.at/DocumentService/DocumentService";
+// Logger.error("Loading DTL config failed, using default value:"+dtlUrl);
+// e.printStackTrace();
+// }
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java
index 23369fecc..89d02c183 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java
@@ -1047,8 +1047,14 @@ public class AuthConfigurationProvider extends ConfigurationProvider {
return !Boolean.valueOf(prop);
}
+ //Load document service url from moa properties
+ public String getDocumentServiceUrl() {
+ String prop = props.getProperty("stork.documentservice.url", "false");
+ return prop;
+ }
+
/**
- * Retruns the STORK Configuration
+ * Returns the STORK Configuration
* @return STORK Configuration
* @throws ConfigurationException
*/