diff options
Diffstat (limited to 'src/main/java/at/gv/egiz/moazs/repository')
-rw-r--r-- | src/main/java/at/gv/egiz/moazs/repository/InMemoryDeliveryRepository.java | 15 |
1 files changed, 12 insertions, 3 deletions
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 41b742b..b8a6d78 100644 --- a/src/main/java/at/gv/egiz/moazs/repository/InMemoryDeliveryRepository.java +++ b/src/main/java/at/gv/egiz/moazs/repository/InMemoryDeliveryRepository.java @@ -4,6 +4,8 @@ package at.gv.egiz.moazs.repository; import at.gv.egiz.moazs.scheme.MsgResponse; import at.gv.zustellung.app2mzs.xsd.DeliveryRequestType; import com.google.common.cache.Cache; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.context.annotation.Profile; import org.springframework.stereotype.Repository; @@ -17,6 +19,8 @@ import static java.util.Optional.ofNullable; @Profile("!cluster") public class InMemoryDeliveryRepository implements DeliveryRepository { + private static final Logger log = LoggerFactory.getLogger(InMemoryDeliveryRepository.class); + private final Cache<String, DeliveryRequestType> requestRepository; private final Cache<String, MsgResponse> responseRepository; private final Cache<String, byte[]> binaryResponseRepository; @@ -31,33 +35,38 @@ public class InMemoryDeliveryRepository implements DeliveryRepository { @Override public void store(DeliveryRequestType request) { var key = request.getMetaData().getAppDeliveryID(); + log.trace("Store DeliveryRequest by key={}", key); requestRepository.put(key, request); } @Override public Optional<DeliveryRequestType> retrieveDeliveryRequest(String appDeliveryID) { + log.trace("Retrieve DeliveryRequest by key={}", appDeliveryID); return ofNullable(requestRepository.getIfPresent(appDeliveryID)); } @Override public void store(MsgResponse response) { String key = response.getResponseID(); + log.trace("Store MsgResponse by key={}", key); responseRepository.put(key, response); } @Override public Optional<MsgResponse> retrieveResponse(String responseID) { + log.trace("Retrieve MsgResponse by key={}", responseID); return ofNullable(responseRepository.getIfPresent(responseID)); } @Override - public void store(String id, byte[] data) { - binaryResponseRepository.put(id, data); - + public void store(String responseID, byte[] data) { + log.trace("Store Binary MsgResponse by key={}", responseID); + binaryResponseRepository.put(responseID, data); } @Override public Optional<byte[]> retrieveBinaryResponse(String responseID) { + log.trace("Retrieve Binary MsgResponse by key={}", responseID); return ofNullable(binaryResponseRepository.getIfPresent(responseID)); } |