aboutsummaryrefslogtreecommitdiff
path: root/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvidersMap.java
diff options
context:
space:
mode:
authorFlorian Reimair <florian.reimair@iaik.tugraz.at>2014-01-16 08:55:06 +0100
committerFlorian Reimair <florian.reimair@iaik.tugraz.at>2014-01-27 16:37:40 +0100
commit6c7a6f8e222e4fb39a11c220b63e785f2037d428 (patch)
tree2628e16ffc7296a2d6a8a3e9c2200dbc9f1536bd /id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvidersMap.java
parent8276884b9c45315df5fa951ce53b3d35f4983b22 (diff)
downloadmoa-id-spss-6c7a6f8e222e4fb39a11c220b63e785f2037d428.tar.gz
moa-id-spss-6c7a6f8e222e4fb39a11c220b63e785f2037d428.tar.bz2
moa-id-spss-6c7a6f8e222e4fb39a11c220b63e785f2037d428.zip
fix added real source of stork modules
Diffstat (limited to 'id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvidersMap.java')
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvidersMap.java94
1 files changed, 94 insertions, 0 deletions
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvidersMap.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvidersMap.java
new file mode 100644
index 000000000..8806ba866
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvidersMap.java
@@ -0,0 +1,94 @@
+package eu.stork.peps.auth.commons;
+
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Implementation of the AttributeProviderMap using a LinkedHashMap.
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: 1.01 $, $Date: 2013-09-20 $
+ *
+ * @see LinkedHashMap
+ */
+public class AttributeProvidersMap extends LinkedHashMap<AttributeSource, IPersonalAttributeList>
+ implements IAttributeProvidersMap {
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(AttributeProvidersMap.class.getName());
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 8949081185106296122L;
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public IPersonalAttributeList get(AttributeSource key) {
+ return this.get((Object) key);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public IPersonalAttributeList remove(AttributeSource key) {
+ return this.remove((Object) key);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean containsKey(AttributeSource key) {
+ return this.containsKey((Object) key);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Iterator<AttributeSource> keyIterator() {
+ return this.keySet().iterator();
+ }
+
+ public void trace() {
+ Iterator<AttributeSource> iterator;
+ Iterator<PersonalAttribute> iterator2;
+ AttributeSource source;
+ IPersonalAttributeList pal;
+ PersonalAttribute pa;
+
+ iterator = this.keyIterator();
+ LOG.trace("Start dumping of AttributeProvidersMap\n=======================");
+ while (iterator.hasNext()) {
+ source = iterator.next();
+
+ LOG.trace("Source details: type [" + source.getSourceType() + "], URL [" + source.getProviderURL() + "]");
+
+ if(source.getSourceType() == AttributeSource.SOURCE_LOCAL_APROVIDER)
+ LOG.trace("-> Attribute Provider: ID [" + source.getProvider().getProviderId() + "], name [" + source.getProvider().getProviderName() + "]");
+ else
+ LOG.trace("-> Country: ID [" + source.getCountry().getCountryId() + "], name [" + source.getCountry().getCountryName() + "]");
+
+ pal = this.get(source);
+ LOG.trace("++++++++=>");
+ iterator2 = pal.iterator();
+ while (iterator2.hasNext()) {
+ pa = iterator2.next();
+
+ LOG.trace("-> Citizen Attribute: name [" + pa.getName() + "], name [" + pa.isRequired() + "]");
+ }
+ LOG.trace("<=++++++++");
+
+ LOG.trace("-----------------------");
+ }
+ LOG.trace("END\n=======================");
+ }
+}