diff options
author | Christof Rabensteiner <christof.rabensteiner@iaik.tugraz.at> | 2019-09-03 13:06:48 +0200 |
---|---|---|
committer | Christof Rabensteiner <christof.rabensteiner@iaik.tugraz.at> | 2019-09-03 13:06:48 +0200 |
commit | 3b114adee71e1e2477898d55c91cd573f0e48857 (patch) | |
tree | a5ba7afa71747adb6644c019ad939af90aea4cdf | |
parent | f6990a4f7cf824b4859ebbf08cbddb2ba2607836 (diff) | |
download | moa-zs-3b114adee71e1e2477898d55c91cd573f0e48857.tar.gz moa-zs-3b114adee71e1e2477898d55c91cd573f0e48857.tar.bz2 moa-zs-3b114adee71e1e2477898d55c91cd573f0e48857.zip |
Rename MzsClient to AppClient
...since it's a client that communicates with the app.
11 files changed, 18 insertions, 18 deletions
diff --git a/docs/spec.md b/docs/spec.md index eb71c60..9c815c7 100644 --- a/docs/spec.md +++ b/docs/spec.md @@ -178,7 +178,7 @@ You find a description and examples of the individual parameters in `application log-response: <boolean> forward-response-to-service: active: <boolean> - mzs-client: + app-client: url: <string> connection-timeout: <integer> receive-timeout: <integer> diff --git a/src/main/java/at/gv/egiz/moazs/backend/ForwardResponseToServiceSink.java b/src/main/java/at/gv/egiz/moazs/backend/ForwardResponseToServiceSink.java index b64c186..d870aa8 100644 --- a/src/main/java/at/gv/egiz/moazs/backend/ForwardResponseToServiceSink.java +++ b/src/main/java/at/gv/egiz/moazs/backend/ForwardResponseToServiceSink.java @@ -34,6 +34,6 @@ public class ForwardResponseToServiceSink { msgResponse.getRootElementLocalPart(), msgResponse.getAppDeliveryID(), params.getURL()); var binaryResponse = repository.retrieveBinaryResponse(msgResponse.getResponseID()); Mzs2AppPortType client = factory.create(params, Mzs2AppPortType.class); - return msgResponse.sendToMzsClient(converter, binaryResponse, client); + return msgResponse.sendToAppClient(converter, binaryResponse, client); } } diff --git a/src/main/java/at/gv/egiz/moazs/backend/MsgResponseSinkHub.java b/src/main/java/at/gv/egiz/moazs/backend/MsgResponseSinkHub.java index 46b0101..be8703c 100644 --- a/src/main/java/at/gv/egiz/moazs/backend/MsgResponseSinkHub.java +++ b/src/main/java/at/gv/egiz/moazs/backend/MsgResponseSinkHub.java @@ -44,7 +44,7 @@ public class MsgResponseSinkHub { if (sinkParams.getForwardResponseToService().isActive()) { supplyAsync(() -> forwardResponseSink.send( - msgResponse, sinkParams.getForwardResponseToService().getMzsClient())); + msgResponse, sinkParams.getForwardResponseToService().getAppClient())); } } diff --git a/src/main/java/at/gv/egiz/moazs/preprocess/ConfigUtil.java b/src/main/java/at/gv/egiz/moazs/preprocess/ConfigUtil.java index 48c1605..d256616 100644 --- a/src/main/java/at/gv/egiz/moazs/preprocess/ConfigUtil.java +++ b/src/main/java/at/gv/egiz/moazs/preprocess/ConfigUtil.java @@ -43,7 +43,7 @@ public class ConfigUtil { public static final String ACTIVE_KEY = "active"; public static final String SAVE_RESPONSE_TO_FILE_PATH_KEY = "path"; public static final String FORWARD_RESPONSE_TO_SERVICE_KEY = "forward-response-to-service"; - public static final String MZS_CLIENT_KEY = "mzs-client"; + public static final String APP_CLIENT_KEY = "app-client"; public static final String SERVICE_TIMEOUT_KEY = "service-timeout"; public static final String CUSTOM_HTTP_HEADERS_KEY = "custom-http-headers"; @@ -174,13 +174,13 @@ public class ConfigUtil { private ForwardResponseToServiceType buildForwardResponse(Map<String, String> params) { var isActive = booleanOrNull(params.get(ACTIVE_KEY)); - var mzsClientParams = filterMapByPrefix(params, MZS_CLIENT_KEY); - ClientType mzsClient = mzsClientParams.isEmpty() - ? null : buildClient(mzsClientParams); + var appClientParams = filterMapByPrefix(params, APP_CLIENT_KEY); + ClientType appClient = appClientParams.isEmpty() + ? null : buildClient(appClientParams); return forwardResponseToServiceTypeBuilder() .withActive(isActive) - .withMzsClient(mzsClient) + .withAppClient(appClient) .build(); } @@ -366,8 +366,8 @@ public class ConfigUtil { builder.withActive(primary.isActive()); } - if (primary.getMzsClient() != null) { - builder.withMzsClient(merge(primary.getMzsClient(), fallback.getMzsClient())); + if (primary.getAppClient() != null) { + builder.withAppClient(merge(primary.getAppClient(), fallback.getAppClient())); } return builder.build(); diff --git a/src/main/java/at/gv/egiz/moazs/preprocess/MzsDeliveryRequestValidator.java b/src/main/java/at/gv/egiz/moazs/preprocess/MzsDeliveryRequestValidator.java index b0568d7..127d067 100644 --- a/src/main/java/at/gv/egiz/moazs/preprocess/MzsDeliveryRequestValidator.java +++ b/src/main/java/at/gv/egiz/moazs/preprocess/MzsDeliveryRequestValidator.java @@ -158,7 +158,7 @@ public class MzsDeliveryRequestValidator { if (forwardSink.isActive()) { try { - isClientConfigured(forwardSink.getMzsClient()); + isClientConfigured(forwardSink.getAppClient()); } catch (MoaZSException e) { throw mzse("ForwardResponseToService", e.getMessage()); } diff --git a/src/main/java/at/gv/egiz/moazs/scheme/MsgResponse.java b/src/main/java/at/gv/egiz/moazs/scheme/MsgResponse.java index f105278..f443594 100644 --- a/src/main/java/at/gv/egiz/moazs/scheme/MsgResponse.java +++ b/src/main/java/at/gv/egiz/moazs/scheme/MsgResponse.java @@ -41,6 +41,6 @@ public abstract class MsgResponse <T> { * @return Deep Copy of response but of "error" type */ public abstract MsgResponse<T> generateError(String text, String code); - public abstract CompletableFuture<Void> sendToMzsClient(Msg2MzsConverter converter, Optional<byte[]> signedStatus, Mzs2AppPortType client); + public abstract CompletableFuture<Void> sendToAppClient(Msg2MzsConverter converter, Optional<byte[]> signedStatus, Mzs2AppPortType client); } diff --git a/src/main/java/at/gv/egiz/moazs/scheme/NotificationResponse.java b/src/main/java/at/gv/egiz/moazs/scheme/NotificationResponse.java index 4e7abae..85e7737 100644 --- a/src/main/java/at/gv/egiz/moazs/scheme/NotificationResponse.java +++ b/src/main/java/at/gv/egiz/moazs/scheme/NotificationResponse.java @@ -74,7 +74,7 @@ public class NotificationResponse extends MsgResponse<DeliveryNotificationType> } @Override - public CompletableFuture<Void> sendToMzsClient(Msg2MzsConverter converter, Optional<byte[]> signedNotification, Mzs2AppPortType client) { + public CompletableFuture<Void> sendToAppClient(Msg2MzsConverter converter, Optional<byte[]> signedNotification, Mzs2AppPortType client) { var mzsNotification = converter.convert(notification, signedNotification); client.forwardNotification(mzsNotification); return CompletableFuture.completedFuture(null); diff --git a/src/main/java/at/gv/egiz/moazs/scheme/RequestStatusResponse.java b/src/main/java/at/gv/egiz/moazs/scheme/RequestStatusResponse.java index 8a4b590..c647103 100644 --- a/src/main/java/at/gv/egiz/moazs/scheme/RequestStatusResponse.java +++ b/src/main/java/at/gv/egiz/moazs/scheme/RequestStatusResponse.java @@ -110,7 +110,7 @@ public class RequestStatusResponse extends MsgResponse<DeliveryRequestStatusType } @Override - public CompletableFuture<Void> sendToMzsClient(Msg2MzsConverter converter, Optional<byte[]> signedStatus, Mzs2AppPortType client) { + public CompletableFuture<Void> sendToAppClient(Msg2MzsConverter converter, Optional<byte[]> signedStatus, Mzs2AppPortType client) { var msgStatus = converter.convert(status, signedStatus); client.forwardStatus(msgStatus); return CompletableFuture.completedFuture(null); diff --git a/src/main/resources/mzs/app2mzs.xsd b/src/main/resources/mzs/app2mzs.xsd index 7ae243b..c586606 100644 --- a/src/main/resources/mzs/app2mzs.xsd +++ b/src/main/resources/mzs/app2mzs.xsd @@ -146,7 +146,7 @@ <xs:complexType name="ForwardResponseToServiceType"> <xs:sequence> <xs:element name="Active" type="xs:boolean" minOccurs="0"/> - <xs:element name="MzsClient" type="ClientType" minOccurs="0"/> + <xs:element name="AppClient" type="ClientType" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:element name="DeliveryResponse" type="DeliveryResponseType"/> diff --git a/src/test/resources/at/gv/egiz/moazs/ITEndToEndTest/mzs-delivery-request.xml b/src/test/resources/at/gv/egiz/moazs/ITEndToEndTest/mzs-delivery-request.xml index c397a0d..6fd1d7c 100644 --- a/src/test/resources/at/gv/egiz/moazs/ITEndToEndTest/mzs-delivery-request.xml +++ b/src/test/resources/at/gv/egiz/moazs/ITEndToEndTest/mzs-delivery-request.xml @@ -67,11 +67,11 @@ <mzs:LogResponse>true</mzs:LogResponse> <mzs:ForwardResponseToService> <mzs:Active>true</mzs:Active> - <mzs:MzsClient> + <mzs:AppClient> <mzs:URL>http://localhost/appurl</mzs:URL> <mzs:ConnectionTimeout>0</mzs:ConnectionTimeout> <mzs:ReceiveTimeout>0</mzs:ReceiveTimeout> - </mzs:MzsClient> + </mzs:AppClient> </mzs:ForwardResponseToService> </mzs:MsgResponseSinks> </mzs:Config> diff --git a/src/test/resources/config/application.yaml b/src/test/resources/config/application.yaml index f8e360e..593b851 100644 --- a/src/test/resources/config/application.yaml +++ b/src/test/resources/config/application.yaml @@ -131,7 +131,7 @@ delivery-request-configuration-profiles: # Mandatory active: false # Mandatory if activated - mzs-client: + app-client: url: http://service.which.implements.mzs2app.wsdl/services/ # connection-timeout # receive-timeout |