diff options
author | Florian Reimair <florian.reimair@iaik.tugraz.at> | 2015-08-10 16:35:14 +0200 |
---|---|---|
committer | Florian Reimair <florian.reimair@iaik.tugraz.at> | 2015-08-10 16:45:26 +0200 |
commit | 496ba9bb6e150ad67c5c628c1c97f30d6da81dfb (patch) | |
tree | 1dbe494358ab717b2bf94bae9fd3c3f90f4dbd58 /id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/Linker.java | |
parent | f71531346c6be197957311712ba093e024545e37 (diff) | |
download | moa-id-spss-496ba9bb6e150ad67c5c628c1c97f30d6da81dfb.tar.gz moa-id-spss-496ba9bb6e150ad67c5c628c1c97f30d6da81dfb.tar.bz2 moa-id-spss-496ba9bb6e150ad67c5c628c1c97f30d6da81dfb.zip |
approved changes
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.java | 31 |
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 +}
|