Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,26 @@ public InfoContributor externalApiInfoContributor(
return builder -> {
try {
Map<String, Map<?,?>> versions = new HashMap<>();
versions.put(das.getName(),
Map.of("version", das.getVersion(), "description", das.getDescription()));
versions.put(dda.getName(),
Map.of("version", dda.getVersion(), "description", dda.getDescription()));
versions.put(esIndexer.getName(),
Map.of("version", esIndexer.getVersion(), "description", esIndexer.getDescription()));
versions.put(geonetwork.getName(),
Map.of("version", geonetwork.getVersion(), "description", geonetwork.getDescription()));

if(das.getName() != null) {
versions.put(das.getName(),
Map.of("version", das.getVersion(), "description", das.getDescription()));
}

if(dda.getName() != null) {
versions.put(dda.getName(),
Map.of("version", dda.getVersion(), "description", dda.getDescription()));
}

if(esIndexer.getName() != null) {
versions.put(esIndexer.getName(),
Map.of("version", esIndexer.getVersion(), "description", esIndexer.getDescription()));
}

if(geonetwork.getName() != null) {
versions.put(geonetwork.getName(),
Map.of("version", geonetwork.getVersion(), "description", geonetwork.getDescription()));
}

builder.withDetail(DEP_SERVICE, versions);
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,19 @@ public ResponseEntity<DatasetMetadata> getDatasetMetadata(String datasetId) {

@Override
public String getName() {
return this.appInfo.getOrDefault("application", Collections.emptyMap()).get("name").toString();
Object name = this.appInfo.getOrDefault("application", Collections.emptyMap()).getOrDefault("name", null);
return name != null ? name.toString() : null;
}

@Override
public String getVersion() {
return this.appInfo.getOrDefault("application", Collections.emptyMap()).get("version").toString();
Object version = this.appInfo.getOrDefault("application", Collections.emptyMap()).getOrDefault("version", null);
return version != null ? version.toString() : null;
}

@Override
public String getDescription() {
return this.appInfo.getOrDefault("application", Collections.emptyMap()).get("description").toString();
Object description = this.appInfo.getOrDefault("application", Collections.emptyMap()).getOrDefault("description", null);
return description != null ? description.toString() : null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,19 @@ public DdaService(DdaProperties properties, RestTemplate template) {

@Override
public String getName() {
return this.appInfo.getOrDefault("application", Collections.emptyMap()).get("name").toString();
Object name = this.appInfo.getOrDefault("application", Collections.emptyMap()).getOrDefault("name", null);
return name != null ? name.toString() : null;
}

@Override
public String getVersion() {
return this.appInfo.getOrDefault("application", Collections.emptyMap()).get("version").toString();
Object version = this.appInfo.getOrDefault("application", Collections.emptyMap()).getOrDefault("version", null);
return version != null ? version.toString() : null;
}

@Override
public String getDescription() {
return this.appInfo.getOrDefault("application", Collections.emptyMap()).get("description").toString();
Object description = this.appInfo.getOrDefault("application", Collections.emptyMap()).getOrDefault("description", null);
return description != null ? description.toString() : null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,19 @@ public Geonetwork(GNProperties properties, RestTemplate template) {

@Override
public String getName() {
return this.appInfo.getOrDefault("application", Collections.emptyMap()).get("name").toString();
Object name = this.appInfo.getOrDefault("application", Collections.emptyMap()).getOrDefault("name", null);
return name != null ? name.toString() : null;
}

@Override
public String getVersion() {
return this.appInfo.getOrDefault("application", Collections.emptyMap()).get("version").toString();
Object version = this.appInfo.getOrDefault("application", Collections.emptyMap()).getOrDefault("version", null);
return version != null ? version.toString() : null;
}

@Override
public String getDescription() {
return this.appInfo.getOrDefault("application", Collections.emptyMap()).get("description").toString();
Object description = this.appInfo.getOrDefault("application", Collections.emptyMap()).getOrDefault("description", null);
return description != null ? description.toString() : null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,19 @@ public EsIndexer(IndexerProperties properties, RestTemplate template) {

@Override
public String getName() {
return this.appInfo.getOrDefault("application", Collections.emptyMap()).get("name").toString();
Object name = this.appInfo.getOrDefault("application", Collections.emptyMap()).getOrDefault("name", null);
return name != null ? name.toString() : null;
}

@Override
public String getVersion() {
return this.appInfo.getOrDefault("application", Collections.emptyMap()).get("version").toString();
Object version = this.appInfo.getOrDefault("application", Collections.emptyMap()).getOrDefault("version", null);
return version != null ? version.toString() : null;
}

@Override
public String getDescription() {
return this.appInfo.getOrDefault("application", Collections.emptyMap()).get("description").toString();
Object description = this.appInfo.getOrDefault("application", Collections.emptyMap()).getOrDefault("description", null);
return description != null ? description.toString() : null;
}
}
Loading