Skip to content

Commit

Permalink
Merge pull request #102 from FraunhoferISST/refactor/namingconvention
Browse files Browse the repository at this point in the history
refactor: update naming conventions in EDC classes
  • Loading branch information
tom-rm-meyer-ISST authored Dec 6, 2023
2 parents 11f40b4 + 39fb50f commit 654a5b4
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 114 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ public class AssetCreatorCommandLineRunner implements CommandLineRunner {

@Override
public void run(String... args) throws Exception {
if (!edcAdapterService.doInitialAssetRegistration()) {
if (!edcAdapterService.registerAssetsInitially()) {
// retry
int retryDelaySeconds = 3;
log.warn("retrying initial asset registration in " + retryDelaySeconds + " seconds");
Thread.sleep(retryDelaySeconds * 1000);
log.warn("retry successful: " + edcAdapterService.doInitialAssetRegistration());
log.warn("retry successful: " + edcAdapterService.registerAssetsInitially());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.springframework.web.bind.annotation.*;

import java.io.IOException;
import java.net.URL;
import java.util.List;

/**
Expand All @@ -49,9 +48,9 @@ public class EdcController {
*/
@GetMapping("/catalog")
@CrossOrigin
public ResponseEntity<String> getEDCCatalog(@RequestParam String dspUrl) {
public ResponseEntity<String> getCatalog(@RequestParam String dspUrl) {
try {
var catalog = edcAdapter.getDSPCatalog(dspUrl);
var catalog = edcAdapter.getCatalog(dspUrl);
return ResponseEntity.ok(catalog.toPrettyString());
} catch (IOException e) {
log.warn(e.getMessage());
Expand All @@ -69,7 +68,7 @@ public ResponseEntity<String> getEDCCatalog(@RequestParam String dspUrl) {
@CrossOrigin
public ResponseEntity<String> getAssets(@RequestParam String assetId) {
try {
var result = edcAdapter.sendDspGetRequest(List.of("v3", "assets", assetId));
var result = edcAdapter.sendGetRequest(List.of("v3", "assets", assetId));
var stringData = result.body().string();
result.body().close();
return ResponseEntity.ok(stringData);
Expand Down
Loading

0 comments on commit 654a5b4

Please sign in to comment.