From e8eacfa15127fb6a19d4711356c1b99129bb7566 Mon Sep 17 00:00:00 2001 From: Franck LECUYER Date: Thu, 1 Aug 2024 17:08:11 +0200 Subject: [PATCH] Add state estimation orchestrator server. Signed-off-by: Franck LECUYER --- .../org/gridsuite/gateway/GatewayConfig.java | 1 + .../gridsuite/gateway/ServiceURIsConfig.java | 3 ++ .../StateEstimationOrchestratorServer.java | 35 +++++++++++++++++++ src/main/resources/application-local.yml | 2 ++ 4 files changed, 41 insertions(+) create mode 100644 src/main/java/org/gridsuite/gateway/endpoints/StateEstimationOrchestratorServer.java diff --git a/src/main/java/org/gridsuite/gateway/GatewayConfig.java b/src/main/java/org/gridsuite/gateway/GatewayConfig.java index 2428fba..80e8e8e 100644 --- a/src/main/java/org/gridsuite/gateway/GatewayConfig.java +++ b/src/main/java/org/gridsuite/gateway/GatewayConfig.java @@ -61,6 +61,7 @@ public RouteLocator myRoutes(RouteLocatorBuilder builder, ApplicationContext con .route(p -> context.getBean(VoltageInitServer.class).getRoute(p)) .route(p -> context.getBean(ShortCircuitServer.class).getRoute(p)) .route(p -> context.getBean(StateEstimationServer.class).getRoute(p)) + .route(p -> context.getBean(StateEstimationOrchestratorServer.class).getRoute(p)) .build(); } } diff --git a/src/main/java/org/gridsuite/gateway/ServiceURIsConfig.java b/src/main/java/org/gridsuite/gateway/ServiceURIsConfig.java index 43dc8c8..bebe3b0 100644 --- a/src/main/java/org/gridsuite/gateway/ServiceURIsConfig.java +++ b/src/main/java/org/gridsuite/gateway/ServiceURIsConfig.java @@ -107,4 +107,7 @@ public class ServiceURIsConfig { @Value("${gridsuite.services.state-estimation-server.base-uri:http://state-estimation-server/}") String stateEstimationServerBaseUri; + + @Value("${gridsuite.services.state-estimation-orchestrator-server.base-uri:http://state-estimation-orchestrator-server/}") + String stateEstimationOrchestratorServerBaseUri; } diff --git a/src/main/java/org/gridsuite/gateway/endpoints/StateEstimationOrchestratorServer.java b/src/main/java/org/gridsuite/gateway/endpoints/StateEstimationOrchestratorServer.java new file mode 100644 index 0000000..33d59b4 --- /dev/null +++ b/src/main/java/org/gridsuite/gateway/endpoints/StateEstimationOrchestratorServer.java @@ -0,0 +1,35 @@ +/** + Copyright (c) 2024, RTE (http://www.rte-france.com) + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +package org.gridsuite.gateway.endpoints; + +import org.gridsuite.gateway.ServiceURIsConfig; +import org.springframework.stereotype.Component; + +/** + * @author Franck Lecuyer + */ +@Component(value = StateEstimationOrchestratorServer.ENDPOINT_NAME) +public class StateEstimationOrchestratorServer implements EndPointServer { + + public static final String ENDPOINT_NAME = "state-estimation-orchestrator"; + + private final ServiceURIsConfig servicesURIsConfig; + + public StateEstimationOrchestratorServer(ServiceURIsConfig servicesURIsConfig) { + this.servicesURIsConfig = servicesURIsConfig; + } + + @Override + public String getEndpointBaseUri() { + return servicesURIsConfig.getStateEstimationOrchestratorServerBaseUri(); + } + + @Override + public String getEndpointName() { + return ENDPOINT_NAME; + } +} diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml index 4389d46..49c471d 100644 --- a/src/main/resources/application-local.yml +++ b/src/main/resources/application-local.yml @@ -64,3 +64,5 @@ gridsuite: base-uri: http://localhost:5031 state-estimation-server: base-uri: http://localhost:5040 + state-estimation-orchestrator-server: + base-uri: http://localhost:5041