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/repository/DeliveryRepository.java | 2 +- .../java/at/gv/egiz/moazs/repository/InMemoryDeliveryRepository.java | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'src/main/java/at/gv/egiz/moazs/repository') diff --git a/src/main/java/at/gv/egiz/moazs/repository/DeliveryRepository.java b/src/main/java/at/gv/egiz/moazs/repository/DeliveryRepository.java index d0a8148..57d2d07 100644 --- a/src/main/java/at/gv/egiz/moazs/repository/DeliveryRepository.java +++ b/src/main/java/at/gv/egiz/moazs/repository/DeliveryRepository.java @@ -17,7 +17,7 @@ public interface DeliveryRepository { void add(MsgResponse response); - Optional getResponse(String id); + Optional getResponse(String responseID); } diff --git a/src/main/java/at/gv/egiz/moazs/repository/InMemoryDeliveryRepository.java b/src/main/java/at/gv/egiz/moazs/repository/InMemoryDeliveryRepository.java index d9abb7b..3b5a020 100644 --- a/src/main/java/at/gv/egiz/moazs/repository/InMemoryDeliveryRepository.java +++ b/src/main/java/at/gv/egiz/moazs/repository/InMemoryDeliveryRepository.java @@ -39,12 +39,11 @@ public class InMemoryDeliveryRepository implements DeliveryRepository { @Override public void add(MsgResponse response) { String key = response.getResponseID(); - System.out.println("storing with response id " + key); responseRepository.put(key, response); } @Override - public Optional getResponse(String id) { - return ofNullable(responseRepository.getIfPresent(id)); + public Optional getResponse(String responseID) { + return ofNullable(responseRepository.getIfPresent(responseID)); } } -- cgit v1.2.3