aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/gv/egiz/moazs/config
diff options
context:
space:
mode:
authorChristof Rabensteiner <christof.rabensteiner@iaik.tugraz.at>2019-07-09 11:13:35 +0200
committerChristof Rabensteiner <christof.rabensteiner@iaik.tugraz.at>2019-07-09 11:13:35 +0200
commit8e36fa01ea42d282eacdc78d6749daf9ae1ede9c (patch)
treeee691b4ec4a522c0b35c8251d3422702b90d2073 /src/main/java/at/gv/egiz/moazs/config
parentd8c668bbca31a835c387a3d52293c9938c424f58 (diff)
downloadmoa-zs-8e36fa01ea42d282eacdc78d6749daf9ae1ede9c.tar.gz
moa-zs-8e36fa01ea42d282eacdc78d6749daf9ae1ede9c.tar.bz2
moa-zs-8e36fa01ea42d282eacdc78d6749daf9ae1ede9c.zip
Refactor: Merge BinaryRepository into DeliveryRepository
- Reason: Components, which rely on one of those, usually also rely on the other, so merging them reduces amount of dependencies. - Frame operations in DeliveryRepository API as "store" and "retrieve" operations. - Rename: Convert *Id in local variable names to upper case.
Diffstat (limited to 'src/main/java/at/gv/egiz/moazs/config')
-rw-r--r--src/main/java/at/gv/egiz/moazs/config/RepositoryConfig.java10
1 files changed, 2 insertions, 8 deletions
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 01a4cc3..59bfb88 100644
--- a/src/main/java/at/gv/egiz/moazs/config/RepositoryConfig.java
+++ b/src/main/java/at/gv/egiz/moazs/config/RepositoryConfig.java
@@ -1,7 +1,5 @@
package at.gv.egiz.moazs.config;
-import at.gv.egiz.moazs.repository.BinaryRepository;
-import at.gv.egiz.moazs.repository.InMemoryBinaryRepository;
import at.gv.egiz.moazs.scheme.NameSpace;
import at.gv.egiz.moazs.scheme.NotificationResponse;
import at.gv.egiz.moazs.scheme.RequestStatusResponse;
@@ -17,17 +15,13 @@ import java.util.function.Function;
@Profile("!cluster")
public class RepositoryConfig {
- @Value("${repository.expiresAfterWrite}")
- private int expiresAfterWrite;
-
@Bean
- public BinaryRepository binaryRepository() {
- return new InMemoryBinaryRepository(expiresAfterWrite);
+ public int expiresAfterWrite(@Value("${repository.expiresAfterWrite}") int exp) {
+ return exp;
}
@Bean
public Map<String, Function<String, String>> idGenerators() {
-
return Map.of(NameSpace.MSG_DELIVERY_REQUEST_STATUS, RequestStatusResponse::getResponseID,
NameSpace.MSG_DELIVERY_NOTIFICATION, NotificationResponse::getResponseID);
}