aboutsummaryrefslogtreecommitdiff
path: root/id
diff options
context:
space:
mode:
authorFlorian Reimair <florian.reimair@iaik.tugraz.at>2014-02-13 20:24:46 +0100
committerFlorian Reimair <florian.reimair@iaik.tugraz.at>2014-02-13 22:06:02 +0100
commitde54a0683a626679df1c110253c8b5ff986ecb71 (patch)
treed1204caf49c6304346fd39d11106c1fc995c96bc /id
parentd3099d4ec685e68c25a9198760f8d1661678a85f (diff)
downloadmoa-id-spss-de54a0683a626679df1c110253c8b5ff986ecb71.tar.gz
moa-id-spss-de54a0683a626679df1c110253c8b5ff986ecb71.tar.bz2
moa-id-spss-de54a0683a626679df1c110253c8b5ff986ecb71.zip
added http request and responses to attributeprovider methods
Diffstat (limited to 'id')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java6
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProvider.java9
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/DemoNoRedirectAttributeProvider.java3
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/DemoRedirectAttributeProvider.java3
4 files changed, 14 insertions, 7 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java
index 91b09795f..810b4ae7a 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java
@@ -86,7 +86,7 @@ public class AttributeCollector implements IAction {
container.getResponse().getPersonalAttributeList().add(newAttribute);
// see if we need some more attributes
- return processRequest(container);
+ return processRequest(container, httpResp);
}
/**
@@ -97,7 +97,7 @@ public class AttributeCollector implements IAction {
* @return the string
* @throws MOAIDException
*/
- public String processRequest(DataContainer container) throws MOAIDException {
+ public String processRequest(DataContainer container, HttpServletResponse response) throws MOAIDException {
// check if there are attributes we need to fetch
IPersonalAttributeList requestAttributeList = container.getRequest().getPersonalAttributeList();
IPersonalAttributeList responseAttributeList = container.getResponse().getPersonalAttributeList();
@@ -135,7 +135,7 @@ public class AttributeCollector implements IAction {
AssertionStorage.getInstance().put(newArtifactId, container);
// add container-key to redirect embedded within the return URL
- e.getAp().performRedirect(returnUrl + "?" + ARTIFACT_ID + "=" + newArtifactId);
+ e.getAp().performRedirect(returnUrl + "?" + ARTIFACT_ID + "=" + newArtifactId, response);
} catch (Exception e1) {
// TODO should we return the response as is to the PEPS?
Logger.error("Error putting incomplete Stork response into temporary storage", e);
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProvider.java
index c554485ee..5ca3bd7e1 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProvider.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProvider.java
@@ -1,6 +1,9 @@
package at.gv.egovernment.moa.id.protocols.stork2;
import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import at.gv.egovernment.moa.id.auth.exception.MOAIDException;
import eu.stork.peps.auth.commons.PersonalAttribute;
@@ -26,8 +29,9 @@ public interface AttributeProvider {
* Perform redirect.
*
* @param url the return URL ending with ?artifactId=...
+ * @param resp the response to the preceding request
*/
- public void performRedirect(String url);
+ public void performRedirect(String url, HttpServletResponse resp);
/**
* Parses the response we got from the external attribute provider.
@@ -35,7 +39,8 @@ public interface AttributeProvider {
* @param httpReq the http req
* @return the personal attribute
* @throws UnsupportedAttributeException if the provider cannot find anything familiar in the provided httpReq
+ * @throws MOAIDException if something went wrong
*/
- public PersonalAttribute parse(HttpServletRequest httpReq) throws UnsupportedAttributeException;
+ public PersonalAttribute parse(HttpServletRequest httpReq) throws UnsupportedAttributeException, MOAIDException;
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/DemoNoRedirectAttributeProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/DemoNoRedirectAttributeProvider.java
index 978fa635c..51663ed38 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/DemoNoRedirectAttributeProvider.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/DemoNoRedirectAttributeProvider.java
@@ -3,6 +3,7 @@ package at.gv.egovernment.moa.id.protocols.stork2;
import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import eu.stork.peps.auth.commons.PersonalAttribute;
@@ -30,7 +31,7 @@ public class DemoNoRedirectAttributeProvider implements AttributeProvider {
}
@Override
- public void performRedirect(String url) {
+ public void performRedirect(String url, HttpServletResponse response) {
// we should not get here
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/DemoRedirectAttributeProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/DemoRedirectAttributeProvider.java
index 13b113711..fad049763 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/DemoRedirectAttributeProvider.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/DemoRedirectAttributeProvider.java
@@ -3,6 +3,7 @@ package at.gv.egovernment.moa.id.protocols.stork2;
import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import eu.stork.peps.auth.commons.PersonalAttribute;
@@ -32,7 +33,7 @@ public class DemoRedirectAttributeProvider implements AttributeProvider {
* @see at.gv.egovernment.moa.id.protocols.stork2.AttributeProvider#performRedirect(java.lang.String)
*/
@Override
- public void performRedirect(String url) {
+ public void performRedirect(String url, HttpServletResponse response) {
// TODO Auto-generated method stub
}