-
Notifications
You must be signed in to change notification settings - Fork 0
[GRD-3891] refactor monitor worker server services structure #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| /** | ||
| * Copyright (c) 2026, 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.monitor.worker.server.services.external.client; | ||
|
|
||
| import com.powsybl.cases.datasource.CaseDataSourceClient; | ||
| import org.springframework.beans.factory.annotation.Value; | ||
| import org.springframework.boot.web.client.RestTemplateBuilder; | ||
| import org.springframework.stereotype.Service; | ||
| import org.springframework.web.client.RestTemplate; | ||
|
|
||
| import java.util.UUID; | ||
|
|
||
| /** | ||
| * @author Antoine Bouhours <antoine.bouhours at rte-france.com> | ||
| */ | ||
| @Service | ||
| public class CaseRestClient { | ||
|
|
||
| private final RestTemplate caseServerRest; | ||
|
|
||
| public CaseRestClient(@Value("${powsybl.services.case-server.base-uri:http://case-server/}") String caseServerBaseUri, | ||
| RestTemplateBuilder restTemplateBuilder) { | ||
| this.caseServerRest = restTemplateBuilder.rootUri(caseServerBaseUri).build(); | ||
|
Comment on lines
+25
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Search for all `@Value` annotations with service base-uri properties
rg -n '@Value.*services.*base-uri' --type java -A 1Repository: gridsuite/monitor-core Length of output: 3236 Use All other REST clients in the codebase use the 🤖 Prompt for AI Agents |
||
| } | ||
|
|
||
| public CaseDataSourceClient getCaseDataSource(UUID caseUuid) { | ||
| return new CaseDataSourceClient(caseServerRest, caseUuid); | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing SPDX license identifier.
Other files modified or added in this PR include
SPDX-License-Identifier: MPL-2.0in the license header (e.g.,NetworkModificationRestClient.javaline 6,FilterRestClient.javaline 6). This new file omits it.Proposed fix
* 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/. + * SPDX-License-Identifier: MPL-2.0 */📝 Committable suggestion
🤖 Prompt for AI Agents