From d8c668bbca31a835c387a3d52293c9938c424f58 Mon Sep 17 00:00:00 2001 From: Christof Rabensteiner Date: Tue, 9 Jul 2019 10:32:54 +0200 Subject: Refactor MsgResponse and its IDs StoreSOAPBodyBinaryInRepositoryInterceptor: - Replace "generate body's id via concatenation" with "give the right generator function the app delivery id and let the generator function do the work". Reason: Prevent the logistics of deriving IDs to spill into unrelated components. MsgResponse refactor: - Make MsgResponse an abstract class. - Derive ResponseID's ONLY in MsgResponse::createResponseID. Others: - Ensure that all invocations to DeliveryRepository.getResponse and BinaryRepository.get use "responseID" instead of ambiguous "id" or incorrect "appDeliveryID". - Move SingleThreadedDeliveryPipeline into process package. --- .../gv/egiz/moazs/scheme/NotificationResponse.java | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'src/main/java/at/gv/egiz/moazs/scheme/NotificationResponse.java') diff --git a/src/main/java/at/gv/egiz/moazs/scheme/NotificationResponse.java b/src/main/java/at/gv/egiz/moazs/scheme/NotificationResponse.java index f465a28..7670ab7 100644 --- a/src/main/java/at/gv/egiz/moazs/scheme/NotificationResponse.java +++ b/src/main/java/at/gv/egiz/moazs/scheme/NotificationResponse.java @@ -6,24 +6,18 @@ import at.gv.zustellung.msg.xsd.DeliveryNotificationType; import static at.gv.zustellung.msg.xsd.DeliveryNotificationType.deliveryNotificationTypeBuilder; -public class NotificationResponse implements MsgResponse { +public class NotificationResponse extends MsgResponse { private final DeliveryNotificationType notification; - private final String id; - private static final String ID_SUFFIX = ".NO"; + private final static String ID_SUFFIX = ".NO"; public NotificationResponse(DeliveryNotificationType notification) { + super.id = createResponseId(notification.getAppDeliveryID(), ID_SUFFIX); this.notification = notification; - this.id = getId(notification.getAppDeliveryID()); } - @Override - public String getResponseID() { - return this.id; - } - - public static String getId(String appDeliveryID) { - return appDeliveryID + ID_SUFFIX; + public static String getResponseID(String appDeliveryID) { + return createResponseId(appDeliveryID, ID_SUFFIX); } @Override @@ -60,8 +54,4 @@ public class NotificationResponse implements MsgResponse