From 8f3b805a558c4ed454db2b691032cea800d7b6dd Mon Sep 17 00:00:00 2001 From: Christof Rabensteiner Date: Tue, 16 Jul 2019 14:33:26 +0200 Subject: Implement ForwardResponseToService Sink And All Its Implications MZS Schema Change: - Add configuration for ForwardResponseToServiceSink (add parameters in mzs:DeliveryRequest/Config) - Add sink configuration in application.yaml, convert from Spring Environment to ConfigType, and merge ConfigTypes. - Validate sink configuration completeness. Contract added: - Add contract mzs2app.wsdl: This contract specifies how mzs:DeliveryRequestStatus' and mzs:DeliveryNotifications are forwarded to the sender application. - Implement "ForwardResponseToService" Sink. - Add and implement MsgResponse.sendToMzsClient() : This is a somewhat unfortunate solution because, intuitively, sending should be done by it's caller, the "ForwardResponseToService"-sink. However, this solution prevents differences between msg:DeliveryRequestStatus and msg:DeliveryNotification (and code that needs to handle differences, i.e. sending) from sprawling outside of the respective MsgResponse derivatives. We move the entire "send" process into MsgResponse to prevent a hard-to-maintain "if type == notification then do x else to y" construct in ForwardResponseToServiceSink. Otherwise, introducing the MsgResponse wrapper was pointless. --- src/main/java/at/gv/egiz/moazs/service/MzsService.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/main/java/at/gv/egiz/moazs/service') diff --git a/src/main/java/at/gv/egiz/moazs/service/MzsService.java b/src/main/java/at/gv/egiz/moazs/service/MzsService.java index c8c0878..cbc56e4 100644 --- a/src/main/java/at/gv/egiz/moazs/service/MzsService.java +++ b/src/main/java/at/gv/egiz/moazs/service/MzsService.java @@ -3,7 +3,6 @@ package at.gv.egiz.moazs.service; import at.gv.egiz.moazs.preprocess.DeliveryRequestAugmenter; import at.gv.egiz.moazs.repository.DeliveryRepository; import at.gv.egiz.moazs.scheme.Msg2MzsConverter; -import at.gv.egiz.moazs.client.MzsClient; import at.gv.egiz.moazs.scheme.RequestStatusResponse; import at.gv.zustellung.app2mzs.xsd.App2MzsPortType; import at.gv.zustellung.app2mzs.xsd.DeliveryRequestType; @@ -37,16 +36,14 @@ public class MzsService implements App2MzsPortType { private final DeliveryRepository repository; private final Consumer backend; - private final MzsClient appClient; private final DeliveryRequestAugmenter augmenter; private final Msg2MzsConverter converter; @Autowired - public MzsService(DeliveryRepository repository, Consumer deliveryRequestBackend, MzsClient appClient, + public MzsService(DeliveryRepository repository, Consumer deliveryRequestBackend, DeliveryRequestAugmenter augmenter, Msg2MzsConverter converter) { this.repository = repository; this.backend = deliveryRequestBackend; - this.appClient = appClient; this.augmenter = augmenter; this.converter = converter; } @@ -69,7 +66,8 @@ public class MzsService implements App2MzsPortType { } catch (TimeoutException e) { logger.info("Answer Timed Out", e); - future.thenAccept(appClient::sendNotification); + //TODO: revise how notification should be sent + //future.thenAccept(appClient::sendNotification); return generatePartialSuccessResponse(appDeliveryID); } catch (Exception e) { -- cgit v1.2.3