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. --- src/main/java/at/gv/egiz/moazs/config/RepositoryConfig.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/main/java/at/gv/egiz/moazs/config') diff --git a/src/main/java/at/gv/egiz/moazs/config/RepositoryConfig.java b/src/main/java/at/gv/egiz/moazs/config/RepositoryConfig.java index ee73b9e..01a4cc3 100644 --- a/src/main/java/at/gv/egiz/moazs/config/RepositoryConfig.java +++ b/src/main/java/at/gv/egiz/moazs/config/RepositoryConfig.java @@ -11,6 +11,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import java.util.Map; +import java.util.function.Function; @Configuration @Profile("!cluster") @@ -25,8 +26,9 @@ public class RepositoryConfig { } @Bean - public Map idSuffixes() { - return Map.of(NameSpace.MSG_DELIVERY_REQUEST_STATUS, RequestStatusResponse.getIdSuffix(), - NameSpace.MSG_DELIVERY_NOTIFICATION, NotificationResponse.getIdSuffix()); + public Map> idGenerators() { + + return Map.of(NameSpace.MSG_DELIVERY_REQUEST_STATUS, RequestStatusResponse::getResponseID, + NameSpace.MSG_DELIVERY_NOTIFICATION, NotificationResponse::getResponseID); } } -- cgit v1.2.3