From 3489b058fc9b70814893d93cd9ba602240ab59e0 Mon Sep 17 00:00:00 2001 From: Bojan Suzic Date: Fri, 7 Nov 2014 16:06:58 +0100 Subject: adjusting files to use stork2 attributestatustype --- .../egovernment/moa/id/protocols/stork2/MOAAttributeProvider.java | 7 ++++--- .../stork2/attributeproviders/EHvdAttributeProviderPlugin.java | 7 ++++--- .../attributeproviders/EHvdAttribute_deprecatedProviderPlugin.java | 7 ++++--- .../attributeproviders/SignedDocAttributeRequestProvider.java | 3 ++- 4 files changed, 14 insertions(+), 10 deletions(-) (limited to 'id/server/idserverlib/src/main') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOAAttributeProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOAAttributeProvider.java index 993514ec7..ec823949f 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOAAttributeProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOAAttributeProvider.java @@ -32,6 +32,7 @@ import at.gv.egovernment.moa.util.MiscUtil; import eu.stork.peps.auth.commons.PersonalAttribute; import eu.stork.peps.auth.commons.PersonalAttributeList; import eu.stork.peps.auth.commons.STORKStatusCode; +import eu.stork.peps.complex.attributes.eu.stork.names.tc.stork._1_0.assertion.AttributeStatusType; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -150,7 +151,7 @@ public class MOAAttributeProvider { newAttribute.setIsRequired(isRequired); if (attributeValue != null) { - newAttribute.setStatus(STORKStatusCode.STATUS_AVAILABLE.name()); + newAttribute.setStatus(AttributeStatusType.AVAILABLE.value()); Logger.info("Got attribute value: " + attributeValue); if (attributeValue instanceof String) @@ -163,7 +164,7 @@ public class MOAAttributeProvider { } else { Logger.info("Attribute " + storkAttribute + " is not available."); - newAttribute.setStatus(STORKStatusCode.STATUS_NOT_AVAILABLE.name()); + newAttribute.setStatus(AttributeStatusType.NOT_AVAILABLE.value()); } @@ -175,7 +176,7 @@ public class MOAAttributeProvider { } else { Logger.info("Attribute " + storkAttribute + " is not available."); - newAttribute.setStatus(STORKStatusCode.STATUS_NOT_AVAILABLE.name()); + newAttribute.setStatus(AttributeStatusType.NOT_AVAILABLE.value()); } } catch (InvocationTargetException e) { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/EHvdAttributeProviderPlugin.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/EHvdAttributeProviderPlugin.java index 70c1af82e..902f41a4b 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/EHvdAttributeProviderPlugin.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/EHvdAttributeProviderPlugin.java @@ -52,6 +52,7 @@ import at.gv.egovernment.moa.logging.Logger; import eu.stork.peps.auth.commons.IPersonalAttributeList; import eu.stork.peps.auth.commons.PersonalAttribute; import eu.stork.peps.auth.commons.PersonalAttributeList; +import eu.stork.peps.complex.attributes.eu.stork.names.tc.stork._1_0.assertion.AttributeStatusType; import eu.stork.peps.complex.attributes.eu.stork.names.tc.stork._1_0.assertion.IsHealthCareProfessionalType; import eu.stork.peps.complex.attributes.eu.stork.names.tc.stork._1_0.assertion.ObjectFactory; @@ -183,7 +184,7 @@ public class EHvdAttributeProviderPlugin extends AttributeProvider { if (collection.get("IsHealthcareProfessional").equals("false") || !collection.get("Type").equals("Medical doctor")) { // the citizen is no HCP - acquiredAttribute = new PersonalAttribute("isHealthCareProfessional", false, new ArrayList(), "NotAvailable"); + acquiredAttribute = new PersonalAttribute("isHealthCareProfessional", false, new ArrayList(), AttributeStatusType.NOT_AVAILABLE.value()); } else { // go on and parse the data IsHealthCareProfessionalType result = new IsHealthCareProfessionalType(); @@ -206,7 +207,7 @@ public class EHvdAttributeProviderPlugin extends AttributeProvider { ArrayList value = new ArrayList(); value.add(stringWriter.toString()); - acquiredAttribute = new PersonalAttribute("isHealthCareProfessional", false, value, "Available"); + acquiredAttribute = new PersonalAttribute("isHealthCareProfessional", false, value, AttributeStatusType.AVAILABLE.value()); } // pack and return the result @@ -216,7 +217,7 @@ public class EHvdAttributeProviderPlugin extends AttributeProvider { // add stork id for verification ArrayList value = new ArrayList(); value.add(new BPKBuilder().buildStorkeIdentifier(authData.getIdentityLink(), moastorkRequest.getSpCountry())); - result.add(new PersonalAttribute("eIdentifier", false, value, "Available")); + result.add(new PersonalAttribute("eIdentifier", false, value, AttributeStatusType.AVAILABLE.value())); return result; } catch (Exception e) { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/EHvdAttribute_deprecatedProviderPlugin.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/EHvdAttribute_deprecatedProviderPlugin.java index 8d7d50370..22ff5e85c 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/EHvdAttribute_deprecatedProviderPlugin.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/EHvdAttribute_deprecatedProviderPlugin.java @@ -52,6 +52,7 @@ import at.gv.egovernment.moa.logging.Logger; import eu.stork.peps.auth.commons.IPersonalAttributeList; import eu.stork.peps.auth.commons.PersonalAttribute; import eu.stork.peps.auth.commons.PersonalAttributeList; +import eu.stork.peps.complex.attributes.eu.stork.names.tc.stork._1_0.assertion.AttributeStatusType; import eu.stork.peps.complex.attributes.eu.stork.names.tc.stork._1_0.assertion.IsHealthCareProfessionalType; // IsHealthCareProfessionalDeprecatedType; //import eu.stork.peps.complex.attributes.eu.stork.names.tc.stork._1_0.assertion. _1_0.assertion.IsHealthCareProfessionalType; import eu.stork.peps.complex.attributes.eu.stork.names.tc.stork._1_0.assertion.ObjectFactory; @@ -184,7 +185,7 @@ public class EHvdAttribute_deprecatedProviderPlugin extends AttributeProvider { if (collection.get("IsHealthcareProfessional").equals("false")) { // the citizen is no HCP - acquiredAttribute = new PersonalAttribute("isHealthCareProfessional", false, new ArrayList(), "NotAvailable"); + acquiredAttribute = new PersonalAttribute("isHealthCareProfessional", false, new ArrayList(), AttributeStatusType.NOT_AVAILABLE.value()); } else { // go on and parse the data IsHealthCareProfessionalType result = new IsHealthCareProfessionalType(); @@ -211,7 +212,7 @@ public class EHvdAttribute_deprecatedProviderPlugin extends AttributeProvider { ArrayList value = new ArrayList(); value.add(stringWriter.toString()); - acquiredAttribute = new PersonalAttribute("isHealthCareProfessional", false, value, "Available"); + acquiredAttribute = new PersonalAttribute("isHealthCareProfessional", false, value, AttributeStatusType.AVAILABLE.value()); } // pack and return the result @@ -221,7 +222,7 @@ public class EHvdAttribute_deprecatedProviderPlugin extends AttributeProvider { // add stork id for verification ArrayList value = new ArrayList(); value.add(new BPKBuilder().buildStorkeIdentifier(authData.getIdentityLink(), moastorkRequest.getSpCountry())); - result.add(new PersonalAttribute("eIdentifier", false, value, "Available")); + result.add(new PersonalAttribute("eIdentifier", false, value, AttributeStatusType.AVAILABLE.value())); return result; } catch (Exception e) { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/SignedDocAttributeRequestProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/SignedDocAttributeRequestProvider.java index 124b91e8b..501e33a75 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/SignedDocAttributeRequestProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/SignedDocAttributeRequestProvider.java @@ -46,6 +46,7 @@ import javax.xml.ws.Service; import javax.xml.ws.soap.SOAPBinding; import javax.xml.ws.BindingProvider; +import eu.stork.peps.complex.attributes.eu.stork.names.tc.stork._1_0.assertion.AttributeStatusType; import org.apache.commons.codec.binary.Base64; import org.apache.commons.io.IOUtils; import org.apache.commons.lang.NotImplementedException; @@ -296,7 +297,7 @@ public class SignedDocAttributeRequestProvider extends AttributeProvider { Logger.debug("Assembling signedDoc attribute"); PersonalAttribute signedDocAttribute = new PersonalAttribute("signedDoc", false, values, - "Available"); + AttributeStatusType.AVAILABLE.value()); // pack and return the result PersonalAttributeList result = new PersonalAttributeList(); -- cgit v1.2.3