Skip to content

Commit 54d59a7

Browse files
authored
Add voltage init server (#89)
Signed-off-by: Hugo Marcellin <[email protected]>
1 parent 01c49c1 commit 54d59a7

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed

src/main/java/org/gridsuite/gateway/GatewayConfig.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public RouteLocator myRoutes(RouteLocatorBuilder builder, ApplicationContext con
5858
.route(p -> context.getBean(SecurityAnalysisServer.class).getRoute(p))
5959
.route(p -> context.getBean(DynamicSimulationServer.class).getRoute(p))
6060
.route(p -> context.getBean(CaseImportServer.class).getRoute(p))
61+
.route(p -> context.getBean(VoltageInitServer.class).getRoute(p))
6162
.build();
6263
}
6364
}

src/main/java/org/gridsuite/gateway/ServiceURIsConfig.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,7 @@ public class ServiceURIsConfig {
9898

9999
@Value("${gridsuite.services.case-import-server.base-uri:http://case-import-server/}")
100100
String caseImportServerBaseUri;
101+
102+
@Value("${gridsuite.services.voltage-init-server.base-uri:http://voltage-init-server/}")
103+
String voltageInitServerBaseUri;
101104
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
Copyright (c) 2023, RTE (http://www.rte-france.com)
3+
This Source Code Form is subject to the terms of the Mozilla Public
4+
License, v. 2.0. If a copy of the MPL was not distributed with this
5+
file, You can obtain one at http://mozilla.org/MPL/2.0/.
6+
*/
7+
package org.gridsuite.gateway.endpoints;
8+
9+
import org.gridsuite.gateway.ServiceURIsConfig;
10+
import org.springframework.stereotype.Component;
11+
12+
13+
/**
14+
* @author Hugo Marcellin <hugo.marcelin at rte-france.com>
15+
*/
16+
@Component(value = VoltageInitServer.ENDPOINT_NAME)
17+
public class VoltageInitServer implements EndPointServer {
18+
19+
public static final String ENDPOINT_NAME = "voltage-init";
20+
21+
private final ServiceURIsConfig servicesURIsConfig;
22+
23+
public VoltageInitServer(ServiceURIsConfig servicesURIsConfig) {
24+
this.servicesURIsConfig = servicesURIsConfig;
25+
}
26+
27+
@Override
28+
public String getEndpointBaseUri() {
29+
return servicesURIsConfig.getVoltageInitServerBaseUri();
30+
}
31+
32+
@Override
33+
public String getEndpointName() {
34+
return ENDPOINT_NAME;
35+
}
36+
}

src/main/resources/application-local.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,5 @@ gridsuite:
5858
base-uri: http://localhost:5032
5959
case-import-server:
6060
base-uri: http://localhost:5039
61+
voltage-init-server:
62+
base-uri: http://localhost:5038

0 commit comments

Comments
 (0)