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.java43
1 files changed, 24 insertions, 19 deletions
diff --git a/src/main/java/at/gv/egiz/moazs/App2MzsService.java b/src/main/java/at/gv/egiz/moazs/App2MzsService.java
index 8626c24..66ab795 100644
--- a/src/main/java/at/gv/egiz/moazs/App2MzsService.java
+++ b/src/main/java/at/gv/egiz/moazs/App2MzsService.java
@@ -1,9 +1,16 @@
package at.gv.egiz.moazs;
+import at.gv.e_government.reference.namespace.zustellung.msg.phase2._20181206_.DeliveryAnswerType;
+import at.gv.e_government.reference.namespace.zustellung.msg.phase2._20181206_.DeliveryAnswerType.DeliveryAnswerTypeBuilder;
import at.gv.e_government.reference.namespace.zustellung.msg.phase2._20181206_.DeliveryRequestStatusType;
+import at.gv.e_government.reference.namespace.zustellung.msg.phase2._20181206_.DeliveryRequestStatusType.DeliveryRequestStatusTypeBuilder;
+import at.gv.e_government.reference.namespace.zustellung.msg.phase2._20181206_.DeliveryRequestStatusType.Error.ErrorBuilder;
+import at.gv.e_government.reference.namespace.zustellung.msg.phase2._20181206_.ErrorInfoType;
+import at.gv.e_government.reference.namespace.zustellung.msg.phase2._20181206_.ErrorInfoType.ErrorInfoTypeBuilder;
import at.gv.e_government.reference.namespace.zustellung.msg.phase2._20181206_.ObjectFactory;
import at.gv.e_government.reference.namespace.zustellung.mzs.app2mzs.App2MzsPortType;
import at.gv.e_government.reference.namespace.zustellung.mzs.app2mzs_.DeliveryRequestType;
+import at.gv.e_government.reference.namespace.zustellung.mzs.app2mzs_.DeliveryRequestType.DeliveryRequestTypeBuilder;
import at.gv.egiz.moazs.pipeline.DeliveryPipeline;
import at.gv.egiz.moazs.repository.DeliveryRepository;
import org.slf4j.Logger;
@@ -66,32 +73,30 @@ public class App2MzsService implements App2MzsPortType {
private DeliveryRequestStatusType generatePartialSuccessResponse(String appDeliveryId, String message) {
- var partialSuccess = objectFactory.createDeliveryAnswerType();
- partialSuccess.setAppDeliveryID(appDeliveryId);
+ var answer = new DeliveryAnswerTypeBuilder()
+ .withAppDeliveryID(appDeliveryId)
+ .build();
- var response = objectFactory.createDeliveryRequestStatusType();
- response.setPartialSuccess(partialSuccess);
-
- response.setSignature(null);
-
- return response;
+ return new DeliveryRequestStatusTypeBuilder()
+ .withPartialSuccess(answer)
+ .build();
}
private DeliveryRequestStatusType generateErrorResponse(String appDeliveryId, String message) {
- var error = objectFactory.createDeliveryRequestStatusTypeError();
- error.setAppDeliveryID(appDeliveryId);
-
- var info = objectFactory.createErrorInfoType();
- info.setCode("500");
- info.setText(message);
- error.setErrorInfo(info);
+ var info = new ErrorInfoTypeBuilder()
+ .withCode("500")
+ .withText(message)
+ .build();
- var response = objectFactory.createDeliveryRequestStatusType();
- response.setError(error);
- response.setSignature(null);
+ var error = new ErrorBuilder()
+ .withAppDeliveryID(appDeliveryId)
+ .withErrorInfo(info)
+ .build();
- return response;
+ return new DeliveryRequestStatusTypeBuilder()
+ .withError(error)
+ .build();
}
private DeliveryRequestStatusType process(DeliveryRequestType deliveryRequest) throws RuntimeException {