aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/gv/egiz/moazs/config
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/gv/egiz/moazs/config')
-rw-r--r--src/main/java/at/gv/egiz/moazs/config/MzsServiceConfig.java30
-rw-r--r--src/main/java/at/gv/egiz/moazs/config/PreprocessConfig.java2
-rw-r--r--src/main/java/at/gv/egiz/moazs/config/RepositoryConfig.java32
-rw-r--r--src/main/java/at/gv/egiz/moazs/config/ServicesConfig.java46
4 files changed, 79 insertions, 31 deletions
diff --git a/src/main/java/at/gv/egiz/moazs/config/MzsServiceConfig.java b/src/main/java/at/gv/egiz/moazs/config/MzsServiceConfig.java
deleted file mode 100644
index 9fd14eb..0000000
--- a/src/main/java/at/gv/egiz/moazs/config/MzsServiceConfig.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package at.gv.egiz.moazs.config;
-
-import at.gv.egiz.moazs.scheme.MzsService;
-import at.gv.zustellung.app2mzs.xsd.App2Mzs;
-import org.apache.cxf.Bus;
-import org.apache.cxf.jaxws.EndpointImpl;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-import javax.xml.ws.Endpoint;
-
-@Configuration
-public class MzsServiceConfig {
-
- @Bean
- @Autowired
- public Endpoint endpoint(Bus bus, MzsService mzsService, App2Mzs app2mzs) {
- EndpointImpl endpoint = new EndpointImpl(bus, mzsService);
- endpoint.setAddress("/");
- endpoint.setServiceName(app2mzs.getServiceName());
- endpoint.setWsdlLocation(app2mzs.getWSDLDocumentLocation().toString());
- endpoint.publish();
- return endpoint;
- }
-
- @Bean public App2Mzs app2mzs() {
- return new App2Mzs();
- }
-}
diff --git a/src/main/java/at/gv/egiz/moazs/config/PreprocessConfig.java b/src/main/java/at/gv/egiz/moazs/config/PreprocessConfig.java
index b24db28..76bfb30 100644
--- a/src/main/java/at/gv/egiz/moazs/config/PreprocessConfig.java
+++ b/src/main/java/at/gv/egiz/moazs/config/PreprocessConfig.java
@@ -1,6 +1,6 @@
package at.gv.egiz.moazs.config;
-import at.gv.egiz.moazs.scheme.MzsDeliveryRequestValidator;
+import at.gv.egiz.moazs.preprocess.MzsDeliveryRequestValidator;
import at.gv.egiz.moazs.preprocess.*;
import at.gv.zustellung.app2mzs.xsd.ConfigType;
import org.springframework.beans.factory.annotation.Autowired;
diff --git a/src/main/java/at/gv/egiz/moazs/config/RepositoryConfig.java b/src/main/java/at/gv/egiz/moazs/config/RepositoryConfig.java
new file mode 100644
index 0000000..ee73b9e
--- /dev/null
+++ b/src/main/java/at/gv/egiz/moazs/config/RepositoryConfig.java
@@ -0,0 +1,32 @@
+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;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Profile;
+
+import java.util.Map;
+
+@Configuration
+@Profile("!cluster")
+public class RepositoryConfig {
+
+ @Value("${repository.expiresAfterWrite}")
+ private int expiresAfterWrite;
+
+ @Bean
+ public BinaryRepository binaryRepository() {
+ return new InMemoryBinaryRepository(expiresAfterWrite);
+ }
+
+ @Bean
+ public Map<String, String> idSuffixes() {
+ return Map.of(NameSpace.MSG_DELIVERY_REQUEST_STATUS, RequestStatusResponse.getIdSuffix(),
+ NameSpace.MSG_DELIVERY_NOTIFICATION, NotificationResponse.getIdSuffix());
+ }
+}
diff --git a/src/main/java/at/gv/egiz/moazs/config/ServicesConfig.java b/src/main/java/at/gv/egiz/moazs/config/ServicesConfig.java
new file mode 100644
index 0000000..8e354ab
--- /dev/null
+++ b/src/main/java/at/gv/egiz/moazs/config/ServicesConfig.java
@@ -0,0 +1,46 @@
+package at.gv.egiz.moazs.config;
+
+import at.gv.egiz.moazs.service.MsgService;
+import at.gv.egiz.moazs.service.MzsService;
+import at.gv.egiz.moazs.util.EndpointFactory;
+import at.gv.egiz.moazs.util.StoreSOAPBodyBinaryInRepositoryInterceptor;
+import at.gv.zustellung.app2mzs.xsd.App2Mzs;
+import at.gv.zustellung.msg.xsd.Zuse2AppPortService;
+import org.apache.cxf.interceptor.Interceptor;
+import org.apache.cxf.message.Message;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import javax.xml.ws.Endpoint;
+
+@Configuration
+public class ServicesConfig {
+
+ @Autowired
+ private EndpointFactory endpointFactory;
+
+ @Bean
+ @Autowired
+ public Endpoint msgEndpoint(MsgService msgService,
+ Zuse2AppPortService zuse2app,
+ Interceptor<Message> msgInterceptor) {
+ return endpointFactory.create(msgService, zuse2app, msgInterceptor);
+ }
+
+ @Bean
+ @Autowired
+ public Endpoint mzsEndpoint(MzsService mzsService, App2Mzs app2mzs) {
+ return endpointFactory.create(mzsService, app2mzs);
+ }
+
+ @Bean
+ public Zuse2AppPortService zuse2App() {
+ return new Zuse2AppPortService();
+ }
+
+ @Bean public App2Mzs app2mzs() {
+ return new App2Mzs();
+ }
+
+}