diff options
author | Christof Rabensteiner <christof.rabensteiner@iaik.tugraz.at> | 2019-12-05 09:16:36 +0100 |
---|---|---|
committer | Christof Rabensteiner <christof.rabensteiner@iaik.tugraz.at> | 2019-12-05 09:16:36 +0100 |
commit | cf90865ce21f246a0358fd291324f511c5ed6e90 (patch) | |
tree | a8f03882f78d9f7fb38f645db38feeada294d0b4 /src/main/java | |
parent | 641ba9c97e251020e934a2e2b23638b770907495 (diff) | |
download | moa-zs-cf90865ce21f246a0358fd291324f511c5ed6e90.tar.gz moa-zs-cf90865ce21f246a0358fd291324f511c5ed6e90.tar.bz2 moa-zs-cf90865ce21f246a0358fd291324f511c5ed6e90.zip |
Fix Missing Parameters in ERVDeliveryConfirmed Notification
- mzs Schema Change: Introduce new type
mzs:ERVConfirmedDelivery (which is a mzs:MessageType extension) and
replace mzs:DeliveryNotification/msg:ERVConfirmedDelivery with
mzs:ERVConfirmedDelivery. Reason: Necessary to provide all
parameters to sender application (AppDeliveryID, DeliverySystem,
ZSDeliveryID, a.o.).
- Adapt Msg2MzsConverter accordingly.
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/at/gv/egiz/moazs/scheme/Msg2MzsConverter.java | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/main/java/at/gv/egiz/moazs/scheme/Msg2MzsConverter.java b/src/main/java/at/gv/egiz/moazs/scheme/Msg2MzsConverter.java index f7d14cd..1390986 100644 --- a/src/main/java/at/gv/egiz/moazs/scheme/Msg2MzsConverter.java +++ b/src/main/java/at/gv/egiz/moazs/scheme/Msg2MzsConverter.java @@ -24,6 +24,7 @@ package at.gv.egiz.moazs.scheme; import at.gv.zustellung.app2mzs.xsd.DeliveryNotificationType; import at.gv.zustellung.app2mzs.xsd.*; import at.gv.zustellung.msg.xsd.*; +import at.gv.zustellung.msg.xsd.ERVConfirmedDeliveryType; import org.springframework.stereotype.Component; import javax.xml.bind.JAXBElement; @@ -34,6 +35,7 @@ import static at.gv.egiz.moazs.MoaZSException.moaZSException; import static at.gv.zustellung.app2mzs.xsd.DeliveryNotificationType.AdditionalFormat.additionalFormatBuilder; import static at.gv.zustellung.app2mzs.xsd.DeliveryNotificationType.deliveryNotificationTypeBuilder; import static at.gv.zustellung.app2mzs.xsd.DeliveryResponseType.deliveryResponseTypeBuilder; +import static at.gv.zustellung.app2mzs.xsd.ERVConfirmedDeliveryType.ERVConfirmedDeliveryTypeBuilder; import static at.gv.zustellung.app2mzs.xsd.ErrorType.errorTypeBuilder; import static at.gv.zustellung.app2mzs.xsd.PartialSuccessType.partialSuccessTypeBuilder; import static at.gv.zustellung.app2mzs.xsd.SuccessType.successTypeBuilder; @@ -120,8 +122,8 @@ public class Msg2MzsConverter { builder.withError(extractError(msgNotification, error, signedNotification)) .withNotificationsPerformed(error.getNotificationsPerformed()); } else if(answer.getValue() instanceof ERVConfirmedDeliveryType) { - ERVConfirmedDeliveryType ervConfirmed = (ERVConfirmedDeliveryType) answer.getValue(); - builder.withERVConfirmedDelivery(ervConfirmed); + var ervConfirmed = (ERVConfirmedDeliveryType) answer.getValue(); + builder.withERVConfirmedDelivery(extractERVconfirmedDelivery(msgNotification, ervConfirmed, signedNotification)); } else { throw moaZSException(UNKNOWN_ANSWER_ERROR_MSG); } @@ -159,6 +161,21 @@ public class Msg2MzsConverter { .build(); } + private at.gv.zustellung.app2mzs.xsd.ERVConfirmedDeliveryType extractERVconfirmedDelivery( + at.gv.zustellung.msg.xsd.DeliveryNotificationType msgNotification, + ERVConfirmedDeliveryType ervConfirmed,Optional<byte[]> signedNotification) { + + return ERVConfirmedDeliveryTypeBuilder() + .withAppDeliveryID(msgNotification.getAppDeliveryID()) + .withDeliverySystem(msgNotification.getDeliverySystem()) + .withZSDeliveryID(msgNotification.getZSDeliveryID()) + .withGZ(msgNotification.getGZ()) + .withSignedDeliveryRequestStatus(signedNotification.orElse(null)) + .withERVConfirmedDelivery(ervConfirmed) + .build(); + } + + private List<DeliveryNotificationType.AdditionalFormat> convert( List<at.gv.zustellung.msg.xsd.DeliveryNotificationType.AdditionalFormat> additionalFormat) { return additionalFormat.stream() |