diff --git a/clearing-parent/gateway-api/src/main/java/service/GatewayService.java b/clearing-parent/gateway-api/src/main/java/service/GatewayService.java index f1a8abb11..596c41e7e 100644 --- a/clearing-parent/gateway-api/src/main/java/service/GatewayService.java +++ b/clearing-parent/gateway-api/src/main/java/service/GatewayService.java @@ -46,12 +46,37 @@ public class GatewayService extends QueueConsumer implements InitializingBean { } public RequestInfoUpdate requestOnDemandCompany(BaseRequest userRequest) { + log.debug("LOCM task received"); + RequestInfoUpdate requestInfoUpdate = userRoleVerification.validateRoleAndGetResult(userRequest); + if (requestInfoUpdate != null) return requestInfoUpdate; + + String url = formingInboundUrl(inboundServerSettings.getPathLOCM()); + String response = restTemplate.getForObject(url, String.class); + + log.debug("LOCM task complete, response: {}", response); return null; } public RequestInfoUpdate requestOnDemandSecurity(BaseRequest userRequest) { + log.debug("LOSC task received"); + RequestInfoUpdate requestInfoUpdate = userRoleVerification.validateRoleAndGetResult(userRequest); + if (requestInfoUpdate != null) return requestInfoUpdate; + + String url = formingInboundUrl(inboundServerSettings.getPathLOSC()); + String response = restTemplate.getForObject(url, String.class); + + log.debug("LOSC task complete, response: {}", response); return null; } + + private String formingInboundUrl(String path) { + return "%s://%s:%s/%s".formatted( + inboundServerSettings.getEnableSsl() ? "https" : "http", + inboundServerSettings.getHost(), + inboundServerSettings.getPort(), + path + ); + } }