aboutsummaryrefslogtreecommitdiff
path: root/id/server/idserverlib/src/main/java
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2015-01-23 12:00:38 +0100
committerThomas Lenz <tlenz@iaik.tugraz.at>2015-01-23 12:00:38 +0100
commit2195b00332cc6cba95f9ebec67dfdb230ee600f8 (patch)
tree66087939c3921bf3015131f55941791e02622161 /id/server/idserverlib/src/main/java
parent38ae8cb883ab73603f490d62b4cac38c51ac43e1 (diff)
parentd6637f8e82b41936b962f2197dee8cf89d0fe0b9 (diff)
downloadmoa-id-spss-2195b00332cc6cba95f9ebec67dfdb230ee600f8.tar.gz
moa-id-spss-2195b00332cc6cba95f9ebec67dfdb230ee600f8.tar.bz2
moa-id-spss-2195b00332cc6cba95f9ebec67dfdb230ee600f8.zip
Merge STORK2 code into development branch
Diffstat (limited to 'id/server/idserverlib/src/main/java')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java1
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java2
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/ConsentEvaluator.java2
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/CorporateBodyMandateContainer.java1
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOAAttributeProvider.java12
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateContainer.java2
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateRetrievalRequest.java87
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/EHvdAttributeProviderPlugin.java15
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/EHvdAttribute_deprecatedProviderPlugin.java20
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/SignedDocAttributeRequestProvider.java3
10 files changed, 100 insertions, 45 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java
index a33c4fdf4..5e4aee81b 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java
@@ -1781,6 +1781,7 @@ public class AuthenticationServer implements MOAIDAuthConstants {
// add sign request
PersonalAttribute newAttribute = new PersonalAttribute();
newAttribute.setName("signedDoc");
+ newAttribute.setIsRequired(true);
List<String> value = new ArrayList<String>();
Logger.debug("PEPS supports XMLSignatures:"+cpeps.isXMLSignatureSupported());
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java
index 192f139eb..1e6cf6910 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java
@@ -45,7 +45,7 @@ import at.gv.egovernment.moa.id.storage.AssertionStorage;
import at.gv.egovernment.moa.logging.Logger;
import eu.stork.peps.auth.commons.*;
import eu.stork.peps.auth.engine.STORKSAMLEngine;
-import eu.stork.peps.complex.attributes.AttributeStatusType;
+import eu.stork.peps.complex.attributes.eu.stork.names.tc.stork._1_0.assertion.AttributeStatusType;
import eu.stork.peps.exceptions.STORKSAMLEngineException;
import org.opensaml.common.impl.SecureRandomIdentifierGenerator;
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/ConsentEvaluator.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/ConsentEvaluator.java
index de7d5d6dd..2c5728798 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/ConsentEvaluator.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/ConsentEvaluator.java
@@ -41,7 +41,7 @@ import eu.stork.peps.auth.commons.PEPSUtil;
import eu.stork.peps.auth.commons.PersonalAttribute;
import eu.stork.peps.auth.commons.STORKAuthnResponse;
import eu.stork.peps.auth.engine.STORKSAMLEngine;
-import eu.stork.peps.complex.attributes.AttributeStatusType;
+import eu.stork.peps.complex.attributes.eu.stork.names.tc.stork._1_0.assertion.AttributeStatusType;
import eu.stork.peps.exceptions.STORKSAMLEngineException;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/CorporateBodyMandateContainer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/CorporateBodyMandateContainer.java
index 3e16db7d2..acbf1678a 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/CorporateBodyMandateContainer.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/CorporateBodyMandateContainer.java
@@ -90,6 +90,7 @@ public class CorporateBodyMandateContainer extends MandateContainer {
}
public void setCorpMandatorIdentificationValue(String corpMandatorIdentificationValue) {
+ Logger.debug("Setting corpMandatorIdentificationValue to AT/" + corpMandatorIdentificationValue);
this.corpMandatorIdentificationValue = "AT/" + corpMandatorIdentificationValue;
}
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 499265319..3ab4ec4a1 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
@@ -31,8 +31,7 @@ import at.gv.egovernment.moa.logging.Logger;
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;
import java.text.DateFormat;
@@ -138,7 +137,6 @@ public class MOAAttributeProvider {
if (authData.getDateOfBirth() != null) {
DateFormat fmt = new SimpleDateFormat("yyyyMMdd");
return fmt.format(authData.getDateOfBirth());
-
}
else
return null;
@@ -147,14 +145,14 @@ public class MOAAttributeProvider {
private void populateAttributeWithMethod(Method method, Object object, PersonalAttributeList attributeList, String storkAttribute, Boolean isRequired) {
try {
- Object attributeValue = method.invoke(object, new Class[]{});
+ Object attributeValue = method.invoke(object, new Class[]{}); // (Object[])
PersonalAttribute newAttribute = new PersonalAttribute();
newAttribute.setName(storkAttribute);
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)
@@ -167,7 +165,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());
}
@@ -179,7 +177,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/MandateContainer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateContainer.java
index e6c58b503..9207cc2dc 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateContainer.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateContainer.java
@@ -54,6 +54,8 @@ public abstract class MandateContainer {
public MandateContainer(String mandate) throws XPathExpressionException, MOAIDException {
+ Logger.debug("Received mandate content for processing: " + mandate);
+
xPath = XPathFactory.newInstance().newXPath();
HashMap<String, String> prefMap = new HashMap<String, String>() {{
put(S2Constants.MANDATE_PREFIX, S2Constants.MANDATE_NS);
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateRetrievalRequest.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateRetrievalRequest.java
index baa91a854..ed8480ccb 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateRetrievalRequest.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateRetrievalRequest.java
@@ -33,13 +33,16 @@ import at.gv.egovernment.moa.id.data.IAuthData;
import at.gv.egovernment.moa.id.data.SLOInformationInterface;
import at.gv.egovernment.moa.id.moduls.IAction;
import at.gv.egovernment.moa.id.moduls.IRequest;
+import at.gv.egovernment.moa.id.protocols.pvp2x.PVPConstants;
import at.gv.egovernment.moa.logging.Logger;
import at.gv.egovernment.moa.util.Constants;
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.auth.commons.STORKAttrQueryResponse;
-import eu.stork.peps.complex.attributes.*;
+import eu.stork.peps.complex.attributes.eu.stork.names.tc.stork._1_0.assertion.*;
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.codec.binary.StringUtils;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -65,12 +68,21 @@ public class MandateRetrievalRequest implements IAction {
private IAuthData authData;
private MOASTORKRequest moaStorkRequest;
private IdentityLink representingIdentityLink;
+ private Integer QAALevel;
+ private byte[] originalContent;
public SLOInformationInterface processRequest(IRequest req, HttpServletRequest httpReq, HttpServletResponse httpResp, IAuthData authData) throws MOAIDException {
Logger.debug("Entering AttributeRequest for MandateProvider");
httpResp.reset();
this.representingIdentityLink = authData.getIdentityLink();
+ this.QAALevel = translateQAALevel(authData.getQAALevel());
+ // preparing original content and removing sensitive data from it
+ this.originalContent = authData.getMISMandate().getMandate(); // TODO ERROR
+ //Logger.debug("Original content " + StringUtils.newStringUtf8(authData.getMISMandate().getMandate()));
+ String originalMandate = StringUtils.newStringUtf8(authData.getMISMandate().getMandate()).replaceAll("<pd:Value>.*?==</pd:Value><pd:Type>urn:publicid:gv.at:baseid</pd:Type>","<pd:Value></pd:Value><pd:Type></pd:Type>");;
+ Logger.debug("Removing personal identification value and type from original mandate ");
+ originalContent = StringUtils.getBytesUtf8(originalMandate);
OAAuthParameter oaParam = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(req.getOAURL());
if (oaParam == null)
@@ -206,6 +218,18 @@ public class MandateRetrievalRequest implements IAction {
return null;
}
+ private Integer translateQAALevel(String qaaLevel) throws MOAIDException {
+ if (qaaLevel.equals(PVPConstants.STORK_QAA_1_1))
+ return 1;
+ if (qaaLevel.equals(PVPConstants.STORK_QAA_1_2))
+ return 2;
+ if (qaaLevel.equals(PVPConstants.STORK_QAA_1_3))
+ return 3;
+ if (qaaLevel.equals(PVPConstants.STORK_QAA_1_4))
+ return 4;
+ Logger.error("Wrong QAA Number format");
+ throw new MOAIDException("stork.16", new Object[]{});
+ }
private String geteLPIdentifier(MandateContainer mandateContainer, PersonalAttribute currentAttribute) throws MOAIDException {
RepresentationPersonType represented = getRepresented(mandateContainer, currentAttribute);
@@ -213,7 +237,7 @@ public class MandateRetrievalRequest implements IAction {
return represented.getELPIdentifier();
} else if (currentAttribute.isRequired()) {
Logger.error("Cannot provide eLPIdentifier for natural person.");
- throw new MOAIDException("stork.19", new Object[]{currentAttribute.getName()});
+ throw new MOAIDException("stork.19", new Object[]{currentAttribute.getName()}); // TODO
}
return "";
}
@@ -249,14 +273,35 @@ public class MandateRetrievalRequest implements IAction {
private String mapPowersType(MandateContainer mandateContainer) {
+ // using if for java 6 compatibility if necessary
if (mandateContainer.getAnnotation().equals("ELGABilateral")) {
return "6"; // Health Powers
} else if (mandateContainer.getAnnotation().equals("ERsB")) {
return "0"; // General Powers
} else if (mandateContainer.getAnnotation().equals("GeneralvollmachtBilateral")) {
return "0"; // General Powers
+ } else if (mandateContainer.getAnnotation().equals("ERsBMitPostvollmacht")) {
+ return "0"; // General Powers
+ } else if (mandateContainer.getAnnotation().equals("ZVR")) {
+ return "0"; // General Powers
+ } else if (mandateContainer.getAnnotation().equals("ZVRMitPostvollmacht")) {
+ return "0"; // General Powers
+ } else if (mandateContainer.getAnnotation().equals("EVB")) {
+ return "0"; // General Powers
+ } else if (mandateContainer.getAnnotation().equals("Einzelvertretungsbefugnis")) {
+ return "0"; // General Powers
+ } else if (mandateContainer.getAnnotation().equals("Prokura")) {
+ return "0"; // General Powers
+ } else if (mandateContainer.getAnnotation().equals("Notar")) {
+ return "0"; // General Powers
+ } else if (mandateContainer.getAnnotation().equals("Organwalter")) {
+ return "0"; // General Powers
+ } else if (mandateContainer.getAnnotation().equals("Rechtsanwalt")) {
+ return "0"; // General Powers
+ } else if (mandateContainer.getAnnotation().equals("Ziviltechniker")) {
+ return "0"; // General Powers
}
- return "";
+ return "9";
}
private MandateType getMandateType(MandateContainer mandateContainer, PersonalAttribute sourceAttribute) throws MOAIDException {
@@ -264,10 +309,9 @@ public class MandateRetrievalRequest implements IAction {
RepresentationPersonType representative = getRepresentative(mandateContainer, sourceAttribute);
RepresentationPersonType represented = getRepresented(mandateContainer, sourceAttribute);
MandateContentType mandateContent = getMandateContent(mandateContainer, sourceAttribute);
-
- mandateType.setRepresenting(representative);
+ mandateType.setRepresentative(representative);
mandateType.setRepresented(represented);
- mandateType.setMandateContent(mandateContent);
+ mandateType.getMandateContent().add(mandateContent);
Logger.debug("Complex attribute extracted: " + sourceAttribute.getName());
return mandateType;
}
@@ -275,7 +319,8 @@ public class MandateRetrievalRequest implements IAction {
private String getLegalName(MandateContainer mandateContainer, PersonalAttribute sourceAttribute) throws MOAIDException {
RepresentationPersonType represented = getRepresented(mandateContainer, sourceAttribute);
if (mandateContainer instanceof CorporateBodyMandateContainer) {
- return represented.getName();
+ represented.getLegalName();
+ //return represented.getName();
} else if (sourceAttribute.isRequired()) {
Logger.error("Cannot provide legalName for natural person.");
throw new MOAIDException("stork.19", new Object[]{sourceAttribute.getName()});
@@ -487,10 +532,10 @@ public class MandateRetrievalRequest implements IAction {
if (mandateContainer instanceof CorporateBodyMandateContainer) {
CorporateBodyMandateContainer corporateBodyMandateContainer = (CorporateBodyMandateContainer) mandateContainer;
represented.setELPIdentifier(corporateBodyMandateContainer.getCorpMandatorIdentificationValue());
- represented.setName(corporateBodyMandateContainer.getCorpMandatorFullName());
- represented.setAddress("");
- represented.setCanonicalAddress(new CanonicalAddressType());
- represented.setType(getCompanyType(corporateBodyMandateContainer.corpMandatorFullName, corporateBodyMandateContainer.corpMandatorIdentificationType, sourceAttribute));
+ represented.setLegalName(corporateBodyMandateContainer.getCorpMandatorFullName());
+ represented.setTextRegisteredAddress(null);
+ represented.setCanonicalRegisteredAddress(new CanonicalAddressType());
+ represented.setLegalForm(getCompanyType(corporateBodyMandateContainer.corpMandatorFullName, corporateBodyMandateContainer.corpMandatorIdentificationType, sourceAttribute));
} else if (mandateContainer instanceof PhyPersonMandateContainer) {
PhyPersonMandateContainer phyPersonMandateContainer = (PhyPersonMandateContainer) mandateContainer;
represented.setEIdentifier(getRepresentedStorkeIdentifier(mandateContainer));
@@ -510,18 +555,22 @@ public class MandateRetrievalRequest implements IAction {
try {
XMLGregorianCalendar validFrom = DatatypeFactory.newInstance().newXMLGregorianCalendar(mandateContainer.getMandateValidFrom());
XMLGregorianCalendar validTo = DatatypeFactory.newInstance().newXMLGregorianCalendar(mandateContainer.getMandateValidTo());
- mandateContent.setValidFrom(validFrom);
- mandateContent.setValidTo(validTo);
+ TimeRestrictionType timeRestriction = new TimeRestrictionType();
+ timeRestriction.setValidFrom(validFrom);
+ timeRestriction.setValidTo(validTo);
+ mandateContent.setTimeRestriction(timeRestriction);
} catch (DatatypeConfigurationException dte) {
Logger.error("Error converting date from mandate: " + mandateContainer.getMandateValidFrom() + ", " + mandateContainer.getMandateValidTo());
throw new MOAIDException("stork.20", new Object[]{});
}
-
- mandateContent.setTransactionLimit(BigInteger.valueOf(0)); // TODO
- mandateContent.setTransactionLimitCurrency("");// TODO
- mandateContent.setIsJoint("0");
- mandateContent.setIschained(false);
- mandateContent.setTypePower(mapPowersType(mandateContainer));
+ mandateContent.setAQAA(this.QAALevel);
+ mandateContent.setOriginalMandate(originalContent);
+ mandateContent.setOriginalMandateType("application/xml");
+ TransactionLimitRestrictionType transactionLimit = new TransactionLimitRestrictionType();
+ mandateContent.setTransactionLimit(transactionLimit);
+ mandateContent.setIsJoint("");
+ mandateContent.setIsChained(false);
+ mandateContent.setTypeOfPower(mapPowersType(mandateContainer)); // TODO check
Logger.debug("Complex attribute extracted: " + sourceAttribute.getName());
return mandateContent;
}
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 761460971..bd1576020 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,8 +52,9 @@ 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.IsHealthCareProfessionalType;
-import eu.stork.peps.complex.attributes.ObjectFactory;
+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;
/**
* Fetches the attribute IsHealthcareProfessional from the BAGDAD SOAP service
@@ -67,7 +68,7 @@ public class EHvdAttributeProviderPlugin extends AttributeProvider {
* Instantiates a new e hvd attribute provider plugin.
*
* @param url the service url
- * @param attributes
+ * @param supportedAttributes
*/
public EHvdAttributeProviderPlugin(String url, String supportedAttributes) {
super(supportedAttributes);
@@ -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<String>(), "NotAvailable");
+ acquiredAttribute = new PersonalAttribute("isHealthCareProfessional", false, new ArrayList<String>(), AttributeStatusType.NOT_AVAILABLE.value());
} else {
// go on and parse the data
IsHealthCareProfessionalType result = new IsHealthCareProfessionalType();
@@ -193,7 +194,7 @@ public class EHvdAttributeProviderPlugin extends AttributeProvider {
result.setTypeOfHCP("physician");
result.setNameOfOrganisation(collection.get("NameOfOrganisation"));
- result.setTypeOfOrganisation("Unknown");
+ //result.setTypeOfOrganisation("Unknown"); // TODO used in previous version, check what to do with this
result.setAQAA(4);
@@ -206,7 +207,7 @@ public class EHvdAttributeProviderPlugin extends AttributeProvider {
ArrayList<String> value = new ArrayList<String>();
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<String> value = new ArrayList<String>();
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 2000ef928..a16603beb 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,9 +52,11 @@ 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.IsHealthCareProfessionalDeprecatedType;
-import eu.stork.peps.complex.attributes.IsHealthCareProfessionalType;
-import eu.stork.peps.complex.attributes.ObjectFactory;
+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.IsHealthCareProfessionalDeprecatedType;
+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;
/**
* Fetches the attribute IsHealthcareProfessional from the BAGDAD SOAP service
@@ -68,7 +70,7 @@ public class EHvdAttribute_deprecatedProviderPlugin extends AttributeProvider {
* Instantiates a new e hvd attribute provider plugin.
*
* @param url the service url
- * @param attributes
+ * @param supportedAttributes
*/
public EHvdAttribute_deprecatedProviderPlugin(String url, String supportedAttributes) {
super(supportedAttributes);
@@ -184,7 +186,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<String>(), "NotAvailable");
+ acquiredAttribute = new PersonalAttribute("isHealthCareProfessional", false, new ArrayList<String>(), AttributeStatusType.NOT_AVAILABLE.value());
} else {
// go on and parse the data
IsHealthCareProfessionalDeprecatedType result = new IsHealthCareProfessionalDeprecatedType();
@@ -202,16 +204,16 @@ public class EHvdAttribute_deprecatedProviderPlugin extends AttributeProvider {
result.setAQAA(4);
- final Marshaller m = JAXBContext.newInstance(IsHealthCareProfessionalType.class).createMarshaller();
+ final Marshaller m = JAXBContext.newInstance(IsHealthCareProfessionalDeprecatedType.class).createMarshaller();
m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
StringWriter stringWriter = new StringWriter();
- m.marshal(new ObjectFactory().createIsHealthCareProfessional(result), stringWriter);
+ m.marshal(new ObjectFactory().createIsHealthCareProfessionalDeprecated(result), stringWriter);
ArrayList<String> value = new ArrayList<String>();
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 +223,7 @@ public class EHvdAttribute_deprecatedProviderPlugin extends AttributeProvider {
// add stork id for verification
ArrayList<String> value = new ArrayList<String>();
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();