diff --git a/CHANGELOG.md b/CHANGELOG.md index 172793e337..c2ee567f8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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.3] - 2023-08-11 ### Changed diff --git a/DEPENDENCIES b/DEPENDENCIES index f033c05c3c..d731363801 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -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 diff --git a/irs-edc-client/src/main/java/org/eclipse/tractusx/irs/edc/client/EDCCatalogFacade.java b/irs-edc-client/src/main/java/org/eclipse/tractusx/irs/edc/client/EDCCatalogFacade.java index 69ee8e7317..5aa21d692f 100644 --- a/irs-edc-client/src/main/java/org/eclipse/tractusx/irs/edc/client/EDCCatalogFacade.java +++ b/irs-edc-client/src/main/java/org/eclipse/tractusx/irs/edc/client/EDCCatalogFacade.java @@ -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; /** @@ -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 fetchCatalogItems(final CatalogRequest catalogRequest) { + final Catalog catalog = controlPlaneClient.getCatalog(catalogRequest); + return mapToCatalogItems(catalog); + } + private static List mapToCatalogItems(final Catalog catalog) { if (catalog.getDatasets() == null) { return List.of(); diff --git a/pom.xml b/pom.xml index a979d84d6c..9cc74307ce 100644 --- a/pom.xml +++ b/pom.xml @@ -66,7 +66,7 @@ 3.3.0 3.11.0 3.1.1 - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT