diff options
author | Christof Rabensteiner <christof.rabensteiner@iaik.tugraz.at> | 2019-05-10 11:22:46 +0200 |
---|---|---|
committer | Christof Rabensteiner <christof.rabensteiner@iaik.tugraz.at> | 2019-05-10 11:22:46 +0200 |
commit | dfbb2fb7e55eb99b777cc4d5f5fc5e2aca8f76c6 (patch) | |
tree | 6e9ca1515b18a77436ebd3283da505af2ef42ef3 /src/main/java/at/gv/egiz | |
parent | 0bb01c6701394d438ebdd94b4488a64d59f4e50b (diff) | |
download | moa-zs-dfbb2fb7e55eb99b777cc4d5f5fc5e2aca8f76c6.tar.gz moa-zs-dfbb2fb7e55eb99b777cc4d5f5fc5e2aca8f76c6.tar.bz2 moa-zs-dfbb2fb7e55eb99b777cc4d5f5fc5e2aca8f76c6.zip |
Refactor: Rename DeliveryPreprocessor to Augmenter
- Reason: Preprocessor does not perform any validation anymore!
Diffstat (limited to 'src/main/java/at/gv/egiz')
-rw-r--r-- | src/main/java/at/gv/egiz/moazs/App2MzsService.java | 10 | ||||
-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(); |