aboutsummaryrefslogtreecommitdiff
path: root/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/Linker.java
diff options
context:
space:
mode:
Diffstat (limited to 'id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/Linker.java')
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/Linker.java31
1 files changed, 23 insertions, 8 deletions
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/Linker.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/Linker.java
index f82f6fbcc..87ab4275f 100644
--- a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/Linker.java
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/Linker.java
@@ -5,6 +5,7 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
+import java.util.Map;
import org.apache.log4j.Logger;
@@ -36,7 +37,7 @@ public final class Linker implements Serializable {
/**
* Assertion map.
*/
- private LinkedHashMap<AttributeSource, STORKAttrQueryResponse> assertions;
+ private Map<AttributeSource, List<STORKAttrQueryResponse>> assertions;
/**
* The current index of local (domestic) Attribute Providers.
@@ -55,7 +56,7 @@ public final class Linker implements Serializable {
localIndex = 0;
remoteIndex = 0;
- assertions = new LinkedHashMap<AttributeSource, STORKAttrQueryResponse>();
+ assertions = new LinkedHashMap<AttributeSource, List<STORKAttrQueryResponse>>();
}
/**
@@ -143,13 +144,19 @@ public final class Linker implements Serializable {
localIndex++;
// Assertion storage
- this.assertions.put(source, attrResponse);
- // previously: getTotalPersonalAttributeList() in both cases
- if (source.getSourceType() == AttributeSource.SOURCE_REMOTE_COUNTRY)
+ if (this.assertions.containsKey(source)) {
+ this.assertions.get(source).add(attrResponse);
+ } else {
+ List<STORKAttrQueryResponse> temp = new ArrayList<STORKAttrQueryResponse>();
+ temp.add(attrResponse);
+ this.assertions.put(source, temp);
+ }
+
+ if (source.getSourceType() == AttributeSource.SOURCE_REMOTE_COUNTRY) {
this.attributeProvidersMap.put(source, attrResponse.getTotalPersonalAttributeList());
- else
+ } else {
this.attributeProvidersMap.put(source, attrResponse.getPersonalAttributeList());
- // this.attributeProvidersMap.put(source, attrResponse.getTotalPersonalAttributeList());
+ }
}
/**
@@ -312,5 +319,13 @@ public final class Linker implements Serializable {
LOG.debug("The attributeProvidersMap after the merge.");
((AttributeProvidersMap) this.attributeProvidersMap).trace();
}
+
+ for (AttributeSource as : previous.assertions.keySet()) {
+ if (!assertions.containsKey(as)) {
+ assertions.put(as, previous.assertions.get(as));
+ } else {
+ assertions.get(as).addAll(previous.assertions.get(as));
+ }
+ }
}
-} \ No newline at end of file
+}