From e70ec39488c0688d8144fa529d58d60ae9564fbd Mon Sep 17 00:00:00 2001 From: Christof Rabensteiner Date: Wed, 15 May 2019 06:41:15 +0200 Subject: WIP: Generate Map of Config Profiles from Spring Environment Augmenter - Replace default Config Profile with map of Config Profiles. Now, Augmenter can choose a config profile at runtime and augment it. - Move Augmenter to sub package. WIP - Implement ConfigProfileGenerator, which retrieves Config profiles from Spring Environment and returns an easy-to-use map with profiles that is keyed with profile id's. - Replace application.properties with application.yaml. - Remove Augmenter test cases: They need to be adapted. --- .../config/DeliveryRequestAugmenterConfig.java | 25 ++++++---------------- 1 file changed, 7 insertions(+), 18 deletions(-) (limited to 'src/main/java/at/gv/egiz/moazs/config') diff --git a/src/main/java/at/gv/egiz/moazs/config/DeliveryRequestAugmenterConfig.java b/src/main/java/at/gv/egiz/moazs/config/DeliveryRequestAugmenterConfig.java index 93615c4..d5b52c5 100644 --- a/src/main/java/at/gv/egiz/moazs/config/DeliveryRequestAugmenterConfig.java +++ b/src/main/java/at/gv/egiz/moazs/config/DeliveryRequestAugmenterConfig.java @@ -1,31 +1,20 @@ package at.gv.egiz.moazs.config; +import at.gv.egiz.moazs.preprocess.ConfigProfileGenerator; import at.gv.zustellung.app2mzs.xsd.ConfigType; -import org.springframework.beans.factory.annotation.Value; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import static at.gv.zustellung.app2mzs.xsd.ConfigType.configTypeBuilder; -import static at.gv.zustellung.app2mzs.xsd.ServerType.serverTypeBuilder; +import java.util.Map; @Configuration public class DeliveryRequestAugmenterConfig { - - @Value("${msg.default.url}") - private String zuseUrlID; - @Bean - public ConfigType defaultMzsConfig() { - - var server = serverTypeBuilder() - .withZUSEUrlID(zuseUrlID) - .withX509(null) //todo load cert! - .build(); - - return configTypeBuilder() - .withPerformQueryPersonRequest(false) - .withServer(server) - .build(); + @Autowired + Map deliveryRequestConfigs(ConfigProfileGenerator generator) { + return generator.generate(); } + } -- cgit v1.2.3