aboutsummaryrefslogtreecommitdiff
path: root/id/server
diff options
context:
space:
mode:
authorBojan Suzic <bojan.suzic@iaik.tugraz.at>2014-03-05 21:56:33 +0100
committerBojan Suzic <bojan.suzic@iaik.tugraz.at>2014-03-05 21:56:33 +0100
commit97ac38abf8d7fcea628ed1e7bd343c3d4ea958f9 (patch)
tree17015ca28a72649390ad2fdb2d02e862514b0fab /id/server
parentb757096ff32fa80908527220f8e08046015c2449 (diff)
downloadmoa-id-spss-97ac38abf8d7fcea628ed1e7bd343c3d4ea958f9.tar.gz
moa-id-spss-97ac38abf8d7fcea628ed1e7bd343c3d4ea958f9.tar.bz2
moa-id-spss-97ac38abf8d7fcea628ed1e7bd343c3d4ea958f9.zip
merge fr ap
Diffstat (limited to 'id/server')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProviderFactory.java95
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/EHvdAttributeProviderPlugin.java3
2 files changed, 46 insertions, 52 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProviderFactory.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProviderFactory.java
index dbeaf94e9..d046e12a4 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProviderFactory.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProviderFactory.java
@@ -1,24 +1,24 @@
package at.gv.egovernment.moa.id.protocols.stork2;
+import at.gv.egovernment.moa.id.commons.db.dao.config.AttributeProviderPlugin;
+
import java.util.ArrayList;
import java.util.List;
-import at.gv.egovernment.moa.id.commons.db.dao.config.AttributeProviderPlugin;
-
/**
* A factory for creating AttributeProvider objects.
*/
public class AttributeProviderFactory {
- /**
- * Gets the available plugins.
- *
- * @return the available plugins
- */
- public static List<String> getAvailablePlugins() {
- List<String> result = new ArrayList<String>();
- result.add("StorkAttributeRequestProvider");
- result.add("EHvdAttributeProvider");
+ /**
+ * Gets the available plugins.
+ *
+ * @return the available plugins
+ */
+ public static List<String> getAvailablePlugins() {
+ List<String> result = new ArrayList<String>();
+ result.add("StorkAttributeRequestProvider");
+ result.add("EHvdAttributeProvider");
result.add("SignedDocAttributeRequestProvider");
result.add("MISAttributeProvider");
@@ -26,43 +26,40 @@ public class AttributeProviderFactory {
return result;
}
- /**
- * Creates an AttributeProvider object for the given shortname. Returns
- * {@code null} if there is no such provider available.
- *
- * @param shortname
- * the simpleName for the providers class
- * @return the attribute provider
- */
- public static AttributeProvider create(String shortname, String url, String attributes) {
- if (shortname.equals("StorkAttributeRequestProvider")) {
- return new StorkAttributeRequestProvider(url, attributes);
- } else if(shortname.equals("EHvdAttributeProvider")) {
- return new EHvdAttributeProviderPlugin(url);
- } else if(shortname.equals("SignedDocAttributeRequestProvider")) {
- return new SignedDocAttributeRequestProvider(url);
- } else if (shortname.equals("MISAttributeProvider")) {
- return new MISAttributeProvider(url);
- } else {
- return new EHvdAttributeProviderPlugin(url, attributes);
- } else {
- return null;
- }
- }
+ /**
+ * Creates an AttributeProvider object for the given shortname. Returns
+ * {@code null} if there is no such provider available.
+ *
+ * @param shortname the simpleName for the providers class
+ * @return the attribute provider
+ */
+ public static AttributeProvider create(String shortname, String url, String attributes) {
+ if (shortname.equals("StorkAttributeRequestProvider")) {
+ return new StorkAttributeRequestProvider(url, attributes);
+ } else if (shortname.equals("EHvdAttributeProvider")) {
+ return new EHvdAttributeProviderPlugin(url, attributes);
+ } else if (shortname.equals("SignedDocAttributeRequestProvider")) {
+ return new SignedDocAttributeRequestProvider(url);
+ } else if (shortname.equals("MISAttributeProvider")) {
+ return new MISAttributeProvider(url);
+ } else {
+ return null;
+ }
+ }
- /**
- * Gets fresh instances of the configured plugins.
- *
- * @param configuredAPs the configured a ps
- * @return the configured plugins
- */
- public static List<AttributeProvider> getConfiguredPlugins(
- List<AttributeProviderPlugin> configuredAPs) {
-
- List<AttributeProvider> result = new ArrayList<AttributeProvider>();
- for(AttributeProviderPlugin current : configuredAPs)
- result.add(create(current.getName(), current.getUrl(), current.getAttributes()));
-
- return result;
- }
+ /**
+ * Gets fresh instances of the configured plugins.
+ *
+ * @param configuredAPs the configured a ps
+ * @return the configured plugins
+ */
+ public static List<AttributeProvider> getConfiguredPlugins(
+ List<AttributeProviderPlugin> configuredAPs) {
+
+ List<AttributeProvider> result = new ArrayList<AttributeProvider>();
+ for (AttributeProviderPlugin current : configuredAPs)
+ result.add(create(current.getName(), current.getUrl(), current.getAttributes()));
+
+ return result;
+ }
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/EHvdAttributeProviderPlugin.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/EHvdAttributeProviderPlugin.java
index a36855d33..1b951c4ff 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/EHvdAttributeProviderPlugin.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/EHvdAttributeProviderPlugin.java
@@ -62,7 +62,6 @@ public class EHvdAttributeProviderPlugin implements AttributeProvider {
/* (non-Javadoc)
* @see at.gv.egovernment.moa.id.protocols.stork2.AttributeProvider#acquire(eu.stork.peps.auth.commons.PersonalAttribute)
*/
- @Override
public IPersonalAttributeList acquire(PersonalAttribute attribute, AuthenticationSession moasession)
throws UnsupportedAttributeException,
ExternalAttributeRequestRequiredException, MOAIDException {
@@ -225,7 +224,6 @@ public class EHvdAttributeProviderPlugin implements AttributeProvider {
/* (non-Javadoc)
* @see at.gv.egovernment.moa.id.protocols.stork2.AttributeProvider#performRedirect(java.lang.String, java.lang.String, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, at.gv.egovernment.moa.id.config.auth.OAAuthParameter)
*/
- @Override
public void performRedirect(String url, String spCountyCode,
HttpServletRequest req, HttpServletResponse resp,
OAAuthParameter oaParam) throws MOAIDException {
@@ -235,7 +233,6 @@ public class EHvdAttributeProviderPlugin implements AttributeProvider {
/* (non-Javadoc)
* @see at.gv.egovernment.moa.id.protocols.stork2.AttributeProvider#parse(javax.servlet.http.HttpServletRequest)
*/
- @Override
public IPersonalAttributeList parse(HttpServletRequest httpReq)
throws UnsupportedAttributeException, MOAIDException {
// there is no redirect required, so we throw an exception when someone asks us to parse a response