Skip to content

Commit 53de7d7

Browse files
authored
add case-import-server (#84)
Signed-off-by: Abdelsalem <[email protected]>
1 parent 3525eb8 commit 53de7d7

File tree

4 files changed

+41
-0
lines changed

4 files changed

+41
-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
@@ -57,6 +57,7 @@ public RouteLocator myRoutes(RouteLocatorBuilder builder, ApplicationContext con
5757
.route(p -> context.getBean(LoadFlowServer.class).getRoute(p))
5858
.route(p -> context.getBean(SecurityAnalysisServer.class).getRoute(p))
5959
.route(p -> context.getBean(DynamicSimulationServer.class).getRoute(p))
60+
.route(p -> context.getBean(CaseImportServer.class).getRoute(p))
6061
.build();
6162
}
6263
}

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

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

9696
@Value("${gridsuite.services.dynamic-simulation-server.base-uri:http://dynamic-simulation-server/}")
9797
String dynamicSimulationServerBaseUri;
98+
99+
@Value("${gridsuite.services.case-import-server.base-uri:http://case-import-server/}")
100+
String caseImportServerBaseUri;
98101
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
* @author Abdelsalem Hedhili <abdelsalem.hedhili at rte-france.com>
14+
*/
15+
@Component(value = CaseImportServer.ENDPOINT_NAME)
16+
public class CaseImportServer implements EndPointServer {
17+
18+
public static final String ENDPOINT_NAME = "case-import";
19+
20+
private final ServiceURIsConfig servicesURIsConfig;
21+
22+
public CaseImportServer(ServiceURIsConfig servicesURIsConfig) {
23+
this.servicesURIsConfig = servicesURIsConfig;
24+
}
25+
26+
@Override
27+
public String getEndpointBaseUri() {
28+
return servicesURIsConfig.getCaseImportServerBaseUri();
29+
}
30+
31+
@Override
32+
public String getEndpointName() {
33+
return ENDPOINT_NAME;
34+
}
35+
}

src/main/resources/application-local.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,5 @@ gridsuite:
5656
base-uri: http://localhost:5023
5757
dynamic-simulation-server:
5858
base-uri: http://localhost:5032
59+
case-import-server:
60+
base-uri: http://localhost:5039

0 commit comments

Comments
 (0)