Skip to content

Commit 103a214

Browse files
authored
Add network map server link (#146)
Signed-off-by: Hugo Marcellin <[email protected]>
1 parent aa23476 commit 103a214

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-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
@@ -44,6 +44,7 @@ public RouteLocator myRoutes(RouteLocatorBuilder builder, ApplicationContext con
4444
.route(p -> context.getBean(DynamicMappingServer.class).getRoute(p))
4545
.route(p -> context.getBean(FilterServer.class).getRoute(p))
4646
.route(p -> context.getBean(NetworkModificationServer.class).getRoute(p))
47+
.route(p -> context.getBean(NetworkMapServer.class).getRoute(p))
4748
.route(p -> context.getBean(NetworkConversionServer.class).getRoute(p))
4849
.route(p -> context.getBean(UserAdminServer.class).getRoute(p))
4950
.route(p -> context.getBean(SensitivityAnalysisServer.class).getRoute(p))

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ public class ServiceURIsConfig {
6969
@Value("${gridsuite.services.network-modification-server.base-uri:http://network-modification-server/}")
7070
String networkModificationServerBaseUri;
7171

72+
@Value("${gridsuite.services.network-map-server.base-uri:http://network-map-server/}")
73+
String networkMapServerBaseUri;
74+
7275
@Value("${powsybl.services.network-conversion-server.base-uri:http://network-conversion-server/}")
7376
String networkConversionServerBaseUri;
7477

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/**
2+
* Copyright (c) 2025, 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+
@Component(value = NetworkMapServer.ENDPOINT_NAME)
13+
public class NetworkMapServer implements EndPointServer {
14+
15+
public static final String ENDPOINT_NAME = "network-map";
16+
17+
private final ServiceURIsConfig servicesURIsConfig;
18+
19+
public NetworkMapServer(ServiceURIsConfig servicesURIsConfig) {
20+
this.servicesURIsConfig = servicesURIsConfig;
21+
}
22+
23+
@Override
24+
public String getEndpointBaseUri() {
25+
return servicesURIsConfig.getNetworkMapServerBaseUri();
26+
}
27+
28+
@Override
29+
public String getEndpointName() {
30+
return ENDPOINT_NAME;
31+
}
32+
}

src/main/resources/application-local.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ gridsuite:
4040
base-uri: http://localhost:5029
4141
network-modification-server:
4242
base-uri: http://localhost:5007
43+
network-map-server:
44+
base-uri: http://localhost:5006
4345
odre-server:
4446
base-uri: http://localhost:8090
4547
geo-data-server:

0 commit comments

Comments
 (0)