From e1f365955aa22cdf8e44429af2b744388ce0c05b Mon Sep 17 00:00:00 2001 From: Christof Rabensteiner Date: Tue, 28 May 2019 10:48:20 +0200 Subject: Integrate Sign.Verification and Improve Error Handling of Pipeline - Ensure proper communication of errors between pipeline and mzs service by converting MoaZSExceptions into DeliveryRequestStatus messages. - Revise MoaZSException: Add optional fields; those fields are a) helpful to construct meaningful error messages and b) optional because, depending on where an exception appears, either existent or non-existent and thus optional. Add inner-class Builder. - Integrate Signature Verification into pipeline and add Stub for SignatureVerification. - Move TNVZResponse's Mimetype check into dedicated class (Reason: separate abstration layers). - Update api changes in testcases. --- .../egiz/moazs/msg/StoreSOAPBodyBinaryInRepositoryInterceptor.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/main/java/at/gv/egiz/moazs/msg/StoreSOAPBodyBinaryInRepositoryInterceptor.java') diff --git a/src/main/java/at/gv/egiz/moazs/msg/StoreSOAPBodyBinaryInRepositoryInterceptor.java b/src/main/java/at/gv/egiz/moazs/msg/StoreSOAPBodyBinaryInRepositoryInterceptor.java index 4e023ac..c78c44b 100644 --- a/src/main/java/at/gv/egiz/moazs/msg/StoreSOAPBodyBinaryInRepositoryInterceptor.java +++ b/src/main/java/at/gv/egiz/moazs/msg/StoreSOAPBodyBinaryInRepositoryInterceptor.java @@ -1,6 +1,5 @@ package at.gv.egiz.moazs.msg; -import at.gv.egiz.moazs.MoaZSException; import at.gv.egiz.moazs.repository.DeliveryRepository; import at.gv.egiz.moazs.scheme.SOAPUtils; import at.gv.egiz.moazs.util.CXFMessageUtils; @@ -17,6 +16,8 @@ import org.xml.sax.SAXException; import javax.xml.parsers.ParserConfigurationException; import java.io.IOException; +import static at.gv.egiz.moazs.MoaZSException.moaZSExceptionBuilder; + @Component public class StoreSOAPBodyBinaryInRepositoryInterceptor extends AbstractPhaseInterceptor { @@ -48,7 +49,9 @@ public class StoreSOAPBodyBinaryInRepositoryInterceptor extends AbstractPhaseInt log.info("Store binary DeliveryRequestStatus with AppDeliveryId={}", appDeliveryId); } } catch (ParserConfigurationException | SAXException | IOException | NullPointerException e) { - throw new MoaZSException("Could not extract signed data from message.", e); + throw moaZSExceptionBuilder("Could not extract signed data from message.") + .withCause(e) + .build(); } } -- cgit v1.2.3