From 7696a5956a8d28a0015ef028ac0225fbaddf6c4d Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Tue, 11 Aug 2015 11:54:15 +0200 Subject: approved some more java changes --- .../peps/auth/commons/PersonalAttributeList.java | 38 ++++++++++++---------- .../peps/auth/commons/STORKAttrQueryRequest.java | 15 +-------- .../peps/auth/commons/STORKAttrQueryResponse.java | 16 ++------- .../peps/auth/commons/STORKLogoutResponse.java | 21 ++++++++++++ 4 files changed, 44 insertions(+), 46 deletions(-) (limited to 'id/server/stork2-commons/src/main/java') diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PersonalAttributeList.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PersonalAttributeList.java index 233cdebd0..1ddc02e15 100644 --- a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PersonalAttributeList.java +++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PersonalAttributeList.java @@ -53,7 +53,7 @@ public final class PersonalAttributeList extends ConcurrentHashMap attrAliasNumber = new HashMap(); + private final Map> attrAliasNumber = new HashMap>(); /** * Default constructor. @@ -123,28 +123,30 @@ public final class PersonalAttributeList extends ConcurrentHashMap valTemp : val.getComplexValues()) { + if (!attr.getComplexValues().contains(valTemp)) { + attr.setComplexValue(valTemp); + } + } } else { - final PersonalAttribute attr = super.get(key); - if (!attr.isEmptyValue() && StringUtils.isNumeric(attr.getValue().get(0))) { - attrAlias = key + attr.getValue().get(0); - super.put(key, (PersonalAttribute) attr); - this.attrAliasNumber.put(key, null); + if (STORKStatusCode.STATUS_NOT_AVAILABLE.toString().equals(attr.getStatus())) { + attr = val; } } } - return super.put(attrAlias, val); - } else { - return null; } + return super.put(key, attr); } /** diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryRequest.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryRequest.java index 566817747..33ae4c743 100644 --- a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryRequest.java +++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryRequest.java @@ -2,18 +2,11 @@ package eu.stork.peps.auth.commons; import java.io.Serializable; -import org.apache.log4j.Logger; - public class STORKAttrQueryRequest implements Serializable, Cloneable { /** The Constant serialVersionUID. */ private static final long serialVersionUID = 4778480781609392750L; - /** - * Logger object. - */ - private static final Logger LOG = Logger.getLogger(STORKAttrQueryRequest.class.getName()); - /** The samlId. */ private String samlId; @@ -290,13 +283,7 @@ public class STORKAttrQueryRequest implements Serializable, Cloneable { * @see IPersonalAttributeList */ public IPersonalAttributeList getPersonalAttributeList() { - IPersonalAttributeList personnalAttributeList = null; - try { - personnalAttributeList = (IPersonalAttributeList) attributeList.clone(); - } catch (CloneNotSupportedException e1) { - LOG.trace("[PersonalAttribute] Nothing to do."); - } - return personnalAttributeList; + return (IPersonalAttributeList) attributeList.clone(); } /** diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryResponse.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryResponse.java index cd54fb8b7..ac4663eaf 100644 --- a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryResponse.java +++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryResponse.java @@ -164,13 +164,7 @@ public class STORKAttrQueryResponse implements Serializable { * @see PersonalAttributeList */ public IPersonalAttributeList getPersonalAttributeList() { - IPersonalAttributeList personnalAttributeList = null; - try { - personnalAttributeList = (IPersonalAttributeList) attributeList.clone(); - } catch (CloneNotSupportedException e1) { - LOG.trace("[PersonalAttribute] Nothing to do."); - } - return personnalAttributeList; + return (IPersonalAttributeList) attributeList.clone(); } /** @@ -354,13 +348,7 @@ public class STORKAttrQueryResponse implements Serializable { * @see PersonalAttributeList */ public IPersonalAttributeList getTotalPersonalAttributeList() { - IPersonalAttributeList personnalAttributeList = null; - try { - personnalAttributeList = (IPersonalAttributeList) totalAttributeList.clone(); - } catch (CloneNotSupportedException e1) { - LOG.trace("[PersonalAttribute] Nothing to do."); - } - return personnalAttributeList; + return (IPersonalAttributeList) totalAttributeList.clone(); } /** diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKLogoutResponse.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKLogoutResponse.java index fe90056bf..8606b6389 100644 --- a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKLogoutResponse.java +++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKLogoutResponse.java @@ -38,6 +38,9 @@ public class STORKLogoutResponse implements Serializable, Cloneable { /** Logout failed? */ private boolean fail; + /** The inResponseTo */ + private String inResponseTo; + /** * Gets the SP's Certificate Alias. * @@ -257,4 +260,22 @@ public class STORKLogoutResponse implements Serializable, Cloneable { return storkLogoutResponse; } + + /** + * Getter for the inResponseTo value. + * + * @return The inResponseTo value. + */ + public String getInResponseTo() { + return inResponseTo; + } + + /** + * Setter for the inResponseTo value. + * + * @param inResponseTo the new inResponseTo value. + */ + public void setInResponseTo(String inResponseTo) { + this.inResponseTo = inResponseTo; + } } -- cgit v1.2.3