aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/gv/egiz/moazs/App2MzsService.java10
-rw-r--r--src/main/java/at/gv/egiz/moazs/DeliveryRequestAugmenter.java (renamed from src/main/java/at/gv/egiz/moazs/DeliveryPreprocessor.java)13
2 files changed, 9 insertions, 14 deletions
diff --git a/src/main/java/at/gv/egiz/moazs/App2MzsService.java b/src/main/java/at/gv/egiz/moazs/App2MzsService.java
index 2fcfd15..23cc0aa 100644
--- a/src/main/java/at/gv/egiz/moazs/App2MzsService.java
+++ b/src/main/java/at/gv/egiz/moazs/App2MzsService.java
@@ -32,14 +32,14 @@ public class App2MzsService implements App2MzsPortType {
private final DeliveryRepository repository;
private final DeliveryPipeline pipeline;
private final Mzs2AppClient appClient;
- private final DeliveryPreprocessor preprocessor;
+ private final DeliveryRequestAugmenter augmenter;
public App2MzsService(@Autowired DeliveryRepository repository, @Autowired DeliveryPipeline pipeline,
- @Autowired Mzs2AppClient appClient, @Autowired DeliveryPreprocessor preprocessor) {
+ @Autowired Mzs2AppClient appClient, @Autowired DeliveryRequestAugmenter augmenter) {
this.repository = repository;
this.pipeline = pipeline;
this.appClient = appClient;
- this.preprocessor = preprocessor;
+ this.augmenter = augmenter;
}
@Override
@@ -48,7 +48,7 @@ public class App2MzsService implements App2MzsPortType {
name = "DeliveryRequest")
DeliveryRequestType deliveryRequest) {
- var future = supplyAsync(() -> preprocessor.preProcess(deliveryRequest))
+ var future = supplyAsync(() -> augmenter.augment(deliveryRequest))
.thenApply(this::process);
try {
@@ -92,4 +92,4 @@ public class App2MzsService implements App2MzsPortType {
.build();
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/at/gv/egiz/moazs/DeliveryPreprocessor.java b/src/main/java/at/gv/egiz/moazs/DeliveryRequestAugmenter.java
index 5f75750..5c11ecb 100644
--- a/src/main/java/at/gv/egiz/moazs/DeliveryPreprocessor.java
+++ b/src/main/java/at/gv/egiz/moazs/DeliveryRequestAugmenter.java
@@ -14,20 +14,15 @@ import static org.springframework.util.Assert.isTrue;
import static org.springframework.util.Assert.notNull;
@Component
-public class DeliveryPreprocessor {
+public class DeliveryRequestAugmenter {
/**
- * Validates and augments an incoming {@code request}
+ * Augments an incoming {@code request} by filling gaps with config- or default parameters.
*
- * Validates a {@code request} to ensure the availability of all mandatory fields. Where possible, the method
- * augments the request with values taken from the app's configuration.
* @param request
- * @return validated and augmented request
+ * @return augmented request
*/
- public DeliveryRequestType preProcess(DeliveryRequestType request) {
-
- //validate(request);
-
+ public DeliveryRequestType augment(DeliveryRequestType request) {
return new DeliveryRequestTypeBuilder(request)
.withConfig(coalesce(request.getConfig(), initDefaultConfig()).get())
.build();