From ee8c694c12850b27144a664c948c3b84398ead6f Mon Sep 17 00:00:00 2001 From: Christof Rabensteiner Date: Thu, 3 Oct 2019 16:09:47 +0200 Subject: Update zusemsg and zusetnvz to Newest Version & Accommodate Changes Upgrade zusemsg 2.2.0 to 2.2.007: - msg:RelayedViaERV - Change from boolean to complex type (ervcode). - Move from msg:DeliveryRequestStatusType/Success into msg:DeliveryRequestStatusType, which affects Success, Error, and PartialSuccess. - Was removed from DeliveryNotificationType. - Change msg:DeliveryNotification/Answer from list to singleton. - Change msg:DeliveryRequestStatusType/PartialSuccess is to type AnswerType. - msg:DeliveryRequestStatusType and msg:DeliveryNotificationType receive the attribute ID (for signature referencing). - Add new optional element msg:AustrianAdressesOnly (IndicatorType) to DeliveryRequestType/Receiver/(choice sequence). - Add new optional element ClearingProfilID to DeliveryRequestType/Sender. - Add new element ERVConfirmedDelivery, which subsitutes msg:Answer and extends msg:AbstractOperation - Has element ErvCode (also new token256 type). - Has element ERVDeliveryTimestamp. - Add new optional element TargetIdentification of type p:IdentificationType to msg:DeliveryNotification/User/ as optional element. - Add new enumeration "System" to msg:DeliveryNotification/User/Role. - Rename type AustrianLanguageType from "AustrianEthicMinorityLanguageType" to "AustrianLanguageType" and add "DE" as value. - msg:Tags were unbounded, now they are limited to 20. - VersionNumberType: Patch version can have three digits. Upgrade zusetnvz 2.2.0 to 2.2.006: - Add StandardMimeTypeList to tnvz:QueryPersonResponse and tnvz:QueryAdressabilityResponse. - Add AllStandardMimeTypes (indicator) to tnvz:PersonResult/Success. - Add optional msg:MetadataList to tnvz:PersonQueryType/Metadata tnvz:AddressabilityQueryType/Metadata. - Move tnvz:AustrianAdressesOnly to msg namespace. Carry zusemsg changes into app2mzs interface: - Switch namespace of AustrianAdressesOnly from tnvz to msg. - Add new optional element ClearingProfilID to mzs:DeliveryRequestType/Sender; Reason: Element was added to zusemsg 2.2.007. - Add new choice in mzs:DeliveryNotification to forward new answer type msg:ERVConfirmedDelivery to the app. - Move msg:RelayedViaERV from SuccessType into MessageType (now it's available to all types that derive from MessageType). Accommodate zusemsg/tnvz changes in code base: - TNVZHelper: Consider StandardMimeTypeList when assessing if DeliveryRequest/mimetypes overlap with TNVZ's Accepted Mimetypes. - Msg2MzsConverter: - Put getRelayedViaERV() into all DeliveryStatusRequest replies. - Honor that Notification/Answer is Singleton instead of List. - Handle case were DeliveryNotification/Answer is of type ERVConfirmedDeliveryType. - Remove RelayedViaERV from DeliveryNotification as this element is not available anymore. - NotificationResponse: Honor that Notification/Answer is Singleton instead of List. Fix all testcases and sample soap messages to comply with schema changes. --- .../java/at/gv/egiz/moazs/client/TnvzHelper.java | 34 +++++++++++++++------- 1 file changed, 23 insertions(+), 11 deletions(-) (limited to 'src/main/java/at/gv/egiz/moazs/client') diff --git a/src/main/java/at/gv/egiz/moazs/client/TnvzHelper.java b/src/main/java/at/gv/egiz/moazs/client/TnvzHelper.java index 5cc4954..e6bacec 100644 --- a/src/main/java/at/gv/egiz/moazs/client/TnvzHelper.java +++ b/src/main/java/at/gv/egiz/moazs/client/TnvzHelper.java @@ -69,9 +69,9 @@ public class TnvzHelper { var tnvzResponse = tnvzPort.queryPerson(tnvzQuery); verifyResponse(tnvzResponse); - var tnvzResult = getResult(tnvzResponse); + var tnvzResult = getFirstResult(tnvzResponse); var typesInRequest = extractListOfMimemtypesIn(mzsRequest); - checkMimetypes(tnvzResult, typesInRequest); + checkMimetypes(tnvzResponse, typesInRequest); return tnvzResult.getSuccess().getIdentification(); } @@ -196,14 +196,15 @@ public class TnvzHelper { } } - private PersonResultType getResult(QueryPersonResponse tnvzResponse) { + private PersonResultType getFirstResult(QueryPersonResponse tnvzResponse) { return tnvzResponse.getQueryResultList().getQueryResult().get(0); } - private void checkMimetypes(PersonResultType tnvzResult, Set typesInRequest) { - var mismatchedTypes = findMimeTypeMismatches(tnvzResult, typesInRequest); + private void checkMimetypes(QueryPersonResponse tnvzResponse, Set typesInRequest) { + + var mismatchedTypes = findMimeTypeMismatches(tnvzResponse, typesInRequest); if (!mismatchedTypes.isEmpty()) { - var acceptedTypesString = join(",", getAcceptedTypes(tnvzResult)); + var acceptedTypesString = join(",", getAcceptedTypes(tnvzResponse)); var mismatchedTypesString = join(",", mismatchedTypes); var message = String.format(MIMETYPE_MISSMATCH_ERROR_MSG, mismatchedTypesString, acceptedTypesString); var code = MoaZSException.ERROR_MZS_MIMETYPE_MISSMATCH; @@ -211,10 +212,11 @@ public class TnvzHelper { } } - private Collection findMimeTypeMismatches(PersonResultType result, Set typesInRequest) { - var acceptedTypes = getAcceptedTypes(result); + private Collection findMimeTypeMismatches(QueryPersonResponse response, Set typesInRequest) { + var acceptedTypes = getAcceptedTypes(response); - if (acceptedTypes.contains("*/*")) { + var result = getFirstResult(response); + if (result.getSuccess().getAllStandardMimeTypes() != null) { return List.of(); } @@ -224,8 +226,18 @@ public class TnvzHelper { return typesInRequestCopy; } - private List getAcceptedTypes(PersonResultType result) { - return result.getSuccess().getMimeTypeList().getMimeType(); + private Set getAcceptedTypes(QueryPersonResponse response) { + + Set union = new HashSet<>(); + var standardTypes = response.getStandardMimeTypeList().getMimeType(); + union.addAll(standardTypes); + + var acceptedTypeList = getFirstResult(response).getSuccess().getMimeTypeList(); + if(acceptedTypeList != null) { + union.addAll(acceptedTypeList.getMimeType()); + } + + return union; } -- cgit v1.2.3