Skip to content

Commit

Permalink
Merge pull request eclipse-tractusx#489 from ds-mwesener/feature/TRAC…
Browse files Browse the repository at this point in the history
…EFOSS-2391-adding-catalog-query-to-facade

feature: TRACEFOSS-2391 Adding delegation of getCatalog to EDCCatalog…
  • Loading branch information
ds-jhartmann authored Aug 25, 2023
2 parents 20d04c7 + 9c44e39 commit f611209
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Added fetchCatalog to EDCCatalogFacade

## [3.3.4] - 2023-08-24
### Fixed
Expand Down
2 changes: 1 addition & 1 deletion DEPENDENCIES
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ maven/mavencentral/org.eclipse.tractusx.irs/irs-edc-client/0.0.2-SNAPSHOT, Apach
maven/mavencentral/org.eclipse.tractusx.irs/irs-ess/0.0.2-SNAPSHOT, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx.irs/irs-models/0.0.2-SNAPSHOT, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx.irs/irs-policy-store/0.0.2-SNAPSHOT, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx.irs/irs-registry-client/1.1.0-SNAPSHOT, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx.irs/irs-registry-client/1.1.1-SNAPSHOT, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.glassfish/jakarta.json/2.0.1, EPL-2.0 OR GPL-2.0-only with Classpath-exception-2.0, approved, ee4j.jsonp
maven/mavencentral/org.graalvm.sdk/graal-sdk/23.0.1, UPL-1.0, approved, #9850
maven/mavencentral/org.hamcrest/hamcrest-core/2.2, BSD-3-Clause, approved, clearlydefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.edc.catalog.spi.Catalog;
import org.eclipse.edc.catalog.spi.CatalogRequest;
import org.eclipse.edc.catalog.spi.Dataset;
import org.eclipse.edc.policy.model.Policy;
import org.eclipse.tractusx.irs.edc.client.configuration.JsonLdConfiguration;
import org.eclipse.tractusx.irs.edc.client.model.CatalogItem;

import org.springframework.stereotype.Component;

/**
Expand Down Expand Up @@ -74,6 +76,19 @@ private static CatalogItem createCatalogItem(final Catalog pageableCatalog, fina
return builder.build();
}

/**
* Fetches a list of {@link CatalogItem} objects based on the given {@link CatalogRequest}.
* This method communicates with the control plane client to retrieve the catalog
* and maps it to a list of catalog items.
*
* @param catalogRequest The request containing the parameters needed to fetch the catalog.
* @return A list of {@link CatalogItem} objects representing the items in the catalog.
*/
public List<CatalogItem> fetchCatalogItems(final CatalogRequest catalogRequest) {
final Catalog catalog = controlPlaneClient.getCatalog(catalogRequest);
return mapToCatalogItems(catalog);
}

private static List<CatalogItem> mapToCatalogItems(final Catalog catalog) {
if (catalog.getDatasets() == null) {
return List.of();
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<jar-plugin.version>3.3.0</jar-plugin.version>
<compiler-plugin.version>3.11.0</compiler-plugin.version>
<install-plugin.version>3.1.1</install-plugin.version>
<irs-registry-client.version>1.1.0-SNAPSHOT</irs-registry-client.version>
<irs-registry-client.version>1.1.1-SNAPSHOT</irs-registry-client.version>
</properties>

<dependencyManagement>
Expand Down

0 comments on commit f611209

Please sign in to comment.