diff --git a/core/common/connector-core/build.gradle.kts b/core/common/connector-core/build.gradle.kts index b531fb08e27..fd293f7a8c6 100644 --- a/core/common/connector-core/build.gradle.kts +++ b/core/common/connector-core/build.gradle.kts @@ -28,12 +28,13 @@ dependencies { api(project(":spi:common:transform-spi")) api(project(":spi:common:validator-spi")) - implementation(project(":core:common:policy-engine")) - implementation(project(":core:common:state-machine")) - implementation(project(":core:common:transform-core")) + implementation(project(":core:common:lib:policy-engine-lib")) implementation(project(":core:common:util")) + implementation(project(":core:common:transform-core")) implementation(project(":core:common:validator-core")) + implementation(project(":core:common:lib:state-machine-lib")) implementation(project(":core:common:lib:boot-lib")) + implementation(project(":core:common:lib:query-lib")) implementation(project(":core:common:lib:http-lib")) implementation(project(":core:common:lib:keys-lib")) diff --git a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/CoreServicesExtension.java b/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/CoreServicesExtension.java index 67c81bf44c0..50cd46c8e7b 100644 --- a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/CoreServicesExtension.java +++ b/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/CoreServicesExtension.java @@ -14,14 +14,13 @@ package org.eclipse.edc.connector.core; +import org.eclipse.edc.boot.health.HealthCheckServiceConfiguration; +import org.eclipse.edc.boot.health.HealthCheckServiceImpl; import org.eclipse.edc.connector.core.base.CommandHandlerRegistryImpl; import org.eclipse.edc.connector.core.base.RemoteMessageDispatcherRegistryImpl; import org.eclipse.edc.connector.core.base.agent.ParticipantAgentServiceImpl; import org.eclipse.edc.connector.core.event.EventExecutorServiceContainer; import org.eclipse.edc.connector.core.event.EventRouterImpl; -import org.eclipse.edc.connector.core.health.HealthCheckServiceConfiguration; -import org.eclipse.edc.connector.core.health.HealthCheckServiceImpl; -import org.eclipse.edc.connector.core.store.CriterionOperatorRegistryImpl; import org.eclipse.edc.connector.core.validator.DataAddressValidatorRegistryImpl; import org.eclipse.edc.connector.core.validator.JsonObjectValidatorRegistryImpl; import org.eclipse.edc.core.transform.TypeTransformerRegistryImpl; @@ -31,6 +30,7 @@ import org.eclipse.edc.policy.engine.spi.PolicyEngine; import org.eclipse.edc.policy.engine.spi.RuleBindingRegistry; import org.eclipse.edc.policy.model.PolicyRegistrationTypes; +import org.eclipse.edc.query.CriterionOperatorRegistryImpl; import org.eclipse.edc.runtime.metamodel.annotation.BaseExtension; import org.eclipse.edc.runtime.metamodel.annotation.Extension; import org.eclipse.edc.runtime.metamodel.annotation.Inject; @@ -97,7 +97,6 @@ public class CoreServicesExtension implements ServiceExtension { private HealthCheckServiceImpl healthCheckService; private RuleBindingRegistry ruleBindingRegistry; - @Override public String name() { return NAME; @@ -167,7 +166,6 @@ public EventRouter eventRouter(ServiceExtensionContext context) { return new EventRouterImpl(context.getMonitor(), eventExecutorServiceContainer.getExecutorService()); } - @Provider public HealthCheckService healthCheckService() { return healthCheckService; diff --git a/core/common/edr-store-core/build.gradle.kts b/core/common/edr-store-core/build.gradle.kts index 4e5cbea9b00..ac6e22737a5 100644 --- a/core/common/edr-store-core/build.gradle.kts +++ b/core/common/edr-store-core/build.gradle.kts @@ -19,10 +19,13 @@ plugins { dependencies { api(project(":spi:common:edr-store-spi")) - implementation(project(":core:common:connector-core")) + + implementation(project(":spi:common:transaction-spi")) + implementation(project(":core:common:lib:store-lib")) testImplementation(project(":core:common:junit")) testImplementation(project(":core:common:lib:boot-lib")) + testImplementation(project(":core:common:lib:query-lib")) testImplementation(testFixtures(project(":spi:common:edr-store-spi"))) } diff --git a/core/common/edr-store-core/src/main/java/org/eclipse/edc/core/edr/defaults/InMemoryEndpointDataReferenceEntryIndex.java b/core/common/edr-store-core/src/main/java/org/eclipse/edc/core/edr/defaults/InMemoryEndpointDataReferenceEntryIndex.java index 1e2ef1a344b..feffc0ad0f4 100644 --- a/core/common/edr-store-core/src/main/java/org/eclipse/edc/core/edr/defaults/InMemoryEndpointDataReferenceEntryIndex.java +++ b/core/common/edr-store-core/src/main/java/org/eclipse/edc/core/edr/defaults/InMemoryEndpointDataReferenceEntryIndex.java @@ -14,13 +14,13 @@ package org.eclipse.edc.core.edr.defaults; -import org.eclipse.edc.connector.core.store.ReflectionBasedQueryResolver; import org.eclipse.edc.edr.spi.store.EndpointDataReferenceEntryIndex; import org.eclipse.edc.edr.spi.types.EndpointDataReferenceEntry; import org.eclipse.edc.spi.query.CriterionOperatorRegistry; import org.eclipse.edc.spi.query.QueryResolver; import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.spi.result.StoreResult; +import org.eclipse.edc.store.ReflectionBasedQueryResolver; import org.jetbrains.annotations.Nullable; import java.util.List; diff --git a/core/common/edr-store-core/src/test/java/org/eclipse/edc/core/edr/defaults/InMemoryEndpointDataReferenceEntryStoreTest.java b/core/common/edr-store-core/src/test/java/org/eclipse/edc/core/edr/defaults/InMemoryEndpointDataReferenceEntryStoreTest.java index ad029b8f0c5..79c7c91d4a7 100644 --- a/core/common/edr-store-core/src/test/java/org/eclipse/edc/core/edr/defaults/InMemoryEndpointDataReferenceEntryStoreTest.java +++ b/core/common/edr-store-core/src/test/java/org/eclipse/edc/core/edr/defaults/InMemoryEndpointDataReferenceEntryStoreTest.java @@ -14,8 +14,8 @@ package org.eclipse.edc.core.edr.defaults; -import org.eclipse.edc.connector.core.store.CriterionOperatorRegistryImpl; import org.eclipse.edc.edr.spi.store.EndpointDataReferenceEntryIndex; +import org.eclipse.edc.query.CriterionOperatorRegistryImpl; import org.eclipse.tractusx.edc.edr.spi.store.EndpointDataReferenceEntryIndexTestBase; public class InMemoryEndpointDataReferenceEntryStoreTest extends EndpointDataReferenceEntryIndexTestBase { diff --git a/core/common/edr-store-core/src/test/java/org/eclipse/edc/core/edr/store/EndpointDataReferenceStoreImplTest.java b/core/common/edr-store-core/src/test/java/org/eclipse/edc/core/edr/store/EndpointDataReferenceStoreImplTest.java index 228048e0e1a..ee943ae14f2 100644 --- a/core/common/edr-store-core/src/test/java/org/eclipse/edc/core/edr/store/EndpointDataReferenceStoreImplTest.java +++ b/core/common/edr-store-core/src/test/java/org/eclipse/edc/core/edr/store/EndpointDataReferenceStoreImplTest.java @@ -16,10 +16,10 @@ import com.fasterxml.jackson.databind.ObjectMapper; import org.eclipse.edc.boot.vault.InMemoryVault; -import org.eclipse.edc.connector.core.store.CriterionOperatorRegistryImpl; import org.eclipse.edc.core.edr.defaults.InMemoryEndpointDataReferenceEntryIndex; import org.eclipse.edc.core.edr.defaults.VaultEndpointDataReferenceCache; import org.eclipse.edc.edr.spi.store.EndpointDataReferenceStore; +import org.eclipse.edc.query.CriterionOperatorRegistryImpl; import org.eclipse.edc.transaction.spi.NoopTransactionContext; import org.eclipse.tractusx.edc.edr.spi.store.EndpointDataReferenceStoreTestBase; diff --git a/core/common/lib/boot-lib/build.gradle.kts b/core/common/lib/boot-lib/build.gradle.kts index 88d37811574..a37d7a0792c 100644 --- a/core/common/lib/boot-lib/build.gradle.kts +++ b/core/common/lib/boot-lib/build.gradle.kts @@ -22,6 +22,7 @@ dependencies { api(project(":spi:common:core-spi")) + testImplementation(libs.awaitility) } diff --git a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/health/HealthCheckServiceConfiguration.java b/core/common/lib/boot-lib/src/main/java/org/eclipse/edc/boot/health/HealthCheckServiceConfiguration.java similarity index 98% rename from core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/health/HealthCheckServiceConfiguration.java rename to core/common/lib/boot-lib/src/main/java/org/eclipse/edc/boot/health/HealthCheckServiceConfiguration.java index 08c05db795a..4d8318633bb 100644 --- a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/health/HealthCheckServiceConfiguration.java +++ b/core/common/lib/boot-lib/src/main/java/org/eclipse/edc/boot/health/HealthCheckServiceConfiguration.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.connector.core.health; +package org.eclipse.edc.boot.health; import org.eclipse.edc.spi.system.health.LivenessProvider; import org.eclipse.edc.spi.system.health.ReadinessProvider; diff --git a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/health/HealthCheckServiceImpl.java b/core/common/lib/boot-lib/src/main/java/org/eclipse/edc/boot/health/HealthCheckServiceImpl.java similarity index 99% rename from core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/health/HealthCheckServiceImpl.java rename to core/common/lib/boot-lib/src/main/java/org/eclipse/edc/boot/health/HealthCheckServiceImpl.java index 7d5b3f382e5..ea62083d154 100644 --- a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/health/HealthCheckServiceImpl.java +++ b/core/common/lib/boot-lib/src/main/java/org/eclipse/edc/boot/health/HealthCheckServiceImpl.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.connector.core.health; +package org.eclipse.edc.boot.health; import org.eclipse.edc.spi.system.ExecutorInstrumentation; import org.eclipse.edc.spi.system.health.HealthCheckResult; diff --git a/core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/health/HealthCheckServiceImplTest.java b/core/common/lib/boot-lib/src/test/java/org/eclipse/edc/core/health/HealthCheckServiceImplTest.java similarity index 90% rename from core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/health/HealthCheckServiceImplTest.java rename to core/common/lib/boot-lib/src/test/java/org/eclipse/edc/core/health/HealthCheckServiceImplTest.java index 3abea919560..effb97adc28 100644 --- a/core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/health/HealthCheckServiceImplTest.java +++ b/core/common/lib/boot-lib/src/test/java/org/eclipse/edc/core/health/HealthCheckServiceImplTest.java @@ -12,8 +12,11 @@ * */ -package org.eclipse.edc.connector.core.health; +package org.eclipse.edc.core.health; +import org.awaitility.Awaitility; +import org.eclipse.edc.boot.health.HealthCheckServiceConfiguration; +import org.eclipse.edc.boot.health.HealthCheckServiceImpl; import org.eclipse.edc.spi.system.ExecutorInstrumentation; import org.eclipse.edc.spi.system.health.HealthCheckResult; import org.eclipse.edc.spi.system.health.LivenessProvider; @@ -26,7 +29,6 @@ import java.time.Duration; import static org.assertj.core.api.Assertions.assertThat; -import static org.awaitility.Awaitility.await; import static org.mockito.Mockito.atLeastOnce; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; @@ -62,7 +64,7 @@ void isLive() { when(lpm.get()).thenReturn(successResult()); service.addLivenessProvider(lpm); - await().pollInterval(POLL_INTERVAL) + Awaitility.await().pollInterval(POLL_INTERVAL) .atMost(AWAIT_TIMEOUT) .untilAsserted(() -> { assertThat(service.isLive().isHealthy()).isTrue(); @@ -77,7 +79,7 @@ void isLive_throwsException() { when(lpm.get()).thenReturn(successResult()).thenThrow(new RuntimeException("test exception")); service.addLivenessProvider(lpm); - await().pollInterval(POLL_INTERVAL) + Awaitility.await().pollInterval(POLL_INTERVAL) .atMost(AWAIT_TIMEOUT) .untilAsserted(() -> { assertThat(service.isLive().isHealthy()).isFalse(); @@ -93,7 +95,7 @@ void isLive_failed() { service.addLivenessProvider(lpm); - await().pollInterval(POLL_INTERVAL) + Awaitility.await().pollInterval(POLL_INTERVAL) .atMost(AWAIT_TIMEOUT) .untilAsserted(() -> { assertThat(service.isLive().isHealthy()).isFalse(); @@ -108,7 +110,7 @@ void isReady() { when(provider.get()).thenReturn(successResult()); service.addReadinessProvider(provider); - await().pollInterval(POLL_INTERVAL) + Awaitility.await().pollInterval(POLL_INTERVAL) .atMost(AWAIT_TIMEOUT) .untilAsserted(() -> { assertThat(service.isReady().isHealthy()).isTrue(); @@ -124,7 +126,7 @@ void isReady_throwsException() { when(provider.get()).thenReturn(successResult()).thenThrow(new RuntimeException("test-exception")); service.addReadinessProvider(provider); - await().pollInterval(POLL_INTERVAL) + Awaitility.await().pollInterval(POLL_INTERVAL) .atMost(AWAIT_TIMEOUT) .untilAsserted(() -> { assertThat(service.isReady().isHealthy()).isFalse(); @@ -140,7 +142,7 @@ void isReady_failed() { when(provider.get()).thenReturn(failedResult()); service.addReadinessProvider(provider); - await().pollInterval(POLL_INTERVAL) + Awaitility.await().pollInterval(POLL_INTERVAL) .atMost(AWAIT_TIMEOUT) .untilAsserted(() -> { assertThat(service.isReady().isHealthy()).isFalse(); @@ -156,7 +158,7 @@ void hasStartupFinished() { when(provider.get()).thenReturn(successResult()); service.addStartupStatusProvider(provider); - await().pollInterval(POLL_INTERVAL) + Awaitility.await().pollInterval(POLL_INTERVAL) .atMost(AWAIT_TIMEOUT) .untilAsserted(() -> { assertThat(service.getStartupStatus().isHealthy()).isTrue(); @@ -175,7 +177,7 @@ void cacheCanBeRefreshed() { service.refresh(); - await().pollInterval(POLL_INTERVAL) + Awaitility.await().pollInterval(POLL_INTERVAL) .atMost(PERIOD.multipliedBy(2)) .untilAsserted(() -> { assertThat(service.getStartupStatus().isHealthy()).isTrue(); @@ -192,7 +194,7 @@ void hasStartupFinished_throwsException() { when(provider.get()).thenReturn(successResult()).thenThrow(new RuntimeException("test-exception")); service.addStartupStatusProvider(provider); - await().pollInterval(POLL_INTERVAL) + Awaitility.await().pollInterval(POLL_INTERVAL) .atMost(AWAIT_TIMEOUT) .untilAsserted(() -> { assertThat(service.getStartupStatus().isHealthy()).isFalse(); @@ -209,7 +211,7 @@ void hasStartupFinished_failed() { when(provider.get()).thenReturn(failedResult()); service.addStartupStatusProvider(provider); - await().pollInterval(POLL_INTERVAL) + Awaitility.await().pollInterval(POLL_INTERVAL) .atMost(AWAIT_TIMEOUT) .untilAsserted(() -> { assertThat(service.getStartupStatus().isHealthy()).isFalse(); diff --git a/extensions/common/crypto/crypto-common/build.gradle.kts b/core/common/lib/crypto-common-lib/build.gradle.kts similarity index 100% rename from extensions/common/crypto/crypto-common/build.gradle.kts rename to core/common/lib/crypto-common-lib/build.gradle.kts diff --git a/extensions/common/crypto/crypto-common/src/main/java/org/eclipse/edc/security/token/jwt/CryptoConverter.java b/core/common/lib/crypto-common-lib/src/main/java/org/eclipse/edc/security/token/jwt/CryptoConverter.java similarity index 100% rename from extensions/common/crypto/crypto-common/src/main/java/org/eclipse/edc/security/token/jwt/CryptoConverter.java rename to core/common/lib/crypto-common-lib/src/main/java/org/eclipse/edc/security/token/jwt/CryptoConverter.java diff --git a/extensions/common/crypto/crypto-common/src/test/java/org/eclipse/edc/security/token/jwt/CryptoConverterTest.java b/core/common/lib/crypto-common-lib/src/test/java/org/eclipse/edc/security/token/jwt/CryptoConverterTest.java similarity index 100% rename from extensions/common/crypto/crypto-common/src/test/java/org/eclipse/edc/security/token/jwt/CryptoConverterTest.java rename to core/common/lib/crypto-common-lib/src/test/java/org/eclipse/edc/security/token/jwt/CryptoConverterTest.java diff --git a/extensions/common/crypto/crypto-common/src/test/resources/rsakey.json b/core/common/lib/crypto-common-lib/src/test/resources/rsakey.json similarity index 100% rename from extensions/common/crypto/crypto-common/src/test/resources/rsakey.json rename to core/common/lib/crypto-common-lib/src/test/resources/rsakey.json diff --git a/core/common/lib/json-ld-lib/build.gradle.kts b/core/common/lib/json-ld-lib/build.gradle.kts new file mode 100644 index 00000000000..15aaa368fd5 --- /dev/null +++ b/core/common/lib/json-ld-lib/build.gradle.kts @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation + * + */ + +plugins { + `java-library` +} + +dependencies { + api(libs.jakartaJson) + api(libs.jacksonJsonP) + api(libs.titaniumJsonLd) + + implementation(project(":spi:common:core-spi")) + implementation(project(":spi:common:json-ld-spi")) + testImplementation(project(":core:common:util")) + testImplementation(project(":tests:junit-base")) + + testImplementation(libs.mockserver.netty) + testImplementation(libs.mockserver.client) +} diff --git a/extensions/common/json-ld/src/main/java/org/eclipse/edc/jsonld/JsonLdConfiguration.java b/core/common/lib/json-ld-lib/src/main/java/org/eclipse/edc/jsonld/JsonLdConfiguration.java similarity index 100% rename from extensions/common/json-ld/src/main/java/org/eclipse/edc/jsonld/JsonLdConfiguration.java rename to core/common/lib/json-ld-lib/src/main/java/org/eclipse/edc/jsonld/JsonLdConfiguration.java diff --git a/extensions/common/json-ld/src/main/java/org/eclipse/edc/jsonld/TitaniumJsonLd.java b/core/common/lib/json-ld-lib/src/main/java/org/eclipse/edc/jsonld/TitaniumJsonLd.java similarity index 90% rename from extensions/common/json-ld/src/main/java/org/eclipse/edc/jsonld/TitaniumJsonLd.java rename to core/common/lib/json-ld-lib/src/main/java/org/eclipse/edc/jsonld/TitaniumJsonLd.java index eaa95a65883..3b7bc7fd711 100644 --- a/extensions/common/json-ld/src/main/java/org/eclipse/edc/jsonld/TitaniumJsonLd.java +++ b/core/common/lib/json-ld-lib/src/main/java/org/eclipse/edc/jsonld/TitaniumJsonLd.java @@ -27,6 +27,8 @@ import jakarta.json.JsonValue; import org.eclipse.edc.jsonld.document.JarLoader; import org.eclipse.edc.jsonld.spi.JsonLd; +import org.eclipse.edc.jsonld.spi.JsonLdKeywords; +import org.eclipse.edc.spi.CoreConstants; import org.eclipse.edc.spi.monitor.Monitor; import org.eclipse.edc.spi.result.Result; @@ -45,9 +47,6 @@ import static jakarta.json.Json.createBuilderFactory; import static jakarta.json.Json.createObjectBuilder; import static java.util.Optional.ofNullable; -import static org.eclipse.edc.jsonld.spi.JsonLdKeywords.CONTEXT; -import static org.eclipse.edc.jsonld.spi.JsonLdKeywords.VOCAB; -import static org.eclipse.edc.spi.CoreConstants.EDC_NAMESPACE; /** * Implementation of the {@link JsonLd} interface that uses the Titanium library for all JSON-LD operations. @@ -94,7 +93,7 @@ public Result compact(JsonObject json, String scope) { var document = JsonDocument.of(json); var jsonFactory = createBuilderFactory(Map.of()); var contextDocument = JsonDocument.of(jsonFactory.createObjectBuilder() - .add(CONTEXT, createContext(scope)) + .add(JsonLdKeywords.CONTEXT, createContext(scope)) .build()); var compacted = com.apicatalog.jsonld.JsonLd.compact(document, contextDocument) .options(new JsonLdOptions(documentLoader)) @@ -127,14 +126,14 @@ private JsonObject injectVocab(JsonObject json) { var jsonObjectBuilder = createObjectBuilder(json); //only inject the vocab if the @context is an object, not a URL - if (json.get(CONTEXT) instanceof JsonObject) { - var contextObject = ofNullable(json.getJsonObject(CONTEXT)).orElseGet(() -> createObjectBuilder().build()); + if (json.get(JsonLdKeywords.CONTEXT) instanceof JsonObject) { + var contextObject = ofNullable(json.getJsonObject(JsonLdKeywords.CONTEXT)).orElseGet(() -> createObjectBuilder().build()); var contextBuilder = createObjectBuilder(contextObject); - if (!contextObject.containsKey(VOCAB)) { + if (!contextObject.containsKey(JsonLdKeywords.VOCAB)) { var newContextObject = contextBuilder - .add(VOCAB, EDC_NAMESPACE) + .add(JsonLdKeywords.VOCAB, CoreConstants.EDC_NAMESPACE) .build(); - jsonObjectBuilder.add(CONTEXT, newContextObject); + jsonObjectBuilder.add(JsonLdKeywords.CONTEXT, newContextObject); } } return jsonObjectBuilder.build(); @@ -143,11 +142,11 @@ private JsonObject injectVocab(JsonObject json) { private JsonValue createContext(String scope) { var builder = createObjectBuilder(); // Adds the configured namespaces for * and the input scope - Stream.concat(namespacesForScope(DEFAULT_SCOPE), namespacesForScope(scope)) + Stream.concat(namespacesForScope(JsonLd.DEFAULT_SCOPE), namespacesForScope(scope)) .forEach(entry -> builder.add(entry.getKey(), entry.getValue())); // Compute the additional context IRI defined for * and the input scope - var contexts = Stream.concat(contextsForScope(DEFAULT_SCOPE), contextsForScope(scope)) + var contexts = Stream.concat(contextsForScope(JsonLd.DEFAULT_SCOPE), contextsForScope(scope)) .collect(Collectors.toSet()); var contextObject = builder.build(); diff --git a/extensions/common/json-ld/src/main/java/org/eclipse/edc/jsonld/document/JarLoader.java b/core/common/lib/json-ld-lib/src/main/java/org/eclipse/edc/jsonld/document/JarLoader.java similarity index 100% rename from extensions/common/json-ld/src/main/java/org/eclipse/edc/jsonld/document/JarLoader.java rename to core/common/lib/json-ld-lib/src/main/java/org/eclipse/edc/jsonld/document/JarLoader.java diff --git a/extensions/common/json-ld/src/main/java/org/eclipse/edc/jsonld/util/JacksonJsonLd.java b/core/common/lib/json-ld-lib/src/main/java/org/eclipse/edc/jsonld/util/JacksonJsonLd.java similarity index 100% rename from extensions/common/json-ld/src/main/java/org/eclipse/edc/jsonld/util/JacksonJsonLd.java rename to core/common/lib/json-ld-lib/src/main/java/org/eclipse/edc/jsonld/util/JacksonJsonLd.java diff --git a/extensions/common/json-ld/src/test/java/org/eclipse/edc/jsonld/TitaniumJsonLdTest.java b/core/common/lib/json-ld-lib/src/test/java/org/eclipse/edc/jsonld/TitaniumJsonLdTest.java similarity index 55% rename from extensions/common/json-ld/src/test/java/org/eclipse/edc/jsonld/TitaniumJsonLdTest.java rename to core/common/lib/json-ld-lib/src/test/java/org/eclipse/edc/jsonld/TitaniumJsonLdTest.java index 8ba108a621d..cf6cb7d59cb 100644 --- a/extensions/common/json-ld/src/test/java/org/eclipse/edc/jsonld/TitaniumJsonLdTest.java +++ b/core/common/lib/json-ld-lib/src/test/java/org/eclipse/edc/jsonld/TitaniumJsonLdTest.java @@ -16,33 +16,29 @@ import jakarta.json.Json; import jakarta.json.JsonValue; +import org.assertj.core.api.Assertions; import org.eclipse.edc.jsonld.spi.JsonLd; +import org.eclipse.edc.jsonld.spi.JsonLdKeywords; +import org.eclipse.edc.junit.assertions.AbstractResultAssert; +import org.eclipse.edc.junit.testfixtures.TestUtils; import org.eclipse.edc.spi.monitor.Monitor; +import org.eclipse.edc.util.io.Ports; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; import org.mockserver.integration.ClientAndServer; +import org.mockserver.model.HttpRequest; +import org.mockserver.model.HttpResponse; import java.net.URI; import static jakarta.json.Json.createArrayBuilder; import static jakarta.json.Json.createObjectBuilder; -import static org.assertj.core.api.Assertions.assertThat; -import static org.eclipse.edc.jsonld.spi.JsonLdKeywords.CONTEXT; -import static org.eclipse.edc.jsonld.spi.JsonLdKeywords.TYPE; -import static org.eclipse.edc.jsonld.spi.JsonLdKeywords.VALUE; -import static org.eclipse.edc.junit.assertions.AbstractResultAssert.assertThat; -import static org.eclipse.edc.junit.testfixtures.TestUtils.getFileFromResourceName; -import static org.eclipse.edc.junit.testfixtures.TestUtils.getResourceFileContentAsString; -import static org.eclipse.edc.util.io.Ports.getFreePort; import static org.mockito.Mockito.mock; -import static org.mockserver.integration.ClientAndServer.startClientAndServer; -import static org.mockserver.model.HttpRequest.request; -import static org.mockserver.model.HttpResponse.response; class TitaniumJsonLdTest { - private final int port = getFreePort(); - private final ClientAndServer server = startClientAndServer(port); + private final int port = Ports.getFreePort(); + private final ClientAndServer server = ClientAndServer.startClientAndServer(port); private final Monitor monitor = mock(); @AfterEach @@ -54,7 +50,7 @@ void tearDown() { void expand() { var jsonObject = createObjectBuilder() .add("test:item", createObjectBuilder() - .add(TYPE, "https://some.test.type/schema/") + .add(JsonLdKeywords.TYPE, "https://some.test.type/schema/") .add("test:key1", "value1") .add("key2", "value2") // will not be contained in the expanded JSON, it lacks the prefix .build()) @@ -62,7 +58,7 @@ void expand() { var expanded = defaultService().expand(jsonObject); - assertThat(expanded).isSucceeded().extracting(Object::toString).asString() + AbstractResultAssert.assertThat(expanded).isSucceeded().extracting(Object::toString).asString() .contains("test:item") .contains("test:key1") .contains("@value\":\"value1\"") @@ -76,15 +72,15 @@ void expand_shouldFail_whenPropertiesWithoutNamespaceAndContextIsMissing() { var expanded = defaultService().expand(emptyJson); - assertThat(expanded).isFailed(); + AbstractResultAssert.assertThat(expanded).isFailed(); } @Test void expand_withCustomContext() { var jsonObject = createObjectBuilder() - .add(CONTEXT, createObjectBuilder().add("custom", "https://custom.namespace.org/schema/").build()) + .add(JsonLdKeywords.CONTEXT, createObjectBuilder().add("custom", "https://custom.namespace.org/schema/").build()) .add("test:item", createObjectBuilder() - .add(TYPE, "https://some.test.type/schema/") + .add(JsonLdKeywords.TYPE, "https://some.test.type/schema/") .add("test:key1", "value1") .add("custom:key2", "value2") // will not be contained in the expanded JSON, it lacks the prefix .build()) @@ -92,7 +88,7 @@ void expand_withCustomContext() { var expanded = defaultService().expand(jsonObject); - assertThat(expanded).isSucceeded().extracting(Object::toString).asString() + AbstractResultAssert.assertThat(expanded).isSucceeded().extracting(Object::toString).asString() .contains("test:item") .contains("test:key1") .contains("@value\":\"value1\"") @@ -105,17 +101,17 @@ void compact() { var ns = "https://test.org/schema/"; var expanded = Json.createObjectBuilder() .add(ns + "item", createObjectBuilder() - .add(TYPE, ns + "TestItem") - .add(ns + "key1", createArrayBuilder().add(createObjectBuilder().add(VALUE, "value1").build()).build()) - .add(ns + "key2", createArrayBuilder().add(createObjectBuilder().add(VALUE, "value2").build()).build())) + .add(JsonLdKeywords.TYPE, ns + "TestItem") + .add(ns + "key1", createArrayBuilder().add(createObjectBuilder().add(JsonLdKeywords.VALUE, "value1").build()).build()) + .add(ns + "key2", createArrayBuilder().add(createObjectBuilder().add(JsonLdKeywords.VALUE, "value2").build()).build())) .build(); var compacted = defaultService().compact(expanded); - assertThat(compacted).isSucceeded().satisfies(c -> { - assertThat(c.getJsonObject(ns + "item")).isNotNull(); - assertThat(c.getJsonObject(ns + "item").getJsonString(ns + "key1").getString()).isEqualTo("value1"); - assertThat(c.getJsonObject(ns + "item").getJsonString(ns + "key2").getString()).isEqualTo("value2"); + AbstractResultAssert.assertThat(compacted).isSucceeded().satisfies(c -> { + Assertions.assertThat(c.getJsonObject(ns + "item")).isNotNull(); + Assertions.assertThat(c.getJsonObject(ns + "item").getJsonString(ns + "key1").getString()).isEqualTo("value1"); + Assertions.assertThat(c.getJsonObject(ns + "item").getJsonString(ns + "key2").getString()).isEqualTo("value2"); }); } @@ -125,19 +121,19 @@ void compact_withCustomPrefix() { var prefix = "customContext"; var expanded = createObjectBuilder() .add(ns + "item", createObjectBuilder() - .add(TYPE, ns + "TestItem") - .add(ns + "key1", createArrayBuilder().add(createObjectBuilder().add(VALUE, "value1").build()).build()) - .add(ns + "key2", createArrayBuilder().add(createObjectBuilder().add(VALUE, "value2").build()).build())) + .add(JsonLdKeywords.TYPE, ns + "TestItem") + .add(ns + "key1", createArrayBuilder().add(createObjectBuilder().add(JsonLdKeywords.VALUE, "value1").build()).build()) + .add(ns + "key2", createArrayBuilder().add(createObjectBuilder().add(JsonLdKeywords.VALUE, "value2").build()).build())) .build(); var service = defaultService(); service.registerNamespace(prefix, ns); var compacted = service.compact(expanded); - assertThat(compacted).isSucceeded().satisfies(c -> { - assertThat(c.getJsonObject(prefix + ":item")).isNotNull(); - assertThat(c.getJsonObject(prefix + ":item").getJsonString(prefix + ":key1").getString()).isEqualTo("value1"); - assertThat(c.getJsonObject(prefix + ":item").getJsonString(prefix + ":key2").getString()).isEqualTo("value2"); + AbstractResultAssert.assertThat(compacted).isSucceeded().satisfies(c -> { + Assertions.assertThat(c.getJsonObject(prefix + ":item")).isNotNull(); + Assertions.assertThat(c.getJsonObject(prefix + ":item").getJsonString(prefix + ":key1").getString()).isEqualTo("value1"); + Assertions.assertThat(c.getJsonObject(prefix + ":item").getJsonString(prefix + ":key2").getString()).isEqualTo("value2"); }); } @@ -146,26 +142,26 @@ void expandAndCompact_withCustomContext() { var context = "http://schema.org/"; var input = createObjectBuilder() .add("@context", createArrayBuilder().add(context).build()) - .add(TYPE, "Person") + .add(JsonLdKeywords.TYPE, "Person") .add("name", "Jane Doe") .add("jobTitle", "Professor") .build(); var service = defaultService(); service.registerContext(context); - service.registerCachedDocument(context, getFileFromResourceName("schema-org-light.jsonld").toURI()); + service.registerCachedDocument(context, TestUtils.getFileFromResourceName("schema-org-light.jsonld").toURI()); var expanded = service.expand(input); - assertThat(expanded).isSucceeded().satisfies(c -> { - assertThat(c.getJsonArray(context + "name").get(0).asJsonObject().getJsonString(VALUE).getString()).isEqualTo("Jane Doe"); - assertThat(c.getJsonArray(context + "jobTitle").get(0).asJsonObject().getJsonString(VALUE).getString()).isEqualTo("Professor"); + AbstractResultAssert.assertThat(expanded).isSucceeded().satisfies(c -> { + Assertions.assertThat(c.getJsonArray(context + "name").get(0).asJsonObject().getJsonString(JsonLdKeywords.VALUE).getString()).isEqualTo("Jane Doe"); + Assertions.assertThat(c.getJsonArray(context + "jobTitle").get(0).asJsonObject().getJsonString(JsonLdKeywords.VALUE).getString()).isEqualTo("Professor"); }); var compacted = service.compact(expanded.getContent()); - assertThat(compacted).isSucceeded().satisfies(c -> { - assertThat(c).isEqualTo(input); + AbstractResultAssert.assertThat(compacted).isSucceeded().satisfies(c -> { + Assertions.assertThat(c).isEqualTo(input); }); } @@ -176,7 +172,7 @@ void expandAndCompact_withCustomContextAndNameClash() { var input = createObjectBuilder() .add("@context", createArrayBuilder().add(schemaContext).add(testSchemaContext).build()) - .add(TYPE, "schema:Person") + .add(JsonLdKeywords.TYPE, "schema:Person") .add("name", "Jane Doe") .add("schema:jobTitle", "Professor") .build(); @@ -184,20 +180,20 @@ void expandAndCompact_withCustomContextAndNameClash() { var service = defaultService(); service.registerContext(schemaContext); service.registerContext(testSchemaContext); - service.registerCachedDocument(schemaContext, getFileFromResourceName("schema-org-light.jsonld").toURI()); - service.registerCachedDocument(testSchemaContext, getFileFromResourceName("test-org-light.jsonld").toURI()); + service.registerCachedDocument(schemaContext, TestUtils.getFileFromResourceName("schema-org-light.jsonld").toURI()); + service.registerCachedDocument(testSchemaContext, TestUtils.getFileFromResourceName("test-org-light.jsonld").toURI()); var expanded = service.expand(input); - assertThat(expanded).isSucceeded().satisfies(c -> { - assertThat(c.getJsonArray(testSchemaContext + "name").get(0).asJsonObject().getJsonString(VALUE).getString()).isEqualTo("Jane Doe"); - assertThat(c.getJsonArray(schemaContext + "jobTitle").get(0).asJsonObject().getJsonString(VALUE).getString()).isEqualTo("Professor"); + AbstractResultAssert.assertThat(expanded).isSucceeded().satisfies(c -> { + Assertions.assertThat(c.getJsonArray(testSchemaContext + "name").get(0).asJsonObject().getJsonString(JsonLdKeywords.VALUE).getString()).isEqualTo("Jane Doe"); + Assertions.assertThat(c.getJsonArray(schemaContext + "jobTitle").get(0).asJsonObject().getJsonString(JsonLdKeywords.VALUE).getString()).isEqualTo("Professor"); }); var compacted = service.compact(expanded.getContent()); - assertThat(compacted).isSucceeded().satisfies(c -> { - assertThat(c).isEqualTo(input); + AbstractResultAssert.assertThat(compacted).isSucceeded().satisfies(c -> { + Assertions.assertThat(c).isEqualTo(input); }); } @@ -209,7 +205,7 @@ void expandAndCompact_withCustomContextAndCustomScope() { var input = createObjectBuilder() .add("@context", createArrayBuilder().add(schemaContext).add(testSchemaContext).build()) - .add(TYPE, "schema:Person") + .add(JsonLdKeywords.TYPE, "schema:Person") .add("name", "Jane Doe") .add("schema:jobTitle", "Professor") .build(); @@ -217,20 +213,20 @@ void expandAndCompact_withCustomContextAndCustomScope() { var service = defaultService(); service.registerContext(schemaContext); service.registerContext(testSchemaContext, customScope); - service.registerCachedDocument(schemaContext, getFileFromResourceName("schema-org-light.jsonld").toURI()); - service.registerCachedDocument(testSchemaContext, getFileFromResourceName("test-org-light.jsonld").toURI()); + service.registerCachedDocument(schemaContext, TestUtils.getFileFromResourceName("schema-org-light.jsonld").toURI()); + service.registerCachedDocument(testSchemaContext, TestUtils.getFileFromResourceName("test-org-light.jsonld").toURI()); var expanded = service.expand(input); - assertThat(expanded).isSucceeded().satisfies(c -> { - assertThat(c.getJsonArray(testSchemaContext + "name").get(0).asJsonObject().getJsonString(VALUE).getString()).isEqualTo("Jane Doe"); - assertThat(c.getJsonArray(schemaContext + "jobTitle").get(0).asJsonObject().getJsonString(VALUE).getString()).isEqualTo("Professor"); + AbstractResultAssert.assertThat(expanded).isSucceeded().satisfies(c -> { + Assertions.assertThat(c.getJsonArray(testSchemaContext + "name").get(0).asJsonObject().getJsonString(JsonLdKeywords.VALUE).getString()).isEqualTo("Jane Doe"); + Assertions.assertThat(c.getJsonArray(schemaContext + "jobTitle").get(0).asJsonObject().getJsonString(JsonLdKeywords.VALUE).getString()).isEqualTo("Professor"); }); var compacted = service.compact(expanded.getContent(), customScope); - assertThat(compacted).isSucceeded().satisfies(c -> { - assertThat(c).isEqualTo(input); + AbstractResultAssert.assertThat(compacted).isSucceeded().satisfies(c -> { + Assertions.assertThat(c).isEqualTo(input); }); } @@ -238,44 +234,44 @@ void expandAndCompact_withCustomContextAndCustomScope() { void documentResolution_shouldNotCallHttpEndpoint_whenFileContextIsRegistered() { var contextUrl = "http://localhost:" + port; var jsonObject = createObjectBuilder() - .add(CONTEXT, contextUrl) + .add(JsonLdKeywords.CONTEXT, contextUrl) .add("test:key", "value") .build(); var service = defaultService(); - service.registerCachedDocument(contextUrl, getFileFromResourceName("test-context.jsonld").toURI()); + service.registerCachedDocument(contextUrl, TestUtils.getFileFromResourceName("test-context.jsonld").toURI()); var expanded = service.expand(jsonObject); server.verifyZeroInteractions(); - assertThat(expanded).isSucceeded().satisfies(json -> { - assertThat(json.getJsonArray("http://test.org/context/key")).hasSize(1).first() + AbstractResultAssert.assertThat(expanded).isSucceeded().satisfies(json -> { + Assertions.assertThat(json.getJsonArray("http://test.org/context/key")).hasSize(1).first() .extracting(JsonValue::asJsonObject) - .extracting(it -> it.getString(VALUE)) + .extracting(it -> it.getString(JsonLdKeywords.VALUE)) .isEqualTo("value"); }); } @Test void documentResolution_shouldFailByDefault_whenContextIsNotRegisteredAndHttpIsNotEnabled() { - server.when(request()).respond(response(getResourceFileContentAsString("test-context.jsonld"))); + server.when(HttpRequest.request()).respond(HttpResponse.response(TestUtils.getResourceFileContentAsString("test-context.jsonld"))); var contextUrl = "http://localhost:" + port; var jsonObject = createObjectBuilder() - .add(CONTEXT, contextUrl) + .add(JsonLdKeywords.CONTEXT, contextUrl) .add("test:key", "value") .build(); var service = defaultService(); var expanded = service.expand(jsonObject); - assertThat(expanded).isFailed(); + AbstractResultAssert.assertThat(expanded).isFailed(); } @Test void documentResolution_shouldCallHttpEndpoint_whenContextIsNotRegistered_andHttpIsEnabled() { - server.when(request()).respond(response(getResourceFileContentAsString("test-context.jsonld"))); + server.when(HttpRequest.request()).respond(HttpResponse.response(TestUtils.getResourceFileContentAsString("test-context.jsonld"))); var contextUrl = "http://localhost:" + port; var jsonObject = createObjectBuilder() - .add(CONTEXT, contextUrl) + .add(JsonLdKeywords.CONTEXT, contextUrl) .add("test:key", "value") .build(); var service = httpEnabledService(); @@ -283,10 +279,10 @@ void documentResolution_shouldCallHttpEndpoint_whenContextIsNotRegistered_andHtt var expanded = service.expand(jsonObject); - assertThat(expanded).isSucceeded().satisfies(json -> { - assertThat(json.getJsonArray("http://test.org/context/key")).hasSize(1).first() + AbstractResultAssert.assertThat(expanded).isSucceeded().satisfies(json -> { + Assertions.assertThat(json.getJsonArray("http://test.org/context/key")).hasSize(1).first() .extracting(JsonValue::asJsonObject) - .extracting(it -> it.getString(VALUE)) + .extracting(it -> it.getString(JsonLdKeywords.VALUE)) .isEqualTo("value"); }); } diff --git a/extensions/common/json-ld/src/test/java/org/eclipse/edc/jsonld/document/JarLoaderTest.java b/core/common/lib/json-ld-lib/src/test/java/org/eclipse/edc/jsonld/document/JarLoaderTest.java similarity index 100% rename from extensions/common/json-ld/src/test/java/org/eclipse/edc/jsonld/document/JarLoaderTest.java rename to core/common/lib/json-ld-lib/src/test/java/org/eclipse/edc/jsonld/document/JarLoaderTest.java diff --git a/core/common/lib/json-ld-lib/src/test/resources/.gitignore b/core/common/lib/json-ld-lib/src/test/resources/.gitignore new file mode 100644 index 00000000000..90aa80efcae --- /dev/null +++ b/core/common/lib/json-ld-lib/src/test/resources/.gitignore @@ -0,0 +1,2 @@ +# enable jars for this folder +!jar-with-resource-example.jar diff --git a/extensions/common/json-ld/src/test/resources/jar-with-resource-example.jar b/core/common/lib/json-ld-lib/src/test/resources/jar-with-resource-example.jar similarity index 100% rename from extensions/common/json-ld/src/test/resources/jar-with-resource-example.jar rename to core/common/lib/json-ld-lib/src/test/resources/jar-with-resource-example.jar diff --git a/extensions/common/json-ld/src/test/resources/schema-org-light.jsonld b/core/common/lib/json-ld-lib/src/test/resources/schema-org-light.jsonld similarity index 100% rename from extensions/common/json-ld/src/test/resources/schema-org-light.jsonld rename to core/common/lib/json-ld-lib/src/test/resources/schema-org-light.jsonld diff --git a/extensions/common/json-ld/src/test/resources/test-context.jsonld b/core/common/lib/json-ld-lib/src/test/resources/test-context.jsonld similarity index 100% rename from extensions/common/json-ld/src/test/resources/test-context.jsonld rename to core/common/lib/json-ld-lib/src/test/resources/test-context.jsonld diff --git a/extensions/common/json-ld/src/test/resources/test-org-light.jsonld b/core/common/lib/json-ld-lib/src/test/resources/test-org-light.jsonld similarity index 100% rename from extensions/common/json-ld/src/test/resources/test-org-light.jsonld rename to core/common/lib/json-ld-lib/src/test/resources/test-org-light.jsonld diff --git a/core/common/policy-engine/build.gradle.kts b/core/common/lib/policy-engine-lib/build.gradle.kts similarity index 90% rename from core/common/policy-engine/build.gradle.kts rename to core/common/lib/policy-engine-lib/build.gradle.kts index e3e62876057..0cbcc276a45 100644 --- a/core/common/policy-engine/build.gradle.kts +++ b/core/common/lib/policy-engine-lib/build.gradle.kts @@ -20,7 +20,7 @@ plugins { dependencies { api(project(":spi:common:policy-engine-spi")) api(project(":spi:common:policy-model")) - implementation(project(":core:common:policy-evaluator")) + implementation(project(":core:common:lib:policy-evaluator-lib")) testImplementation(project(":tests:junit-base")); } diff --git a/core/common/policy-engine/src/main/java/org/eclipse/edc/policy/engine/PolicyEngineImpl.java b/core/common/lib/policy-engine-lib/src/main/java/org/eclipse/edc/policy/engine/PolicyEngineImpl.java similarity index 100% rename from core/common/policy-engine/src/main/java/org/eclipse/edc/policy/engine/PolicyEngineImpl.java rename to core/common/lib/policy-engine-lib/src/main/java/org/eclipse/edc/policy/engine/PolicyEngineImpl.java diff --git a/core/common/policy-engine/src/main/java/org/eclipse/edc/policy/engine/RuleBindingRegistryImpl.java b/core/common/lib/policy-engine-lib/src/main/java/org/eclipse/edc/policy/engine/RuleBindingRegistryImpl.java similarity index 100% rename from core/common/policy-engine/src/main/java/org/eclipse/edc/policy/engine/RuleBindingRegistryImpl.java rename to core/common/lib/policy-engine-lib/src/main/java/org/eclipse/edc/policy/engine/RuleBindingRegistryImpl.java diff --git a/core/common/policy-engine/src/main/java/org/eclipse/edc/policy/engine/ScopeFilter.java b/core/common/lib/policy-engine-lib/src/main/java/org/eclipse/edc/policy/engine/ScopeFilter.java similarity index 100% rename from core/common/policy-engine/src/main/java/org/eclipse/edc/policy/engine/ScopeFilter.java rename to core/common/lib/policy-engine-lib/src/main/java/org/eclipse/edc/policy/engine/ScopeFilter.java diff --git a/core/common/policy-engine/src/test/java/org/eclipse/edc/policy/engine/PolicyEngineImplScenariosTest.java b/core/common/lib/policy-engine-lib/src/test/java/org/eclipse/edc/policy/engine/PolicyEngineImplScenariosTest.java similarity index 100% rename from core/common/policy-engine/src/test/java/org/eclipse/edc/policy/engine/PolicyEngineImplScenariosTest.java rename to core/common/lib/policy-engine-lib/src/test/java/org/eclipse/edc/policy/engine/PolicyEngineImplScenariosTest.java diff --git a/core/common/policy-engine/src/test/java/org/eclipse/edc/policy/engine/PolicyEngineImplTest.java b/core/common/lib/policy-engine-lib/src/test/java/org/eclipse/edc/policy/engine/PolicyEngineImplTest.java similarity index 100% rename from core/common/policy-engine/src/test/java/org/eclipse/edc/policy/engine/PolicyEngineImplTest.java rename to core/common/lib/policy-engine-lib/src/test/java/org/eclipse/edc/policy/engine/PolicyEngineImplTest.java diff --git a/core/common/policy-engine/src/test/java/org/eclipse/edc/policy/engine/RuleBindingRegistryImplTest.java b/core/common/lib/policy-engine-lib/src/test/java/org/eclipse/edc/policy/engine/RuleBindingRegistryImplTest.java similarity index 100% rename from core/common/policy-engine/src/test/java/org/eclipse/edc/policy/engine/RuleBindingRegistryImplTest.java rename to core/common/lib/policy-engine-lib/src/test/java/org/eclipse/edc/policy/engine/RuleBindingRegistryImplTest.java diff --git a/core/common/policy-engine/src/test/java/org/eclipse/edc/policy/engine/ScopeFilterTest.java b/core/common/lib/policy-engine-lib/src/test/java/org/eclipse/edc/policy/engine/ScopeFilterTest.java similarity index 100% rename from core/common/policy-engine/src/test/java/org/eclipse/edc/policy/engine/ScopeFilterTest.java rename to core/common/lib/policy-engine-lib/src/test/java/org/eclipse/edc/policy/engine/ScopeFilterTest.java diff --git a/core/common/policy-evaluator/build.gradle.kts b/core/common/lib/policy-evaluator-lib/build.gradle.kts similarity index 100% rename from core/common/policy-evaluator/build.gradle.kts rename to core/common/lib/policy-evaluator-lib/build.gradle.kts diff --git a/core/common/policy-evaluator/src/main/java/org/eclipse/edc/policy/evaluator/ConstraintProblem.java b/core/common/lib/policy-evaluator-lib/src/main/java/org/eclipse/edc/policy/evaluator/ConstraintProblem.java similarity index 100% rename from core/common/policy-evaluator/src/main/java/org/eclipse/edc/policy/evaluator/ConstraintProblem.java rename to core/common/lib/policy-evaluator-lib/src/main/java/org/eclipse/edc/policy/evaluator/ConstraintProblem.java diff --git a/core/common/policy-evaluator/src/main/java/org/eclipse/edc/policy/evaluator/PolicyEvaluationResult.java b/core/common/lib/policy-evaluator-lib/src/main/java/org/eclipse/edc/policy/evaluator/PolicyEvaluationResult.java similarity index 100% rename from core/common/policy-evaluator/src/main/java/org/eclipse/edc/policy/evaluator/PolicyEvaluationResult.java rename to core/common/lib/policy-evaluator-lib/src/main/java/org/eclipse/edc/policy/evaluator/PolicyEvaluationResult.java diff --git a/core/common/policy-evaluator/src/main/java/org/eclipse/edc/policy/evaluator/PolicyEvaluator.java b/core/common/lib/policy-evaluator-lib/src/main/java/org/eclipse/edc/policy/evaluator/PolicyEvaluator.java similarity index 100% rename from core/common/policy-evaluator/src/main/java/org/eclipse/edc/policy/evaluator/PolicyEvaluator.java rename to core/common/lib/policy-evaluator-lib/src/main/java/org/eclipse/edc/policy/evaluator/PolicyEvaluator.java diff --git a/core/common/policy-evaluator/src/main/java/org/eclipse/edc/policy/evaluator/RuleProblem.java b/core/common/lib/policy-evaluator-lib/src/main/java/org/eclipse/edc/policy/evaluator/RuleProblem.java similarity index 100% rename from core/common/policy-evaluator/src/main/java/org/eclipse/edc/policy/evaluator/RuleProblem.java rename to core/common/lib/policy-evaluator-lib/src/main/java/org/eclipse/edc/policy/evaluator/RuleProblem.java diff --git a/core/common/policy-evaluator/src/test/java/org/eclipse/edc/policy/evaluator/PolicyEvaluatorScenarioTest.java b/core/common/lib/policy-evaluator-lib/src/test/java/org/eclipse/edc/policy/evaluator/PolicyEvaluatorScenarioTest.java similarity index 100% rename from core/common/policy-evaluator/src/test/java/org/eclipse/edc/policy/evaluator/PolicyEvaluatorScenarioTest.java rename to core/common/lib/policy-evaluator-lib/src/test/java/org/eclipse/edc/policy/evaluator/PolicyEvaluatorScenarioTest.java diff --git a/core/common/policy-evaluator/src/test/java/org/eclipse/edc/policy/evaluator/PolicyEvaluatorTest.java b/core/common/lib/policy-evaluator-lib/src/test/java/org/eclipse/edc/policy/evaluator/PolicyEvaluatorTest.java similarity index 100% rename from core/common/policy-evaluator/src/test/java/org/eclipse/edc/policy/evaluator/PolicyEvaluatorTest.java rename to core/common/lib/policy-evaluator-lib/src/test/java/org/eclipse/edc/policy/evaluator/PolicyEvaluatorTest.java diff --git a/core/common/policy-evaluator/src/test/java/org/eclipse/edc/policy/evaluator/PolicyTestFunctions.java b/core/common/lib/policy-evaluator-lib/src/test/java/org/eclipse/edc/policy/evaluator/PolicyTestFunctions.java similarity index 100% rename from core/common/policy-evaluator/src/test/java/org/eclipse/edc/policy/evaluator/PolicyTestFunctions.java rename to core/common/lib/policy-evaluator-lib/src/test/java/org/eclipse/edc/policy/evaluator/PolicyTestFunctions.java diff --git a/core/common/lib/query-lib/build.gradle.kts b/core/common/lib/query-lib/build.gradle.kts new file mode 100644 index 00000000000..a7325eabef2 --- /dev/null +++ b/core/common/lib/query-lib/build.gradle.kts @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation + * + */ + +plugins { + `java-library` + `java-test-fixtures` + `maven-publish` +} + +dependencies { + api(project(":spi:common:core-spi")) + implementation(project(":core:common:util")) +} + + diff --git a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/store/ContainsOperatorPredicate.java b/core/common/lib/query-lib/src/main/java/org/eclipse/edc/query/ContainsOperatorPredicate.java similarity index 94% rename from core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/store/ContainsOperatorPredicate.java rename to core/common/lib/query-lib/src/main/java/org/eclipse/edc/query/ContainsOperatorPredicate.java index 2eea6cac6f2..7b69d0c7979 100644 --- a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/store/ContainsOperatorPredicate.java +++ b/core/common/lib/query-lib/src/main/java/org/eclipse/edc/query/ContainsOperatorPredicate.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.connector.core.store; +package org.eclipse.edc.query; import org.eclipse.edc.spi.query.OperatorPredicate; diff --git a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/store/CriterionOperatorRegistryImpl.java b/core/common/lib/query-lib/src/main/java/org/eclipse/edc/query/CriterionOperatorRegistryImpl.java similarity index 96% rename from core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/store/CriterionOperatorRegistryImpl.java rename to core/common/lib/query-lib/src/main/java/org/eclipse/edc/query/CriterionOperatorRegistryImpl.java index 30c79a9b5ba..386ac3bb323 100644 --- a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/store/CriterionOperatorRegistryImpl.java +++ b/core/common/lib/query-lib/src/main/java/org/eclipse/edc/query/CriterionOperatorRegistryImpl.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.connector.core.store; +package org.eclipse.edc.query; import org.eclipse.edc.spi.query.Criterion; import org.eclipse.edc.spi.query.CriterionOperatorRegistry; @@ -39,7 +39,6 @@ public class CriterionOperatorRegistryImpl implements CriterionOperatorRegistry public static CriterionOperatorRegistry ofDefaults() { var registry = new CriterionOperatorRegistryImpl(); registry.registerPropertyLookup(new ReflectionPropertyLookup()); - registry.registerPropertyLookup(new AssetPropertyLookup()); registry.registerOperatorPredicate(EQUAL, new EqualOperatorPredicate()); registry.registerOperatorPredicate(IN, new InOperatorPredicate()); registry.registerOperatorPredicate(LIKE, new LikeOperatorPredicate()); diff --git a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/store/EqualOperatorPredicate.java b/core/common/lib/query-lib/src/main/java/org/eclipse/edc/query/EqualOperatorPredicate.java similarity index 97% rename from core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/store/EqualOperatorPredicate.java rename to core/common/lib/query-lib/src/main/java/org/eclipse/edc/query/EqualOperatorPredicate.java index 5add9306100..74614e35028 100644 --- a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/store/EqualOperatorPredicate.java +++ b/core/common/lib/query-lib/src/main/java/org/eclipse/edc/query/EqualOperatorPredicate.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.connector.core.store; +package org.eclipse.edc.query; import org.eclipse.edc.spi.query.OperatorPredicate; diff --git a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/store/InOperatorPredicate.java b/core/common/lib/query-lib/src/main/java/org/eclipse/edc/query/InOperatorPredicate.java similarity index 95% rename from core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/store/InOperatorPredicate.java rename to core/common/lib/query-lib/src/main/java/org/eclipse/edc/query/InOperatorPredicate.java index 217e0379deb..0b559dae615 100644 --- a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/store/InOperatorPredicate.java +++ b/core/common/lib/query-lib/src/main/java/org/eclipse/edc/query/InOperatorPredicate.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.connector.core.store; +package org.eclipse.edc.query; import org.eclipse.edc.spi.query.OperatorPredicate; diff --git a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/store/LikeOperatorPredicate.java b/core/common/lib/query-lib/src/main/java/org/eclipse/edc/query/LikeOperatorPredicate.java similarity index 95% rename from core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/store/LikeOperatorPredicate.java rename to core/common/lib/query-lib/src/main/java/org/eclipse/edc/query/LikeOperatorPredicate.java index 84efd10f271..9d7c3f3e70f 100644 --- a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/store/LikeOperatorPredicate.java +++ b/core/common/lib/query-lib/src/main/java/org/eclipse/edc/query/LikeOperatorPredicate.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.connector.core.store; +package org.eclipse.edc.query; import org.eclipse.edc.spi.query.OperatorPredicate; diff --git a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/store/ReflectionPropertyLookup.java b/core/common/lib/query-lib/src/main/java/org/eclipse/edc/query/ReflectionPropertyLookup.java similarity index 95% rename from core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/store/ReflectionPropertyLookup.java rename to core/common/lib/query-lib/src/main/java/org/eclipse/edc/query/ReflectionPropertyLookup.java index 4ea5de5ddd5..42ef17d026d 100644 --- a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/store/ReflectionPropertyLookup.java +++ b/core/common/lib/query-lib/src/main/java/org/eclipse/edc/query/ReflectionPropertyLookup.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.connector.core.store; +package org.eclipse.edc.query; import org.eclipse.edc.spi.query.PropertyLookup; import org.eclipse.edc.util.reflection.ReflectionException; diff --git a/core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/store/ContainsOperatorPredicateTest.java b/core/common/lib/query-lib/src/test/java/org/eclipse/edc/query/ContainsOperatorPredicateTest.java similarity index 96% rename from core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/store/ContainsOperatorPredicateTest.java rename to core/common/lib/query-lib/src/test/java/org/eclipse/edc/query/ContainsOperatorPredicateTest.java index dd9b38e3528..492e5fa4d11 100644 --- a/core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/store/ContainsOperatorPredicateTest.java +++ b/core/common/lib/query-lib/src/test/java/org/eclipse/edc/query/ContainsOperatorPredicateTest.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.connector.core.store; +package org.eclipse.edc.query; import org.eclipse.edc.spi.query.OperatorPredicate; import org.junit.jupiter.api.Test; diff --git a/core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/store/CriterionOperatorRegistryImplTest.java b/core/common/lib/query-lib/src/test/java/org/eclipse/edc/query/CriterionOperatorRegistryImplTest.java similarity index 99% rename from core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/store/CriterionOperatorRegistryImplTest.java rename to core/common/lib/query-lib/src/test/java/org/eclipse/edc/query/CriterionOperatorRegistryImplTest.java index 29b43f599bb..e9220cf8ce1 100644 --- a/core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/store/CriterionOperatorRegistryImplTest.java +++ b/core/common/lib/query-lib/src/test/java/org/eclipse/edc/query/CriterionOperatorRegistryImplTest.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.connector.core.store; +package org.eclipse.edc.query; import org.eclipse.edc.spi.query.OperatorPredicate; import org.junit.jupiter.api.Nested; diff --git a/core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/store/EqualOperatorPredicateTest.java b/core/common/lib/query-lib/src/test/java/org/eclipse/edc/query/EqualOperatorPredicateTest.java similarity index 88% rename from core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/store/EqualOperatorPredicateTest.java rename to core/common/lib/query-lib/src/test/java/org/eclipse/edc/query/EqualOperatorPredicateTest.java index 133b75a3f6a..d3af3c88562 100644 --- a/core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/store/EqualOperatorPredicateTest.java +++ b/core/common/lib/query-lib/src/test/java/org/eclipse/edc/query/EqualOperatorPredicateTest.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.connector.core.store; +package org.eclipse.edc.query; import org.eclipse.edc.spi.query.OperatorPredicate; import org.junit.jupiter.api.Test; @@ -20,8 +20,8 @@ import java.util.List; import static org.assertj.core.api.Assertions.assertThat; -import static org.eclipse.edc.connector.core.store.EqualOperatorPredicateTest.TestEnum.ENTRY1; -import static org.eclipse.edc.connector.core.store.EqualOperatorPredicateTest.TestEnum.ENTRY2; +import static org.eclipse.edc.query.EqualOperatorPredicateTest.TestEnum.ENTRY1; +import static org.eclipse.edc.query.EqualOperatorPredicateTest.TestEnum.ENTRY2; class EqualOperatorPredicateTest { diff --git a/core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/store/InOperatorPredicateTest.java b/core/common/lib/query-lib/src/test/java/org/eclipse/edc/query/InOperatorPredicateTest.java similarity index 96% rename from core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/store/InOperatorPredicateTest.java rename to core/common/lib/query-lib/src/test/java/org/eclipse/edc/query/InOperatorPredicateTest.java index e577ef883dd..ebd8e0d678b 100644 --- a/core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/store/InOperatorPredicateTest.java +++ b/core/common/lib/query-lib/src/test/java/org/eclipse/edc/query/InOperatorPredicateTest.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.connector.core.store; +package org.eclipse.edc.query; import org.eclipse.edc.spi.query.OperatorPredicate; import org.junit.jupiter.api.Test; diff --git a/core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/store/LikeOperatorPredicateTest.java b/core/common/lib/query-lib/src/test/java/org/eclipse/edc/query/LikeOperatorPredicateTest.java similarity index 97% rename from core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/store/LikeOperatorPredicateTest.java rename to core/common/lib/query-lib/src/test/java/org/eclipse/edc/query/LikeOperatorPredicateTest.java index b7aef7d97d3..2d80748f02b 100644 --- a/core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/store/LikeOperatorPredicateTest.java +++ b/core/common/lib/query-lib/src/test/java/org/eclipse/edc/query/LikeOperatorPredicateTest.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.connector.core.store; +package org.eclipse.edc.query; import org.eclipse.edc.spi.query.OperatorPredicate; import org.junit.jupiter.api.Test; diff --git a/core/common/state-machine/build.gradle.kts b/core/common/lib/state-machine-lib/build.gradle.kts similarity index 100% rename from core/common/state-machine/build.gradle.kts rename to core/common/lib/state-machine-lib/build.gradle.kts diff --git a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/entity/AbstractStateEntityManager.java b/core/common/lib/state-machine-lib/src/main/java/org/eclipse/edc/statemachine/AbstractStateEntityManager.java similarity index 98% rename from core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/entity/AbstractStateEntityManager.java rename to core/common/lib/state-machine-lib/src/main/java/org/eclipse/edc/statemachine/AbstractStateEntityManager.java index df0f464412d..92292d96a62 100644 --- a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/entity/AbstractStateEntityManager.java +++ b/core/common/lib/state-machine-lib/src/main/java/org/eclipse/edc/statemachine/AbstractStateEntityManager.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.connector.core.entity; +package org.eclipse.edc.statemachine; import org.eclipse.edc.spi.entity.StateEntityManager; import org.eclipse.edc.spi.entity.StatefulEntity; @@ -22,7 +22,6 @@ import org.eclipse.edc.spi.retry.WaitStrategy; import org.eclipse.edc.spi.system.ExecutorInstrumentation; import org.eclipse.edc.spi.telemetry.Telemetry; -import org.eclipse.edc.statemachine.StateMachineManager; import org.eclipse.edc.statemachine.retry.EntityRetryProcessConfiguration; import org.eclipse.edc.statemachine.retry.EntityRetryProcessFactory; import org.jetbrains.annotations.NotNull; diff --git a/core/common/state-machine/src/main/java/org/eclipse/edc/statemachine/Processor.java b/core/common/lib/state-machine-lib/src/main/java/org/eclipse/edc/statemachine/Processor.java similarity index 100% rename from core/common/state-machine/src/main/java/org/eclipse/edc/statemachine/Processor.java rename to core/common/lib/state-machine-lib/src/main/java/org/eclipse/edc/statemachine/Processor.java diff --git a/core/common/state-machine/src/main/java/org/eclipse/edc/statemachine/ProcessorImpl.java b/core/common/lib/state-machine-lib/src/main/java/org/eclipse/edc/statemachine/ProcessorImpl.java similarity index 100% rename from core/common/state-machine/src/main/java/org/eclipse/edc/statemachine/ProcessorImpl.java rename to core/common/lib/state-machine-lib/src/main/java/org/eclipse/edc/statemachine/ProcessorImpl.java diff --git a/core/common/state-machine/src/main/java/org/eclipse/edc/statemachine/StateMachineManager.java b/core/common/lib/state-machine-lib/src/main/java/org/eclipse/edc/statemachine/StateMachineManager.java similarity index 100% rename from core/common/state-machine/src/main/java/org/eclipse/edc/statemachine/StateMachineManager.java rename to core/common/lib/state-machine-lib/src/main/java/org/eclipse/edc/statemachine/StateMachineManager.java diff --git a/core/common/state-machine/src/main/java/org/eclipse/edc/statemachine/retry/AsyncStatusResultRetryProcess.java b/core/common/lib/state-machine-lib/src/main/java/org/eclipse/edc/statemachine/retry/AsyncStatusResultRetryProcess.java similarity index 100% rename from core/common/state-machine/src/main/java/org/eclipse/edc/statemachine/retry/AsyncStatusResultRetryProcess.java rename to core/common/lib/state-machine-lib/src/main/java/org/eclipse/edc/statemachine/retry/AsyncStatusResultRetryProcess.java diff --git a/core/common/state-machine/src/main/java/org/eclipse/edc/statemachine/retry/CompletableFutureRetryProcess.java b/core/common/lib/state-machine-lib/src/main/java/org/eclipse/edc/statemachine/retry/CompletableFutureRetryProcess.java similarity index 100% rename from core/common/state-machine/src/main/java/org/eclipse/edc/statemachine/retry/CompletableFutureRetryProcess.java rename to core/common/lib/state-machine-lib/src/main/java/org/eclipse/edc/statemachine/retry/CompletableFutureRetryProcess.java diff --git a/core/common/state-machine/src/main/java/org/eclipse/edc/statemachine/retry/EntityRetryProcessConfiguration.java b/core/common/lib/state-machine-lib/src/main/java/org/eclipse/edc/statemachine/retry/EntityRetryProcessConfiguration.java similarity index 100% rename from core/common/state-machine/src/main/java/org/eclipse/edc/statemachine/retry/EntityRetryProcessConfiguration.java rename to core/common/lib/state-machine-lib/src/main/java/org/eclipse/edc/statemachine/retry/EntityRetryProcessConfiguration.java diff --git a/core/common/state-machine/src/main/java/org/eclipse/edc/statemachine/retry/EntityRetryProcessFactory.java b/core/common/lib/state-machine-lib/src/main/java/org/eclipse/edc/statemachine/retry/EntityRetryProcessFactory.java similarity index 100% rename from core/common/state-machine/src/main/java/org/eclipse/edc/statemachine/retry/EntityRetryProcessFactory.java rename to core/common/lib/state-machine-lib/src/main/java/org/eclipse/edc/statemachine/retry/EntityRetryProcessFactory.java diff --git a/core/common/state-machine/src/main/java/org/eclipse/edc/statemachine/retry/RetryProcess.java b/core/common/lib/state-machine-lib/src/main/java/org/eclipse/edc/statemachine/retry/RetryProcess.java similarity index 100% rename from core/common/state-machine/src/main/java/org/eclipse/edc/statemachine/retry/RetryProcess.java rename to core/common/lib/state-machine-lib/src/main/java/org/eclipse/edc/statemachine/retry/RetryProcess.java diff --git a/core/common/state-machine/src/main/java/org/eclipse/edc/statemachine/retry/StatusResultRetryProcess.java b/core/common/lib/state-machine-lib/src/main/java/org/eclipse/edc/statemachine/retry/StatusResultRetryProcess.java similarity index 100% rename from core/common/state-machine/src/main/java/org/eclipse/edc/statemachine/retry/StatusResultRetryProcess.java rename to core/common/lib/state-machine-lib/src/main/java/org/eclipse/edc/statemachine/retry/StatusResultRetryProcess.java diff --git a/core/common/state-machine/src/test/java/org/eclipse/edc/statemachine/ProcessorImplTest.java b/core/common/lib/state-machine-lib/src/test/java/org/eclipse/edc/statemachine/ProcessorImplTest.java similarity index 100% rename from core/common/state-machine/src/test/java/org/eclipse/edc/statemachine/ProcessorImplTest.java rename to core/common/lib/state-machine-lib/src/test/java/org/eclipse/edc/statemachine/ProcessorImplTest.java diff --git a/core/common/state-machine/src/test/java/org/eclipse/edc/statemachine/StateMachineManagerTest.java b/core/common/lib/state-machine-lib/src/test/java/org/eclipse/edc/statemachine/StateMachineManagerTest.java similarity index 100% rename from core/common/state-machine/src/test/java/org/eclipse/edc/statemachine/StateMachineManagerTest.java rename to core/common/lib/state-machine-lib/src/test/java/org/eclipse/edc/statemachine/StateMachineManagerTest.java diff --git a/core/common/state-machine/src/test/java/org/eclipse/edc/statemachine/retry/AsyncStatusResultRetryProcessTest.java b/core/common/lib/state-machine-lib/src/test/java/org/eclipse/edc/statemachine/retry/AsyncStatusResultRetryProcessTest.java similarity index 100% rename from core/common/state-machine/src/test/java/org/eclipse/edc/statemachine/retry/AsyncStatusResultRetryProcessTest.java rename to core/common/lib/state-machine-lib/src/test/java/org/eclipse/edc/statemachine/retry/AsyncStatusResultRetryProcessTest.java diff --git a/core/common/state-machine/src/test/java/org/eclipse/edc/statemachine/retry/CompletableFutureRetryProcessTest.java b/core/common/lib/state-machine-lib/src/test/java/org/eclipse/edc/statemachine/retry/CompletableFutureRetryProcessTest.java similarity index 100% rename from core/common/state-machine/src/test/java/org/eclipse/edc/statemachine/retry/CompletableFutureRetryProcessTest.java rename to core/common/lib/state-machine-lib/src/test/java/org/eclipse/edc/statemachine/retry/CompletableFutureRetryProcessTest.java diff --git a/core/common/state-machine/src/test/java/org/eclipse/edc/statemachine/retry/RetryProcessTest.java b/core/common/lib/state-machine-lib/src/test/java/org/eclipse/edc/statemachine/retry/RetryProcessTest.java similarity index 100% rename from core/common/state-machine/src/test/java/org/eclipse/edc/statemachine/retry/RetryProcessTest.java rename to core/common/lib/state-machine-lib/src/test/java/org/eclipse/edc/statemachine/retry/RetryProcessTest.java diff --git a/core/common/state-machine/src/test/java/org/eclipse/edc/statemachine/retry/StatusResultRetryProcessTest.java b/core/common/lib/state-machine-lib/src/test/java/org/eclipse/edc/statemachine/retry/StatusResultRetryProcessTest.java similarity index 100% rename from core/common/state-machine/src/test/java/org/eclipse/edc/statemachine/retry/StatusResultRetryProcessTest.java rename to core/common/lib/state-machine-lib/src/test/java/org/eclipse/edc/statemachine/retry/StatusResultRetryProcessTest.java diff --git a/core/common/state-machine/src/test/java/org/eclipse/edc/statemachine/retry/TestEntity.java b/core/common/lib/state-machine-lib/src/test/java/org/eclipse/edc/statemachine/retry/TestEntity.java similarity index 100% rename from core/common/state-machine/src/test/java/org/eclipse/edc/statemachine/retry/TestEntity.java rename to core/common/lib/state-machine-lib/src/test/java/org/eclipse/edc/statemachine/retry/TestEntity.java diff --git a/core/common/lib/store-lib/build.gradle.kts b/core/common/lib/store-lib/build.gradle.kts new file mode 100644 index 00000000000..4a1bd2d1fa5 --- /dev/null +++ b/core/common/lib/store-lib/build.gradle.kts @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation + * + */ + +plugins { + `java-library` + `java-test-fixtures` + `maven-publish` +} + +dependencies { + api(project(":spi:common:core-spi")) + implementation(project(":core:common:util")) + + testImplementation(project(":core:common:lib:query-lib")) +} + + diff --git a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/store/InMemoryStatefulEntityStore.java b/core/common/lib/store-lib/src/main/java/org/eclipse/edc/store/InMemoryStatefulEntityStore.java similarity index 99% rename from core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/store/InMemoryStatefulEntityStore.java rename to core/common/lib/store-lib/src/main/java/org/eclipse/edc/store/InMemoryStatefulEntityStore.java index 9504ad63ae2..a576d1d8e16 100644 --- a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/store/InMemoryStatefulEntityStore.java +++ b/core/common/lib/store-lib/src/main/java/org/eclipse/edc/store/InMemoryStatefulEntityStore.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.connector.core.store; +package org.eclipse.edc.store; import org.eclipse.edc.spi.entity.StatefulEntity; import org.eclipse.edc.spi.persistence.Lease; diff --git a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/store/ReflectionBasedQueryResolver.java b/core/common/lib/store-lib/src/main/java/org/eclipse/edc/store/ReflectionBasedQueryResolver.java similarity index 98% rename from core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/store/ReflectionBasedQueryResolver.java rename to core/common/lib/store-lib/src/main/java/org/eclipse/edc/store/ReflectionBasedQueryResolver.java index e09ac49b783..8eb41615b99 100644 --- a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/store/ReflectionBasedQueryResolver.java +++ b/core/common/lib/store-lib/src/main/java/org/eclipse/edc/store/ReflectionBasedQueryResolver.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.connector.core.store; +package org.eclipse.edc.store; import org.eclipse.edc.spi.query.CriterionOperatorRegistry; import org.eclipse.edc.spi.query.QueryResolver; diff --git a/core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/store/ReflectionBasedQueryResolverTest.java b/core/common/lib/store-lib/src/test/java/org/eclipse/edc/store/ReflectionBasedQueryResolverTest.java similarity index 98% rename from core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/store/ReflectionBasedQueryResolverTest.java rename to core/common/lib/store-lib/src/test/java/org/eclipse/edc/store/ReflectionBasedQueryResolverTest.java index 239f9e69627..f1d58c8a382 100644 --- a/core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/store/ReflectionBasedQueryResolverTest.java +++ b/core/common/lib/store-lib/src/test/java/org/eclipse/edc/store/ReflectionBasedQueryResolverTest.java @@ -12,8 +12,9 @@ * */ -package org.eclipse.edc.connector.core.store; +package org.eclipse.edc.store; +import org.eclipse.edc.query.CriterionOperatorRegistryImpl; import org.eclipse.edc.spi.query.Criterion; import org.eclipse.edc.spi.query.QueryResolver; import org.eclipse.edc.spi.query.QuerySpec; diff --git a/core/common/token-core/build.gradle.kts b/core/common/token-core/build.gradle.kts index 478fa5b5c55..4ba70bb4da1 100644 --- a/core/common/token-core/build.gradle.kts +++ b/core/common/token-core/build.gradle.kts @@ -22,7 +22,7 @@ dependencies { api(project(":spi:common:token-spi")) api(project(":spi:common:jwt-spi")) - implementation(project(":extensions:common:crypto:crypto-common")) // for the CryptoConverter + implementation(project(":core:common:lib:crypto-common-lib")) // for the CryptoConverter implementation(libs.nimbus.jwt) api(libs.bouncyCastle.bcpkixJdk18on) } diff --git a/core/common/transform-core/build.gradle.kts b/core/common/transform-core/build.gradle.kts index 29547adfcb1..3e062aa6841 100644 --- a/core/common/transform-core/build.gradle.kts +++ b/core/common/transform-core/build.gradle.kts @@ -26,5 +26,5 @@ dependencies { api(libs.jakartaJson) testImplementation(project(":tests:junit-base")); - testImplementation(project(":extensions:common:json-ld")) + testImplementation(project(":core:common:lib:json-ld-lib")) } diff --git a/core/control-plane/catalog-core/build.gradle.kts b/core/control-plane/catalog-core/build.gradle.kts index 43bdafcb762..4634798ab74 100644 --- a/core/control-plane/catalog-core/build.gradle.kts +++ b/core/control-plane/catalog-core/build.gradle.kts @@ -25,6 +25,7 @@ dependencies { testImplementation(project(":core:common:connector-core")) testImplementation(project(":core:control-plane:control-plane-core")) + testImplementation(project(":core:common:lib:query-lib")) } diff --git a/core/control-plane/catalog-core/src/test/java/org/eclipse/edc/connector/catalog/DatasetResolverImplIntegrationTest.java b/core/control-plane/catalog-core/src/test/java/org/eclipse/edc/connector/catalog/DatasetResolverImplIntegrationTest.java index 11953c168d5..5f2d0f72c3f 100644 --- a/core/control-plane/catalog-core/src/test/java/org/eclipse/edc/connector/catalog/DatasetResolverImplIntegrationTest.java +++ b/core/control-plane/catalog-core/src/test/java/org/eclipse/edc/connector/catalog/DatasetResolverImplIntegrationTest.java @@ -17,11 +17,12 @@ import org.eclipse.edc.catalog.spi.DatasetResolver; import org.eclipse.edc.connector.contract.spi.offer.ContractDefinitionResolver; import org.eclipse.edc.connector.contract.spi.types.offer.ContractDefinition; -import org.eclipse.edc.connector.core.store.CriterionOperatorRegistryImpl; import org.eclipse.edc.connector.defaults.storage.assetindex.InMemoryAssetIndex; import org.eclipse.edc.connector.policy.spi.PolicyDefinition; import org.eclipse.edc.connector.policy.spi.store.PolicyDefinitionStore; +import org.eclipse.edc.connector.query.asset.AssetPropertyLookup; import org.eclipse.edc.policy.model.Policy; +import org.eclipse.edc.query.CriterionOperatorRegistryImpl; import org.eclipse.edc.spi.agent.ParticipantAgent; import org.eclipse.edc.spi.asset.AssetIndex; import org.eclipse.edc.spi.message.Range; @@ -60,17 +61,26 @@ */ class DatasetResolverImplIntegrationTest { - private final ContractDefinitionResolver contractDefinitionResolver = mock(); - private final PolicyDefinitionStore policyStore = mock(); - private final CriterionOperatorRegistry criterionOperatorRegistry = CriterionOperatorRegistryImpl.ofDefaults(); - private final AssetIndex assetIndex = new InMemoryAssetIndex(criterionOperatorRegistry); + private ContractDefinitionResolver contractDefinitionResolver; + private AssetIndex assetIndex; - private final DatasetResolver resolver = new DatasetResolverImpl(contractDefinitionResolver, assetIndex, policyStore, - mock(), criterionOperatorRegistry); + private DatasetResolver resolver; @BeforeEach void setUp() { - when(policyStore.findById(any())).thenReturn(PolicyDefinition.Builder.newInstance().policy(Policy.Builder.newInstance().build()).build()); + contractDefinitionResolver = mock(); + PolicyDefinitionStore policyStore = mock(); + CriterionOperatorRegistry criterionOperatorRegistry = CriterionOperatorRegistryImpl.ofDefaults(); + criterionOperatorRegistry.registerPropertyLookup(new AssetPropertyLookup()); + assetIndex = new InMemoryAssetIndex(criterionOperatorRegistry); + resolver = new DatasetResolverImpl( + contractDefinitionResolver, + assetIndex, + policyStore, + mock(), + criterionOperatorRegistry); + var policyDefinition = PolicyDefinition.Builder.newInstance().policy(Policy.Builder.newInstance().build()).build(); + when(policyStore.findById(any())).thenReturn(policyDefinition); } @Test diff --git a/core/control-plane/catalog-core/src/test/java/org/eclipse/edc/connector/catalog/DatasetResolverImplTest.java b/core/control-plane/catalog-core/src/test/java/org/eclipse/edc/connector/catalog/DatasetResolverImplTest.java index 50bde5b4565..0468dd10709 100644 --- a/core/control-plane/catalog-core/src/test/java/org/eclipse/edc/connector/catalog/DatasetResolverImplTest.java +++ b/core/control-plane/catalog-core/src/test/java/org/eclipse/edc/connector/catalog/DatasetResolverImplTest.java @@ -24,10 +24,10 @@ import org.eclipse.edc.connector.contract.spi.ContractOfferId; import org.eclipse.edc.connector.contract.spi.offer.ContractDefinitionResolver; import org.eclipse.edc.connector.contract.spi.types.offer.ContractDefinition; -import org.eclipse.edc.connector.core.store.CriterionOperatorRegistryImpl; import org.eclipse.edc.connector.policy.spi.PolicyDefinition; import org.eclipse.edc.connector.policy.spi.store.PolicyDefinitionStore; import org.eclipse.edc.policy.model.Policy; +import org.eclipse.edc.query.CriterionOperatorRegistryImpl; import org.eclipse.edc.spi.agent.ParticipantAgent; import org.eclipse.edc.spi.asset.AssetIndex; import org.eclipse.edc.spi.message.Range; diff --git a/core/control-plane/contract-core/build.gradle.kts b/core/control-plane/contract-core/build.gradle.kts index 5d89a920ddd..146daa3c99a 100644 --- a/core/control-plane/contract-core/build.gradle.kts +++ b/core/control-plane/contract-core/build.gradle.kts @@ -22,15 +22,18 @@ dependencies { api(project(":spi:common:policy-engine-spi")) api(project(":spi:control-plane:contract-spi")) - implementation(project(":core:common:connector-core")) - implementation(project(":core:common:state-machine")) + implementation(project(":core:common:lib:state-machine-lib")) + implementation(project(":core:control-plane:lib:control-plane-policies-lib")) implementation(libs.opentelemetry.instrumentation.annotations) + testImplementation(project(":spi:common:transaction-spi")) testImplementation(project(":core:control-plane:control-plane-core")) testImplementation(project(":core:control-plane:control-plane-aggregate-services")) testImplementation(project(":core:common:junit")) + testImplementation(project(":core:common:lib:query-lib")) + testImplementation(project(":core:common:lib:store-lib")) + testImplementation(project(":core:common:lib:policy-engine-lib")) testImplementation(libs.awaitility) - testImplementation(project(":core:common:policy-engine")) } diff --git a/core/control-plane/contract-core/src/main/java/org/eclipse/edc/connector/contract/ContractCoreExtension.java b/core/control-plane/contract-core/src/main/java/org/eclipse/edc/connector/contract/ContractCoreExtension.java index 9016e9ad1e9..ebecfd2c839 100644 --- a/core/control-plane/contract-core/src/main/java/org/eclipse/edc/connector/contract/ContractCoreExtension.java +++ b/core/control-plane/contract-core/src/main/java/org/eclipse/edc/connector/contract/ContractCoreExtension.java @@ -30,7 +30,7 @@ import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; import org.eclipse.edc.connector.contract.spi.validation.ContractValidationService; import org.eclipse.edc.connector.contract.validation.ContractValidationServiceImpl; -import org.eclipse.edc.connector.core.policy.ContractExpiryCheckFunction; +import org.eclipse.edc.connector.policy.contract.ContractExpiryCheckFunction; import org.eclipse.edc.connector.policy.spi.store.PolicyDefinitionStore; import org.eclipse.edc.policy.engine.spi.PolicyEngine; import org.eclipse.edc.policy.engine.spi.RuleBindingRegistry; @@ -57,12 +57,12 @@ import java.time.Clock; import static org.eclipse.edc.connector.contract.spi.validation.ContractValidationService.TRANSFER_SCOPE; -import static org.eclipse.edc.connector.core.entity.AbstractStateEntityManager.DEFAULT_BATCH_SIZE; -import static org.eclipse.edc.connector.core.entity.AbstractStateEntityManager.DEFAULT_ITERATION_WAIT; -import static org.eclipse.edc.connector.core.entity.AbstractStateEntityManager.DEFAULT_SEND_RETRY_BASE_DELAY; -import static org.eclipse.edc.connector.core.entity.AbstractStateEntityManager.DEFAULT_SEND_RETRY_LIMIT; -import static org.eclipse.edc.connector.core.policy.ContractExpiryCheckFunction.CONTRACT_EXPIRY_EVALUATION_KEY; +import static org.eclipse.edc.connector.policy.contract.ContractExpiryCheckFunction.CONTRACT_EXPIRY_EVALUATION_KEY; import static org.eclipse.edc.jsonld.spi.PropertyAndTypeNames.ODRL_USE_ACTION_ATTRIBUTE; +import static org.eclipse.edc.statemachine.AbstractStateEntityManager.DEFAULT_BATCH_SIZE; +import static org.eclipse.edc.statemachine.AbstractStateEntityManager.DEFAULT_ITERATION_WAIT; +import static org.eclipse.edc.statemachine.AbstractStateEntityManager.DEFAULT_SEND_RETRY_BASE_DELAY; +import static org.eclipse.edc.statemachine.AbstractStateEntityManager.DEFAULT_SEND_RETRY_LIMIT; @Provides({ ContractValidationService.class, ConsumerContractNegotiationManager.class, diff --git a/core/control-plane/contract-core/src/main/java/org/eclipse/edc/connector/contract/negotiation/AbstractContractNegotiationManager.java b/core/control-plane/contract-core/src/main/java/org/eclipse/edc/connector/contract/negotiation/AbstractContractNegotiationManager.java index e30a8f0fdc2..fbac546445d 100644 --- a/core/control-plane/contract-core/src/main/java/org/eclipse/edc/connector/contract/negotiation/AbstractContractNegotiationManager.java +++ b/core/control-plane/contract-core/src/main/java/org/eclipse/edc/connector/contract/negotiation/AbstractContractNegotiationManager.java @@ -22,13 +22,13 @@ import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiationStates; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiationTerminationMessage; import org.eclipse.edc.connector.contract.spi.types.protocol.ContractNegotiationAck; -import org.eclipse.edc.connector.core.entity.AbstractStateEntityManager; import org.eclipse.edc.connector.policy.spi.store.PolicyDefinitionStore; import org.eclipse.edc.spi.message.RemoteMessageDispatcherRegistry; import org.eclipse.edc.spi.protocol.ProtocolWebhook; import org.eclipse.edc.spi.query.Criterion; import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.spi.types.domain.message.ProcessRemoteMessage; +import org.eclipse.edc.statemachine.AbstractStateEntityManager; import org.eclipse.edc.statemachine.Processor; import org.eclipse.edc.statemachine.ProcessorImpl; import org.eclipse.edc.statemachine.retry.AsyncStatusResultRetryProcess; diff --git a/core/control-plane/contract-core/src/test/java/org/eclipse/edc/connector/contract/negotiation/ContractNegotiationIntegrationTest.java b/core/control-plane/contract-core/src/test/java/org/eclipse/edc/connector/contract/negotiation/ContractNegotiationIntegrationTest.java index 5497056cb6e..d36132e1a5e 100644 --- a/core/control-plane/contract-core/src/test/java/org/eclipse/edc/connector/contract/negotiation/ContractNegotiationIntegrationTest.java +++ b/core/control-plane/contract-core/src/test/java/org/eclipse/edc/connector/contract/negotiation/ContractNegotiationIntegrationTest.java @@ -32,7 +32,6 @@ import org.eclipse.edc.connector.contract.spi.validation.ContractValidationService; import org.eclipse.edc.connector.contract.spi.validation.ValidatableConsumerOffer; import org.eclipse.edc.connector.contract.spi.validation.ValidatedConsumerOffer; -import org.eclipse.edc.connector.core.store.CriterionOperatorRegistryImpl; import org.eclipse.edc.connector.defaults.storage.contractnegotiation.InMemoryContractNegotiationStore; import org.eclipse.edc.connector.policy.spi.store.PolicyDefinitionStore; import org.eclipse.edc.connector.service.contractnegotiation.ContractNegotiationProtocolServiceImpl; @@ -43,6 +42,7 @@ import org.eclipse.edc.policy.model.Duty; import org.eclipse.edc.policy.model.Policy; import org.eclipse.edc.policy.model.PolicyType; +import org.eclipse.edc.query.CriterionOperatorRegistryImpl; import org.eclipse.edc.spi.agent.ParticipantAgent; import org.eclipse.edc.spi.iam.TokenRepresentation; import org.eclipse.edc.spi.message.RemoteMessageDispatcherRegistry; diff --git a/core/control-plane/control-plane-aggregate-services/build.gradle.kts b/core/control-plane/control-plane-aggregate-services/build.gradle.kts index 240db41b439..a267a031a33 100644 --- a/core/control-plane/control-plane-aggregate-services/build.gradle.kts +++ b/core/control-plane/control-plane-aggregate-services/build.gradle.kts @@ -26,6 +26,7 @@ dependencies { implementation(libs.opentelemetry.instrumentation.annotations) + testImplementation(project(":core:common:connector-core")) testImplementation(project(":core:control-plane:catalog-core")) testImplementation(project(":core:control-plane:contract-core")) testImplementation(project(":core:control-plane:control-plane-core")) diff --git a/core/control-plane/control-plane-core/build.gradle.kts b/core/control-plane/control-plane-core/build.gradle.kts index fc62fd6ddc7..2a081d925f4 100644 --- a/core/control-plane/control-plane-core/build.gradle.kts +++ b/core/control-plane/control-plane-core/build.gradle.kts @@ -20,14 +20,15 @@ plugins { dependencies { api(project(":spi:control-plane:control-plane-spi")) - implementation(project(":core:common:connector-core")) + implementation(project(":core:common:lib:store-lib")) implementation(project(":core:common:boot")) - implementation(project(":core:common:policy-engine")) implementation(project(":core:control-plane:catalog-core")) implementation(project(":core:control-plane:contract-core")) implementation(project(":core:control-plane:transfer-core")) implementation(project(":core:control-plane:control-plane-aggregate-services")) implementation(project(":core:common:util")) + implementation(project(":core:common:lib:policy-engine-lib")) + implementation(project(":core:common:lib:query-lib")) testImplementation(testFixtures(project(":spi:common:core-spi"))) testImplementation(testFixtures(project(":spi:control-plane:contract-spi"))) diff --git a/core/control-plane/control-plane-core/src/main/java/org/eclipse/edc/connector/ControlPlaneDefaultServicesExtension.java b/core/control-plane/control-plane-core/src/main/java/org/eclipse/edc/connector/ControlPlaneDefaultServicesExtension.java index 2fc102a53a5..af2708180a7 100644 --- a/core/control-plane/control-plane-core/src/main/java/org/eclipse/edc/connector/ControlPlaneDefaultServicesExtension.java +++ b/core/control-plane/control-plane-core/src/main/java/org/eclipse/edc/connector/ControlPlaneDefaultServicesExtension.java @@ -24,6 +24,7 @@ import org.eclipse.edc.connector.defaults.storage.policydefinition.InMemoryPolicyDefinitionStore; import org.eclipse.edc.connector.defaults.storage.transferprocess.InMemoryTransferProcessStore; import org.eclipse.edc.connector.policy.spi.store.PolicyDefinitionStore; +import org.eclipse.edc.connector.query.asset.AssetPropertyLookup; import org.eclipse.edc.connector.spi.callback.CallbackRegistry; import org.eclipse.edc.connector.spi.protocol.ProtocolVersionRegistry; import org.eclipse.edc.connector.transfer.spi.store.TransferProcessStore; @@ -34,6 +35,7 @@ import org.eclipse.edc.spi.asset.DataAddressResolver; import org.eclipse.edc.spi.query.CriterionOperatorRegistry; import org.eclipse.edc.spi.system.ServiceExtension; +import org.eclipse.edc.spi.system.ServiceExtensionContext; import org.eclipse.edc.util.concurrency.LockManager; import java.time.Clock; @@ -60,6 +62,11 @@ public String name() { @Inject private CriterionOperatorRegistry criterionOperatorRegistry; + @Override + public void initialize(ServiceExtensionContext context) { + criterionOperatorRegistry.registerPropertyLookup(new AssetPropertyLookup()); + } + @Provider(isDefault = true) public AssetIndex defaultAssetIndex() { return getAssetIndex(); diff --git a/core/control-plane/control-plane-core/src/main/java/org/eclipse/edc/connector/defaults/storage/contractdefinition/InMemoryContractDefinitionStore.java b/core/control-plane/control-plane-core/src/main/java/org/eclipse/edc/connector/defaults/storage/contractdefinition/InMemoryContractDefinitionStore.java index 6fa6ae253fb..dfb87b97c35 100644 --- a/core/control-plane/control-plane-core/src/main/java/org/eclipse/edc/connector/defaults/storage/contractdefinition/InMemoryContractDefinitionStore.java +++ b/core/control-plane/control-plane-core/src/main/java/org/eclipse/edc/connector/defaults/storage/contractdefinition/InMemoryContractDefinitionStore.java @@ -17,11 +17,11 @@ import org.eclipse.edc.connector.contract.spi.offer.store.ContractDefinitionStore; import org.eclipse.edc.connector.contract.spi.types.offer.ContractDefinition; -import org.eclipse.edc.connector.core.store.ReflectionBasedQueryResolver; import org.eclipse.edc.spi.query.CriterionOperatorRegistry; import org.eclipse.edc.spi.query.QueryResolver; import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.spi.result.StoreResult; +import org.eclipse.edc.store.ReflectionBasedQueryResolver; import org.jetbrains.annotations.NotNull; import java.util.Map; diff --git a/core/control-plane/control-plane-core/src/main/java/org/eclipse/edc/connector/defaults/storage/contractnegotiation/InMemoryContractNegotiationStore.java b/core/control-plane/control-plane-core/src/main/java/org/eclipse/edc/connector/defaults/storage/contractnegotiation/InMemoryContractNegotiationStore.java index 524278cbff5..e9c2166dc35 100644 --- a/core/control-plane/control-plane-core/src/main/java/org/eclipse/edc/connector/defaults/storage/contractnegotiation/InMemoryContractNegotiationStore.java +++ b/core/control-plane/control-plane-core/src/main/java/org/eclipse/edc/connector/defaults/storage/contractnegotiation/InMemoryContractNegotiationStore.java @@ -17,13 +17,13 @@ import org.eclipse.edc.connector.contract.spi.negotiation.store.ContractNegotiationStore; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; -import org.eclipse.edc.connector.core.store.InMemoryStatefulEntityStore; -import org.eclipse.edc.connector.core.store.ReflectionBasedQueryResolver; import org.eclipse.edc.spi.query.CriterionOperatorRegistry; import org.eclipse.edc.spi.query.QueryResolver; import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.spi.result.StoreResult; import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; +import org.eclipse.edc.store.InMemoryStatefulEntityStore; +import org.eclipse.edc.store.ReflectionBasedQueryResolver; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/core/control-plane/control-plane-core/src/main/java/org/eclipse/edc/connector/defaults/storage/policydefinition/InMemoryPolicyDefinitionStore.java b/core/control-plane/control-plane-core/src/main/java/org/eclipse/edc/connector/defaults/storage/policydefinition/InMemoryPolicyDefinitionStore.java index 3e7d2754955..2424ee93e76 100644 --- a/core/control-plane/control-plane-core/src/main/java/org/eclipse/edc/connector/defaults/storage/policydefinition/InMemoryPolicyDefinitionStore.java +++ b/core/control-plane/control-plane-core/src/main/java/org/eclipse/edc/connector/defaults/storage/policydefinition/InMemoryPolicyDefinitionStore.java @@ -14,7 +14,6 @@ package org.eclipse.edc.connector.defaults.storage.policydefinition; -import org.eclipse.edc.connector.core.store.ReflectionBasedQueryResolver; import org.eclipse.edc.connector.policy.spi.PolicyDefinition; import org.eclipse.edc.connector.policy.spi.store.PolicyDefinitionStore; import org.eclipse.edc.spi.persistence.EdcPersistenceException; @@ -22,6 +21,7 @@ import org.eclipse.edc.spi.query.QueryResolver; import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.spi.result.StoreResult; +import org.eclipse.edc.store.ReflectionBasedQueryResolver; import org.eclipse.edc.util.concurrency.LockManager; import java.util.HashMap; diff --git a/core/control-plane/control-plane-core/src/main/java/org/eclipse/edc/connector/defaults/storage/transferprocess/InMemoryTransferProcessStore.java b/core/control-plane/control-plane-core/src/main/java/org/eclipse/edc/connector/defaults/storage/transferprocess/InMemoryTransferProcessStore.java index 4c9abfc6a2a..d473a493384 100644 --- a/core/control-plane/control-plane-core/src/main/java/org/eclipse/edc/connector/defaults/storage/transferprocess/InMemoryTransferProcessStore.java +++ b/core/control-plane/control-plane-core/src/main/java/org/eclipse/edc/connector/defaults/storage/transferprocess/InMemoryTransferProcessStore.java @@ -14,12 +14,12 @@ package org.eclipse.edc.connector.defaults.storage.transferprocess; -import org.eclipse.edc.connector.core.store.InMemoryStatefulEntityStore; import org.eclipse.edc.connector.transfer.spi.store.TransferProcessStore; import org.eclipse.edc.connector.transfer.spi.types.TransferProcess; import org.eclipse.edc.spi.query.CriterionOperatorRegistry; import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.spi.result.StoreResult; +import org.eclipse.edc.store.InMemoryStatefulEntityStore; import org.jetbrains.annotations.Nullable; import java.time.Clock; diff --git a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/store/AssetPropertyLookup.java b/core/control-plane/control-plane-core/src/main/java/org/eclipse/edc/connector/query/asset/AssetPropertyLookup.java similarity index 94% rename from core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/store/AssetPropertyLookup.java rename to core/control-plane/control-plane-core/src/main/java/org/eclipse/edc/connector/query/asset/AssetPropertyLookup.java index 756eceb936e..4f8139aefbf 100644 --- a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/store/AssetPropertyLookup.java +++ b/core/control-plane/control-plane-core/src/main/java/org/eclipse/edc/connector/query/asset/AssetPropertyLookup.java @@ -12,8 +12,9 @@ * */ -package org.eclipse.edc.connector.core.store; +package org.eclipse.edc.connector.query.asset; +import org.eclipse.edc.query.ReflectionPropertyLookup; import org.eclipse.edc.spi.query.PropertyLookup; import org.eclipse.edc.spi.types.domain.asset.Asset; diff --git a/core/control-plane/control-plane-core/src/test/java/org/eclipse/edc/connector/defaults/storage/assetindex/InMemoryAssetIndexTest.java b/core/control-plane/control-plane-core/src/test/java/org/eclipse/edc/connector/defaults/storage/assetindex/InMemoryAssetIndexTest.java index 5edaf161443..4b58a4819d0 100644 --- a/core/control-plane/control-plane-core/src/test/java/org/eclipse/edc/connector/defaults/storage/assetindex/InMemoryAssetIndexTest.java +++ b/core/control-plane/control-plane-core/src/test/java/org/eclipse/edc/connector/defaults/storage/assetindex/InMemoryAssetIndexTest.java @@ -15,7 +15,8 @@ package org.eclipse.edc.connector.defaults.storage.assetindex; -import org.eclipse.edc.connector.core.store.CriterionOperatorRegistryImpl; +import org.eclipse.edc.connector.query.asset.AssetPropertyLookup; +import org.eclipse.edc.query.CriterionOperatorRegistryImpl; import org.eclipse.edc.spi.asset.AssetIndex; import org.eclipse.edc.spi.testfixtures.asset.AssetIndexTestBase; import org.junit.jupiter.api.BeforeEach; @@ -26,7 +27,9 @@ class InMemoryAssetIndexTest extends AssetIndexTestBase { @BeforeEach void setUp() { - index = new InMemoryAssetIndex(CriterionOperatorRegistryImpl.ofDefaults()); + var registry = CriterionOperatorRegistryImpl.ofDefaults(); + registry.registerPropertyLookup(new AssetPropertyLookup()); + index = new InMemoryAssetIndex(registry); } @Override diff --git a/core/control-plane/control-plane-core/src/test/java/org/eclipse/edc/connector/defaults/storage/assetindex/InMemoryDataAddressResolverTest.java b/core/control-plane/control-plane-core/src/test/java/org/eclipse/edc/connector/defaults/storage/assetindex/InMemoryDataAddressResolverTest.java index 5f18570ca2e..e79099acace 100644 --- a/core/control-plane/control-plane-core/src/test/java/org/eclipse/edc/connector/defaults/storage/assetindex/InMemoryDataAddressResolverTest.java +++ b/core/control-plane/control-plane-core/src/test/java/org/eclipse/edc/connector/defaults/storage/assetindex/InMemoryDataAddressResolverTest.java @@ -14,7 +14,8 @@ package org.eclipse.edc.connector.defaults.storage.assetindex; -import org.eclipse.edc.connector.core.store.CriterionOperatorRegistryImpl; +import org.eclipse.edc.connector.query.asset.AssetPropertyLookup; +import org.eclipse.edc.query.CriterionOperatorRegistryImpl; import org.eclipse.edc.spi.types.domain.DataAddress; import org.eclipse.edc.spi.types.domain.asset.Asset; import org.junit.jupiter.api.BeforeEach; @@ -30,7 +31,9 @@ class InMemoryDataAddressResolverTest { @BeforeEach void setUp() { - resolver = new InMemoryAssetIndex(CriterionOperatorRegistryImpl.ofDefaults()); + var registry = CriterionOperatorRegistryImpl.ofDefaults(); + registry.registerPropertyLookup(new AssetPropertyLookup()); + resolver = new InMemoryAssetIndex(registry); } @Test diff --git a/core/control-plane/control-plane-core/src/test/java/org/eclipse/edc/connector/defaults/storage/contractdefinition/InMemoryContractDefinitionStoreTest.java b/core/control-plane/control-plane-core/src/test/java/org/eclipse/edc/connector/defaults/storage/contractdefinition/InMemoryContractDefinitionStoreTest.java index 27d673887ed..d7b1fb10353 100644 --- a/core/control-plane/control-plane-core/src/test/java/org/eclipse/edc/connector/defaults/storage/contractdefinition/InMemoryContractDefinitionStoreTest.java +++ b/core/control-plane/control-plane-core/src/test/java/org/eclipse/edc/connector/defaults/storage/contractdefinition/InMemoryContractDefinitionStoreTest.java @@ -16,7 +16,7 @@ import org.eclipse.edc.connector.contract.spi.offer.store.ContractDefinitionStore; import org.eclipse.edc.connector.contract.spi.testfixtures.offer.store.ContractDefinitionStoreTestBase; -import org.eclipse.edc.connector.core.store.CriterionOperatorRegistryImpl; +import org.eclipse.edc.query.CriterionOperatorRegistryImpl; class InMemoryContractDefinitionStoreTest extends ContractDefinitionStoreTestBase { diff --git a/core/control-plane/control-plane-core/src/test/java/org/eclipse/edc/connector/defaults/storage/contractnegotiation/InMemoryContractNegotiationStoreTest.java b/core/control-plane/control-plane-core/src/test/java/org/eclipse/edc/connector/defaults/storage/contractnegotiation/InMemoryContractNegotiationStoreTest.java index 69ef30cceb5..9c32eee6d9b 100644 --- a/core/control-plane/control-plane-core/src/test/java/org/eclipse/edc/connector/defaults/storage/contractnegotiation/InMemoryContractNegotiationStoreTest.java +++ b/core/control-plane/control-plane-core/src/test/java/org/eclipse/edc/connector/defaults/storage/contractnegotiation/InMemoryContractNegotiationStoreTest.java @@ -17,7 +17,7 @@ import org.eclipse.edc.connector.contract.spi.negotiation.store.ContractNegotiationStore; import org.eclipse.edc.connector.contract.spi.testfixtures.negotiation.store.ContractNegotiationStoreTestBase; -import org.eclipse.edc.connector.core.store.CriterionOperatorRegistryImpl; +import org.eclipse.edc.query.CriterionOperatorRegistryImpl; import java.time.Duration; diff --git a/core/control-plane/control-plane-core/src/test/java/org/eclipse/edc/connector/defaults/storage/policydefinition/InMemoryPolicyDefinitionStoreTest.java b/core/control-plane/control-plane-core/src/test/java/org/eclipse/edc/connector/defaults/storage/policydefinition/InMemoryPolicyDefinitionStoreTest.java index 7fc3d340fec..d7d84f59adc 100644 --- a/core/control-plane/control-plane-core/src/test/java/org/eclipse/edc/connector/defaults/storage/policydefinition/InMemoryPolicyDefinitionStoreTest.java +++ b/core/control-plane/control-plane-core/src/test/java/org/eclipse/edc/connector/defaults/storage/policydefinition/InMemoryPolicyDefinitionStoreTest.java @@ -14,9 +14,9 @@ package org.eclipse.edc.connector.defaults.storage.policydefinition; -import org.eclipse.edc.connector.core.store.CriterionOperatorRegistryImpl; import org.eclipse.edc.connector.policy.spi.store.PolicyDefinitionStore; import org.eclipse.edc.connector.policy.spi.testfixtures.store.PolicyDefinitionStoreTestBase; +import org.eclipse.edc.query.CriterionOperatorRegistryImpl; import org.eclipse.edc.util.concurrency.LockManager; import org.junit.jupiter.api.BeforeEach; diff --git a/core/control-plane/control-plane-core/src/test/java/org/eclipse/edc/connector/defaults/storage/transferprocess/InMemoryTransferProcessStoreTest.java b/core/control-plane/control-plane-core/src/test/java/org/eclipse/edc/connector/defaults/storage/transferprocess/InMemoryTransferProcessStoreTest.java index 924d261658d..284873c5a9b 100644 --- a/core/control-plane/control-plane-core/src/test/java/org/eclipse/edc/connector/defaults/storage/transferprocess/InMemoryTransferProcessStoreTest.java +++ b/core/control-plane/control-plane-core/src/test/java/org/eclipse/edc/connector/defaults/storage/transferprocess/InMemoryTransferProcessStoreTest.java @@ -14,9 +14,9 @@ package org.eclipse.edc.connector.defaults.storage.transferprocess; -import org.eclipse.edc.connector.core.store.CriterionOperatorRegistryImpl; import org.eclipse.edc.connector.transfer.spi.store.TransferProcessStore; import org.eclipse.edc.connector.transfer.spi.testfixtures.store.TransferProcessStoreTestBase; +import org.eclipse.edc.query.CriterionOperatorRegistryImpl; import java.time.Duration; diff --git a/core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/store/AssetPropertyLookupTest.java b/core/control-plane/control-plane-core/src/test/java/org/eclipse/edc/connector/query/asset/AssetPropertyLookupTest.java similarity index 98% rename from core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/store/AssetPropertyLookupTest.java rename to core/control-plane/control-plane-core/src/test/java/org/eclipse/edc/connector/query/asset/AssetPropertyLookupTest.java index af26d4700e8..2ccb68ce6a2 100644 --- a/core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/store/AssetPropertyLookupTest.java +++ b/core/control-plane/control-plane-core/src/test/java/org/eclipse/edc/connector/query/asset/AssetPropertyLookupTest.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.connector.core.store; +package org.eclipse.edc.connector.query.asset; import org.eclipse.edc.spi.query.PropertyLookup; import org.eclipse.edc.spi.types.domain.asset.Asset; diff --git a/core/control-plane/lib/control-plane-policies-lib/build.gradle.kts b/core/control-plane/lib/control-plane-policies-lib/build.gradle.kts new file mode 100644 index 00000000000..4551898e246 --- /dev/null +++ b/core/control-plane/lib/control-plane-policies-lib/build.gradle.kts @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation + * + */ + +plugins { + `java-library` +} + + +dependencies { + api(project(":spi:common:policy-engine-spi")) + api(project(":spi:common:core-spi")) + + testImplementation(project(":core:common:lib:policy-engine-lib")) + testImplementation(project(":core:common:junit")) +} + + diff --git a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/policy/ContractExpiryCheckFunction.java b/core/control-plane/lib/control-plane-policies-lib/src/main/java/org/eclipse/edc/connector/policy/contract/ContractExpiryCheckFunction.java similarity index 99% rename from core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/policy/ContractExpiryCheckFunction.java rename to core/control-plane/lib/control-plane-policies-lib/src/main/java/org/eclipse/edc/connector/policy/contract/ContractExpiryCheckFunction.java index 0cfd837c072..930267e0ae6 100644 --- a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/policy/ContractExpiryCheckFunction.java +++ b/core/control-plane/lib/control-plane-policies-lib/src/main/java/org/eclipse/edc/connector/policy/contract/ContractExpiryCheckFunction.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.connector.core.policy; +package org.eclipse.edc.connector.policy.contract; import org.eclipse.edc.policy.engine.spi.AtomicConstraintFunction; import org.eclipse.edc.policy.engine.spi.PolicyContext; diff --git a/core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/policy/ContractExpiryCheckFunctionEvaluationTest.java b/core/control-plane/lib/control-plane-policies-lib/src/test/java/org/eclipse/edc/connector/policy/contract/ContractExpiryCheckFunctionEvaluationTest.java similarity index 94% rename from core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/policy/ContractExpiryCheckFunctionEvaluationTest.java rename to core/control-plane/lib/control-plane-policies-lib/src/test/java/org/eclipse/edc/connector/policy/contract/ContractExpiryCheckFunctionEvaluationTest.java index 659ae780b03..cfe0798f1ce 100644 --- a/core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/policy/ContractExpiryCheckFunctionEvaluationTest.java +++ b/core/control-plane/lib/control-plane-policies-lib/src/test/java/org/eclipse/edc/connector/policy/contract/ContractExpiryCheckFunctionEvaluationTest.java @@ -12,9 +12,10 @@ * */ -package org.eclipse.edc.connector.core.policy; +package org.eclipse.edc.connector.policy.contract; import org.eclipse.edc.junit.annotations.ComponentTest; +import org.eclipse.edc.junit.assertions.AbstractResultAssert; import org.eclipse.edc.policy.engine.PolicyEngineImpl; import org.eclipse.edc.policy.engine.RuleBindingRegistryImpl; import org.eclipse.edc.policy.engine.ScopeFilter; @@ -44,8 +45,7 @@ import static java.time.Duration.ofDays; import static java.time.Duration.ofSeconds; import static java.time.Instant.now; -import static org.eclipse.edc.connector.core.policy.ContractExpiryCheckFunction.CONTRACT_EXPIRY_EVALUATION_KEY; -import static org.eclipse.edc.junit.assertions.AbstractResultAssert.assertThat; +import static org.eclipse.edc.connector.policy.contract.ContractExpiryCheckFunction.CONTRACT_EXPIRY_EVALUATION_KEY; import static org.eclipse.edc.policy.model.Operator.EQ; import static org.eclipse.edc.policy.model.Operator.GEQ; import static org.eclipse.edc.policy.model.Operator.GT; @@ -80,7 +80,7 @@ void evaluate_fixed_isValid(Operator startOp, Instant start, Operator endOp, Ins var result = policyEngine.evaluate(TRANSFER_SCOPE, policy, context); - assertThat(result).isSucceeded(); + AbstractResultAssert.assertThat(result).isSucceeded(); } @ParameterizedTest @@ -91,7 +91,7 @@ void evaluate_fixed_isInvalid(Operator startOp, Instant start, Operator endOp, I var result = policyEngine.evaluate(TRANSFER_SCOPE, policy, context); - assertThat(result) + AbstractResultAssert.assertThat(result) .isFailed() .detail().contains(CONTRACT_EXPIRY_EVALUATION_KEY); } @@ -107,7 +107,7 @@ void evaluate_durationAsEnd_isValid(String numeric) { var result = policyEngine.evaluate(TRANSFER_SCOPE, policy, context); - assertThat(result).isSucceeded(); + AbstractResultAssert.assertThat(result).isSucceeded(); } @ParameterizedTest @@ -121,7 +121,7 @@ void evaluate_durationAsStart_isValid(String numeric) { var result = policyEngine.evaluate(TRANSFER_SCOPE, policy, context); - assertThat(result).isSucceeded(); + AbstractResultAssert.assertThat(result).isSucceeded(); } @ParameterizedTest @@ -135,7 +135,7 @@ void evaluate_duration_invalidExpression(String numeric) { var result = policyEngine.evaluate(TRANSFER_SCOPE, policy, context); - assertThat(result).isFailed(); + AbstractResultAssert.assertThat(result).isFailed(); } private Policy createInForcePolicy(Operator operatorStart, Object startDate, Operator operatorEnd, Object endDate) { diff --git a/core/control-plane/transfer-core/build.gradle.kts b/core/control-plane/transfer-core/build.gradle.kts index f579bd99323..79343f2a06c 100644 --- a/core/control-plane/transfer-core/build.gradle.kts +++ b/core/control-plane/transfer-core/build.gradle.kts @@ -20,12 +20,13 @@ dependencies { api(project(":spi:control-plane:transfer-spi")) api(project(":spi:common:transform-spi")) - implementation(project(":core:common:connector-core")) - implementation(project(":core:common:state-machine")) + implementation(project(":core:common:lib:state-machine-lib")) implementation(project(":core:common:util")) implementation(libs.opentelemetry.instrumentation.annotations) + testImplementation(project(":core:common:lib:query-lib")) + testImplementation(project(":core:common:lib:store-lib")) testImplementation(project(":core:common:junit")) testImplementation(project(":core:control-plane:control-plane-core")) testImplementation(libs.awaitility) diff --git a/core/control-plane/transfer-core/src/main/java/org/eclipse/edc/connector/transfer/TransferCoreExtension.java b/core/control-plane/transfer-core/src/main/java/org/eclipse/edc/connector/transfer/TransferCoreExtension.java index d7e33d47def..1adf393421b 100644 --- a/core/control-plane/transfer-core/src/main/java/org/eclipse/edc/connector/transfer/TransferCoreExtension.java +++ b/core/control-plane/transfer-core/src/main/java/org/eclipse/edc/connector/transfer/TransferCoreExtension.java @@ -59,10 +59,10 @@ import java.time.Clock; -import static org.eclipse.edc.connector.core.entity.AbstractStateEntityManager.DEFAULT_BATCH_SIZE; -import static org.eclipse.edc.connector.core.entity.AbstractStateEntityManager.DEFAULT_ITERATION_WAIT; -import static org.eclipse.edc.connector.core.entity.AbstractStateEntityManager.DEFAULT_SEND_RETRY_BASE_DELAY; -import static org.eclipse.edc.connector.core.entity.AbstractStateEntityManager.DEFAULT_SEND_RETRY_LIMIT; +import static org.eclipse.edc.statemachine.AbstractStateEntityManager.DEFAULT_BATCH_SIZE; +import static org.eclipse.edc.statemachine.AbstractStateEntityManager.DEFAULT_ITERATION_WAIT; +import static org.eclipse.edc.statemachine.AbstractStateEntityManager.DEFAULT_SEND_RETRY_BASE_DELAY; +import static org.eclipse.edc.statemachine.AbstractStateEntityManager.DEFAULT_SEND_RETRY_LIMIT; /** * Provides core data transfer services to the system. diff --git a/core/control-plane/transfer-core/src/main/java/org/eclipse/edc/connector/transfer/process/TransferProcessManagerImpl.java b/core/control-plane/transfer-core/src/main/java/org/eclipse/edc/connector/transfer/process/TransferProcessManagerImpl.java index c4f491eac46..54862b19ded 100644 --- a/core/control-plane/transfer-core/src/main/java/org/eclipse/edc/connector/transfer/process/TransferProcessManagerImpl.java +++ b/core/control-plane/transfer-core/src/main/java/org/eclipse/edc/connector/transfer/process/TransferProcessManagerImpl.java @@ -18,7 +18,6 @@ package org.eclipse.edc.connector.transfer.process; import io.opentelemetry.instrumentation.annotations.WithSpan; -import org.eclipse.edc.connector.core.entity.AbstractStateEntityManager; import org.eclipse.edc.connector.policy.spi.store.PolicyArchive; import org.eclipse.edc.connector.transfer.provision.DeprovisionResponsesHandler; import org.eclipse.edc.connector.transfer.provision.ProvisionResponsesHandler; @@ -52,6 +51,7 @@ import org.eclipse.edc.spi.retry.WaitStrategy; import org.eclipse.edc.spi.security.Vault; import org.eclipse.edc.spi.types.domain.DataAddress; +import org.eclipse.edc.statemachine.AbstractStateEntityManager; import org.eclipse.edc.statemachine.Processor; import org.eclipse.edc.statemachine.ProcessorImpl; import org.eclipse.edc.statemachine.StateMachineManager; diff --git a/core/control-plane/transfer-core/src/test/java/org/eclipse/edc/connector/transfer/process/TransferProcessManagerImplIntegrationTest.java b/core/control-plane/transfer-core/src/test/java/org/eclipse/edc/connector/transfer/process/TransferProcessManagerImplIntegrationTest.java index d4a47583338..4b001edec99 100644 --- a/core/control-plane/transfer-core/src/test/java/org/eclipse/edc/connector/transfer/process/TransferProcessManagerImplIntegrationTest.java +++ b/core/control-plane/transfer-core/src/test/java/org/eclipse/edc/connector/transfer/process/TransferProcessManagerImplIntegrationTest.java @@ -14,7 +14,6 @@ package org.eclipse.edc.connector.transfer.process; -import org.eclipse.edc.connector.core.store.CriterionOperatorRegistryImpl; import org.eclipse.edc.connector.defaults.storage.transferprocess.InMemoryTransferProcessStore; import org.eclipse.edc.connector.policy.spi.store.PolicyArchive; import org.eclipse.edc.connector.transfer.TestProvisionedDataDestinationResource; @@ -38,6 +37,7 @@ import org.eclipse.edc.connector.transfer.spi.types.protocol.TransferTerminationMessage; import org.eclipse.edc.junit.annotations.ComponentTest; import org.eclipse.edc.policy.model.Policy; +import org.eclipse.edc.query.CriterionOperatorRegistryImpl; import org.eclipse.edc.spi.entity.StatefulEntity; import org.eclipse.edc.spi.message.RemoteMessageDispatcherRegistry; import org.eclipse.edc.spi.monitor.Monitor; diff --git a/core/data-plane-selector/data-plane-selector-core/build.gradle.kts b/core/data-plane-selector/data-plane-selector-core/build.gradle.kts index d87ee49b39f..db2ad077c73 100644 --- a/core/data-plane-selector/data-plane-selector-core/build.gradle.kts +++ b/core/data-plane-selector/data-plane-selector-core/build.gradle.kts @@ -18,8 +18,9 @@ plugins { dependencies { api(project(":spi:data-plane-selector:data-plane-selector-spi")) - api(project(":core:common:connector-core")) - api(project(":core:common:boot")) +// api(project(":core:common:connector-core")) +// api(project(":core:common:boot")) + implementation(project(":spi:common:transaction-spi")) implementation(project(":core:common:util")) testImplementation(testFixtures(project(":spi:data-plane-selector:data-plane-selector-spi"))) diff --git a/core/data-plane/data-plane-core/build.gradle.kts b/core/data-plane/data-plane-core/build.gradle.kts index 39cf1d99571..78bf3ce5928 100644 --- a/core/data-plane/data-plane-core/build.gradle.kts +++ b/core/data-plane/data-plane-core/build.gradle.kts @@ -23,16 +23,17 @@ dependencies { api(project(":spi:data-plane:data-plane-spi")) implementation(project(":spi:common:token-spi")) + implementation(project(":core:common:lib:store-lib")) implementation(project(":core:common:token-core")) // for the JwtGenerationService - implementation(project(":core:common:connector-core")) implementation(project(":core:common:boot")) - implementation(project(":core:common:state-machine")) implementation(project(":core:common:util")) implementation(project(":core:data-plane:data-plane-util")) implementation(project(":extensions:common:http")) + implementation(project(":core:common:lib:state-machine-lib")) implementation(libs.opentelemetry.instrumentation.annotations) + testImplementation(project(":core:common:lib:query-lib")) testImplementation(project(":core:common:junit")) testImplementation(libs.awaitility) testImplementation(testFixtures(project(":spi:data-plane:data-plane-spi"))) diff --git a/core/data-plane/data-plane-core/src/main/java/org/eclipse/edc/connector/dataplane/framework/DataPlaneFrameworkExtension.java b/core/data-plane/data-plane-core/src/main/java/org/eclipse/edc/connector/dataplane/framework/DataPlaneFrameworkExtension.java index f92008c9487..8ae076962ef 100644 --- a/core/data-plane/data-plane-core/src/main/java/org/eclipse/edc/connector/dataplane/framework/DataPlaneFrameworkExtension.java +++ b/core/data-plane/data-plane-core/src/main/java/org/eclipse/edc/connector/dataplane/framework/DataPlaneFrameworkExtension.java @@ -44,10 +44,10 @@ import java.time.Clock; import java.util.concurrent.Executors; -import static org.eclipse.edc.connector.core.entity.AbstractStateEntityManager.DEFAULT_BATCH_SIZE; -import static org.eclipse.edc.connector.core.entity.AbstractStateEntityManager.DEFAULT_ITERATION_WAIT; -import static org.eclipse.edc.connector.core.entity.AbstractStateEntityManager.DEFAULT_SEND_RETRY_BASE_DELAY; -import static org.eclipse.edc.connector.core.entity.AbstractStateEntityManager.DEFAULT_SEND_RETRY_LIMIT; +import static org.eclipse.edc.statemachine.AbstractStateEntityManager.DEFAULT_BATCH_SIZE; +import static org.eclipse.edc.statemachine.AbstractStateEntityManager.DEFAULT_ITERATION_WAIT; +import static org.eclipse.edc.statemachine.AbstractStateEntityManager.DEFAULT_SEND_RETRY_BASE_DELAY; +import static org.eclipse.edc.statemachine.AbstractStateEntityManager.DEFAULT_SEND_RETRY_LIMIT; /** * Provides core services for the Data Plane Framework. diff --git a/core/data-plane/data-plane-core/src/main/java/org/eclipse/edc/connector/dataplane/framework/manager/DataPlaneManagerImpl.java b/core/data-plane/data-plane-core/src/main/java/org/eclipse/edc/connector/dataplane/framework/manager/DataPlaneManagerImpl.java index afa933efb06..b8667a87888 100644 --- a/core/data-plane/data-plane-core/src/main/java/org/eclipse/edc/connector/dataplane/framework/manager/DataPlaneManagerImpl.java +++ b/core/data-plane/data-plane-core/src/main/java/org/eclipse/edc/connector/dataplane/framework/manager/DataPlaneManagerImpl.java @@ -15,7 +15,6 @@ package org.eclipse.edc.connector.dataplane.framework.manager; import org.eclipse.edc.connector.api.client.spi.transferprocess.TransferProcessApiClient; -import org.eclipse.edc.connector.core.entity.AbstractStateEntityManager; import org.eclipse.edc.connector.dataplane.spi.DataFlow; import org.eclipse.edc.connector.dataplane.spi.DataFlowStates; import org.eclipse.edc.connector.dataplane.spi.iam.DataPlaneAuthorizationService; @@ -31,6 +30,7 @@ import org.eclipse.edc.spi.types.domain.transfer.DataFlowResponseMessage; import org.eclipse.edc.spi.types.domain.transfer.DataFlowStartMessage; import org.eclipse.edc.spi.types.domain.transfer.FlowType; +import org.eclipse.edc.statemachine.AbstractStateEntityManager; import org.eclipse.edc.statemachine.Processor; import org.eclipse.edc.statemachine.ProcessorImpl; import org.eclipse.edc.statemachine.StateMachineManager; diff --git a/core/data-plane/data-plane-core/src/main/java/org/eclipse/edc/connector/dataplane/framework/store/InMemoryAccessTokenDataStore.java b/core/data-plane/data-plane-core/src/main/java/org/eclipse/edc/connector/dataplane/framework/store/InMemoryAccessTokenDataStore.java index d897efa6d31..16cab8ea73a 100644 --- a/core/data-plane/data-plane-core/src/main/java/org/eclipse/edc/connector/dataplane/framework/store/InMemoryAccessTokenDataStore.java +++ b/core/data-plane/data-plane-core/src/main/java/org/eclipse/edc/connector/dataplane/framework/store/InMemoryAccessTokenDataStore.java @@ -14,13 +14,13 @@ package org.eclipse.edc.connector.dataplane.framework.store; -import org.eclipse.edc.connector.core.store.ReflectionBasedQueryResolver; import org.eclipse.edc.connector.dataplane.spi.AccessTokenData; import org.eclipse.edc.connector.dataplane.spi.store.AccessTokenDataStore; import org.eclipse.edc.spi.query.CriterionOperatorRegistry; import org.eclipse.edc.spi.query.QueryResolver; import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.spi.result.StoreResult; +import org.eclipse.edc.store.ReflectionBasedQueryResolver; import java.util.Collection; import java.util.Map; diff --git a/core/data-plane/data-plane-core/src/main/java/org/eclipse/edc/connector/dataplane/framework/store/InMemoryDataPlaneStore.java b/core/data-plane/data-plane-core/src/main/java/org/eclipse/edc/connector/dataplane/framework/store/InMemoryDataPlaneStore.java index 8edd3b979b8..f8fffc59e20 100644 --- a/core/data-plane/data-plane-core/src/main/java/org/eclipse/edc/connector/dataplane/framework/store/InMemoryDataPlaneStore.java +++ b/core/data-plane/data-plane-core/src/main/java/org/eclipse/edc/connector/dataplane/framework/store/InMemoryDataPlaneStore.java @@ -14,10 +14,10 @@ package org.eclipse.edc.connector.dataplane.framework.store; -import org.eclipse.edc.connector.core.store.InMemoryStatefulEntityStore; import org.eclipse.edc.connector.dataplane.spi.DataFlow; import org.eclipse.edc.connector.dataplane.spi.store.DataPlaneStore; import org.eclipse.edc.spi.query.CriterionOperatorRegistry; +import org.eclipse.edc.store.InMemoryStatefulEntityStore; import java.time.Clock; import java.util.UUID; diff --git a/core/data-plane/data-plane-core/src/test/java/org/eclipse/edc/connector/dataplane/framework/store/InMemoryAccessTokenDataStoreTest.java b/core/data-plane/data-plane-core/src/test/java/org/eclipse/edc/connector/dataplane/framework/store/InMemoryAccessTokenDataStoreTest.java index 098b672f2d2..5111199183b 100644 --- a/core/data-plane/data-plane-core/src/test/java/org/eclipse/edc/connector/dataplane/framework/store/InMemoryAccessTokenDataStoreTest.java +++ b/core/data-plane/data-plane-core/src/test/java/org/eclipse/edc/connector/dataplane/framework/store/InMemoryAccessTokenDataStoreTest.java @@ -14,9 +14,9 @@ package org.eclipse.edc.connector.dataplane.framework.store; -import org.eclipse.edc.connector.core.store.CriterionOperatorRegistryImpl; import org.eclipse.edc.connector.dataplane.spi.store.AccessTokenDataStore; import org.eclipse.edc.connector.dataplane.spi.store.AccessTokenDataTestBase; +import org.eclipse.edc.query.CriterionOperatorRegistryImpl; class InMemoryAccessTokenDataStoreTest extends AccessTokenDataTestBase { private final InMemoryAccessTokenDataStore store = new InMemoryAccessTokenDataStore(CriterionOperatorRegistryImpl.ofDefaults()); diff --git a/core/data-plane/data-plane-core/src/test/java/org/eclipse/edc/connector/dataplane/framework/store/InMemoryDataPlaneStoreTest.java b/core/data-plane/data-plane-core/src/test/java/org/eclipse/edc/connector/dataplane/framework/store/InMemoryDataPlaneStoreTest.java index 5f3abfe46ce..38198796e0e 100644 --- a/core/data-plane/data-plane-core/src/test/java/org/eclipse/edc/connector/dataplane/framework/store/InMemoryDataPlaneStoreTest.java +++ b/core/data-plane/data-plane-core/src/test/java/org/eclipse/edc/connector/dataplane/framework/store/InMemoryDataPlaneStoreTest.java @@ -14,9 +14,9 @@ package org.eclipse.edc.connector.dataplane.framework.store; -import org.eclipse.edc.connector.core.store.CriterionOperatorRegistryImpl; import org.eclipse.edc.connector.dataplane.spi.store.DataPlaneStore; import org.eclipse.edc.connector.dataplane.spi.testfixtures.store.DataPlaneStoreTestBase; +import org.eclipse.edc.query.CriterionOperatorRegistryImpl; import java.time.Clock; import java.time.Duration; diff --git a/core/policy-monitor/policy-monitor-core/build.gradle.kts b/core/policy-monitor/policy-monitor-core/build.gradle.kts index 57fca2fcffd..ea53c176cba 100644 --- a/core/policy-monitor/policy-monitor-core/build.gradle.kts +++ b/core/policy-monitor/policy-monitor-core/build.gradle.kts @@ -22,9 +22,12 @@ dependencies { api(project(":spi:control-plane:control-plane-spi")) api(project(":spi:control-plane:policy-spi")) api(project(":spi:control-plane:transfer-spi")) - implementation(project(":core:common:state-machine")) - implementation(project(":core:common:connector-core")) + implementation(project(":core:common:lib:state-machine-lib")) + implementation(project(":core:common:lib:store-lib")) + implementation(project(":core:control-plane:lib:control-plane-policies-lib")) + + testImplementation(project(":core:common:lib:query-lib")) testImplementation(project(":core:common:junit")) testImplementation(libs.awaitility) testImplementation(testFixtures(project(":spi:policy-monitor:policy-monitor-spi"))) diff --git a/core/policy-monitor/policy-monitor-core/src/main/java/org/eclipse/edc/connector/policy/monitor/PolicyMonitorExtension.java b/core/policy-monitor/policy-monitor-core/src/main/java/org/eclipse/edc/connector/policy/monitor/PolicyMonitorExtension.java index 6f1b5569cfb..40c58df7733 100644 --- a/core/policy-monitor/policy-monitor-core/src/main/java/org/eclipse/edc/connector/policy/monitor/PolicyMonitorExtension.java +++ b/core/policy-monitor/policy-monitor-core/src/main/java/org/eclipse/edc/connector/policy/monitor/PolicyMonitorExtension.java @@ -14,7 +14,7 @@ package org.eclipse.edc.connector.policy.monitor; -import org.eclipse.edc.connector.core.policy.ContractExpiryCheckFunction; +import org.eclipse.edc.connector.policy.contract.ContractExpiryCheckFunction; import org.eclipse.edc.connector.policy.monitor.manager.PolicyMonitorManagerImpl; import org.eclipse.edc.connector.policy.monitor.spi.PolicyMonitorManager; import org.eclipse.edc.connector.policy.monitor.spi.PolicyMonitorStore; @@ -39,11 +39,11 @@ import java.time.Clock; -import static org.eclipse.edc.connector.core.entity.AbstractStateEntityManager.DEFAULT_BATCH_SIZE; -import static org.eclipse.edc.connector.core.entity.AbstractStateEntityManager.DEFAULT_ITERATION_WAIT; -import static org.eclipse.edc.connector.core.policy.ContractExpiryCheckFunction.CONTRACT_EXPIRY_EVALUATION_KEY; +import static org.eclipse.edc.connector.policy.contract.ContractExpiryCheckFunction.CONTRACT_EXPIRY_EVALUATION_KEY; import static org.eclipse.edc.connector.policy.monitor.PolicyMonitorExtension.NAME; import static org.eclipse.edc.jsonld.spi.PropertyAndTypeNames.ODRL_USE_ACTION_ATTRIBUTE; +import static org.eclipse.edc.statemachine.AbstractStateEntityManager.DEFAULT_BATCH_SIZE; +import static org.eclipse.edc.statemachine.AbstractStateEntityManager.DEFAULT_ITERATION_WAIT; @Extension(value = NAME) @Provides({ PolicyMonitorManager.class }) diff --git a/core/policy-monitor/policy-monitor-core/src/main/java/org/eclipse/edc/connector/policy/monitor/manager/PolicyMonitorManagerImpl.java b/core/policy-monitor/policy-monitor-core/src/main/java/org/eclipse/edc/connector/policy/monitor/manager/PolicyMonitorManagerImpl.java index ba05f3bd71e..a23b8766f2a 100644 --- a/core/policy-monitor/policy-monitor-core/src/main/java/org/eclipse/edc/connector/policy/monitor/manager/PolicyMonitorManagerImpl.java +++ b/core/policy-monitor/policy-monitor-core/src/main/java/org/eclipse/edc/connector/policy/monitor/manager/PolicyMonitorManagerImpl.java @@ -14,7 +14,6 @@ package org.eclipse.edc.connector.policy.monitor.manager; -import org.eclipse.edc.connector.core.entity.AbstractStateEntityManager; import org.eclipse.edc.connector.policy.monitor.spi.PolicyMonitorEntry; import org.eclipse.edc.connector.policy.monitor.spi.PolicyMonitorEntryStates; import org.eclipse.edc.connector.policy.monitor.spi.PolicyMonitorManager; @@ -27,6 +26,7 @@ import org.eclipse.edc.policy.engine.spi.PolicyEngine; import org.eclipse.edc.spi.query.Criterion; import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; +import org.eclipse.edc.statemachine.AbstractStateEntityManager; import org.eclipse.edc.statemachine.Processor; import org.eclipse.edc.statemachine.ProcessorImpl; import org.eclipse.edc.statemachine.StateMachineManager; diff --git a/core/policy-monitor/policy-monitor-core/src/main/java/org/eclipse/edc/connector/policy/monitor/store/sql/InMemoryPolicyMonitorStore.java b/core/policy-monitor/policy-monitor-core/src/main/java/org/eclipse/edc/connector/policy/monitor/store/sql/InMemoryPolicyMonitorStore.java index 2329ec4d050..87447dcd30b 100644 --- a/core/policy-monitor/policy-monitor-core/src/main/java/org/eclipse/edc/connector/policy/monitor/store/sql/InMemoryPolicyMonitorStore.java +++ b/core/policy-monitor/policy-monitor-core/src/main/java/org/eclipse/edc/connector/policy/monitor/store/sql/InMemoryPolicyMonitorStore.java @@ -14,10 +14,10 @@ package org.eclipse.edc.connector.policy.monitor.store.sql; -import org.eclipse.edc.connector.core.store.InMemoryStatefulEntityStore; import org.eclipse.edc.connector.policy.monitor.spi.PolicyMonitorEntry; import org.eclipse.edc.connector.policy.monitor.spi.PolicyMonitorStore; import org.eclipse.edc.spi.query.CriterionOperatorRegistry; +import org.eclipse.edc.store.InMemoryStatefulEntityStore; import java.time.Clock; import java.util.UUID; diff --git a/core/policy-monitor/policy-monitor-core/src/test/java/org/eclipse/edc/connector/policy/monitor/PolicyMonitorExtensionTest.java b/core/policy-monitor/policy-monitor-core/src/test/java/org/eclipse/edc/connector/policy/monitor/PolicyMonitorExtensionTest.java index 669f4a35dd3..192f2025fe7 100644 --- a/core/policy-monitor/policy-monitor-core/src/test/java/org/eclipse/edc/connector/policy/monitor/PolicyMonitorExtensionTest.java +++ b/core/policy-monitor/policy-monitor-core/src/test/java/org/eclipse/edc/connector/policy/monitor/PolicyMonitorExtensionTest.java @@ -14,7 +14,7 @@ package org.eclipse.edc.connector.policy.monitor; -import org.eclipse.edc.connector.core.policy.ContractExpiryCheckFunction; +import org.eclipse.edc.connector.policy.contract.ContractExpiryCheckFunction; import org.eclipse.edc.junit.extensions.DependencyInjectionExtension; import org.eclipse.edc.policy.engine.spi.PolicyEngine; import org.eclipse.edc.policy.model.Permission; @@ -23,7 +23,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; -import static org.eclipse.edc.connector.core.policy.ContractExpiryCheckFunction.CONTRACT_EXPIRY_EVALUATION_KEY; +import static org.eclipse.edc.connector.policy.contract.ContractExpiryCheckFunction.CONTRACT_EXPIRY_EVALUATION_KEY; import static org.eclipse.edc.connector.policy.monitor.PolicyMonitorExtension.POLICY_MONITOR_SCOPE; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.ArgumentMatchers.isA; diff --git a/core/policy-monitor/policy-monitor-core/src/test/java/org/eclipse/edc/connector/policy/monitor/store/sql/InMemoryPolicyMonitorStoreTest.java b/core/policy-monitor/policy-monitor-core/src/test/java/org/eclipse/edc/connector/policy/monitor/store/sql/InMemoryPolicyMonitorStoreTest.java index 12386503821..081fd7e7f08 100644 --- a/core/policy-monitor/policy-monitor-core/src/test/java/org/eclipse/edc/connector/policy/monitor/store/sql/InMemoryPolicyMonitorStoreTest.java +++ b/core/policy-monitor/policy-monitor-core/src/test/java/org/eclipse/edc/connector/policy/monitor/store/sql/InMemoryPolicyMonitorStoreTest.java @@ -14,9 +14,9 @@ package org.eclipse.edc.connector.policy.monitor.store.sql; -import org.eclipse.edc.connector.core.store.CriterionOperatorRegistryImpl; import org.eclipse.edc.connector.policy.monitor.spi.PolicyMonitorStore; import org.eclipse.edc.connector.policy.monitor.spi.testfixtures.store.PolicyMonitorStoreTestBase; +import org.eclipse.edc.query.CriterionOperatorRegistryImpl; import java.time.Clock; import java.time.Duration; diff --git a/data-protocols/dsp/dsp-api-configuration/build.gradle.kts b/data-protocols/dsp/dsp-api-configuration/build.gradle.kts index 14df4fb70d9..092ca721610 100644 --- a/data-protocols/dsp/dsp-api-configuration/build.gradle.kts +++ b/data-protocols/dsp/dsp-api-configuration/build.gradle.kts @@ -21,7 +21,7 @@ dependencies { api(project(":spi:common:core-spi")) api(project(":data-protocols:dsp:dsp-spi")) api(project(":data-protocols:dsp:dsp-http-spi")) - implementation(project(":core:common:jersey-providers")) + implementation(project(":extensions:common:lib:jersey-providers-lib")) implementation(project(":core:common:transform-core")) testImplementation(project(":core:common:junit")) diff --git a/data-protocols/dsp/dsp-http-core/build.gradle.kts b/data-protocols/dsp/dsp-http-core/build.gradle.kts index 8f2381dec2a..16dbd3e5349 100644 --- a/data-protocols/dsp/dsp-http-core/build.gradle.kts +++ b/data-protocols/dsp/dsp-http-core/build.gradle.kts @@ -28,5 +28,6 @@ dependencies { api(project(":data-protocols:dsp:dsp-http-spi")) testImplementation(project(":core:common:junit")) + testImplementation(project(":core:common:lib:json-ld-lib")) testImplementation(project(":extensions:common:http:jersey-core")) } diff --git a/data-protocols/dsp/dsp-transfer-process/dsp-transfer-process-transform/build.gradle.kts b/data-protocols/dsp/dsp-transfer-process/dsp-transfer-process-transform/build.gradle.kts index e40c17f9c7d..712fb850821 100644 --- a/data-protocols/dsp/dsp-transfer-process/dsp-transfer-process-transform/build.gradle.kts +++ b/data-protocols/dsp/dsp-transfer-process/dsp-transfer-process-transform/build.gradle.kts @@ -24,6 +24,7 @@ dependencies { api(project(":data-protocols:dsp:dsp-spi")) api(project(":data-protocols:dsp:dsp-http-spi")) + testImplementation(project(":core:common:lib:json-ld-lib")) testImplementation(project(":core:common:junit")) } diff --git a/extensions/common/api/api-core/build.gradle.kts b/extensions/common/api/api-core/build.gradle.kts index 8bc421cdda7..2c498459fc4 100644 --- a/extensions/common/api/api-core/build.gradle.kts +++ b/extensions/common/api/api-core/build.gradle.kts @@ -32,8 +32,8 @@ dependencies { testImplementation(libs.jersey.server) testImplementation(project(":core:common:junit")) - testImplementation(project(":core:common:connector-core")) - testImplementation(project(":extensions:common:json-ld")) + testImplementation(project(":core:common:lib:query-lib")) + testImplementation(project(":core:common:lib:json-ld-lib")) } diff --git a/extensions/common/api/api-core/src/test/java/org/eclipse/edc/api/model/ApiCoreSchemaTest.java b/extensions/common/api/api-core/src/test/java/org/eclipse/edc/api/model/ApiCoreSchemaTest.java index 8df46887939..a35303a95aa 100644 --- a/extensions/common/api/api-core/src/test/java/org/eclipse/edc/api/model/ApiCoreSchemaTest.java +++ b/extensions/common/api/api-core/src/test/java/org/eclipse/edc/api/model/ApiCoreSchemaTest.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import jakarta.json.JsonObject; -import org.eclipse.edc.connector.core.store.CriterionOperatorRegistryImpl; import org.eclipse.edc.core.transform.TypeTransformerRegistryImpl; import org.eclipse.edc.core.transform.transformer.edc.to.JsonObjectToCriterionTransformer; import org.eclipse.edc.core.transform.transformer.edc.to.JsonObjectToQuerySpecTransformer; @@ -25,6 +24,7 @@ import org.eclipse.edc.jsonld.TitaniumJsonLd; import org.eclipse.edc.jsonld.spi.JsonLd; import org.eclipse.edc.jsonld.util.JacksonJsonLd; +import org.eclipse.edc.query.CriterionOperatorRegistryImpl; import org.eclipse.edc.spi.query.Criterion; import org.eclipse.edc.spi.query.CriterionOperatorRegistry; import org.eclipse.edc.spi.query.QuerySpec; diff --git a/extensions/common/api/management-api-configuration/build.gradle.kts b/extensions/common/api/management-api-configuration/build.gradle.kts index 410e0cb0e6c..644be5bce60 100644 --- a/extensions/common/api/management-api-configuration/build.gradle.kts +++ b/extensions/common/api/management-api-configuration/build.gradle.kts @@ -22,13 +22,14 @@ dependencies { api(project(":spi:common:web-spi")) api(project(":spi:control-plane:contract-spi")) - implementation(project(":core:common:jersey-providers")) - implementation(project(":core:common:transform-core")) + implementation(project(":extensions:common:lib:jersey-providers-lib")) implementation(project(":extensions:common:api:api-core")) + implementation(project(":core:common:transform-core")) implementation(libs.swagger.annotations.jakarta) testImplementation(project(":core:common:junit")) + testImplementation(project(":core:common:lib:json-ld-lib")) testImplementation(project(":extensions:common:json-ld")) } diff --git a/extensions/common/crypto/jws2020/build.gradle.kts b/extensions/common/crypto/jws2020/build.gradle.kts index c35e8d55b9b..4e3cae319ff 100644 --- a/extensions/common/crypto/jws2020/build.gradle.kts +++ b/extensions/common/crypto/jws2020/build.gradle.kts @@ -21,7 +21,7 @@ dependencies { implementation(project(":spi:common:json-ld-spi")) implementation(project(":extensions:common:json-ld")) implementation(project(":core:common:util")) - implementation(project(":extensions:common:crypto:crypto-common")) + implementation(project(":core:common:lib:crypto-common-lib")) implementation(libs.nimbus.jwt) // used for the Ed25519 Verifier in conjunction with OctetKeyPairs (OKP) runtimeOnly(libs.tink) @@ -32,7 +32,9 @@ dependencies { } testImplementation(testFixtures(project(":core:common:junit"))) + testImplementation(project(":core:common:lib:json-ld-lib")) + testFixturesImplementation(testFixtures(project(":core:common:junit"))) testFixturesImplementation(libs.nimbus.jwt) - testFixturesImplementation(project(":extensions:common:json-ld")) + testFixturesImplementation(project(":core:common:lib:json-ld-lib")) } diff --git a/extensions/common/crypto/jws2020/src/main/java/org/eclipse/edc/security/signature/jws2020/JwsSignature2020Suite.java b/extensions/common/crypto/jws2020/src/main/java/org/eclipse/edc/security/signature/jws2020/JwsSignature2020Suite.java index 29d3aaf1b74..cd2b2b9665b 100644 --- a/extensions/common/crypto/jws2020/src/main/java/org/eclipse/edc/security/signature/jws2020/JwsSignature2020Suite.java +++ b/extensions/common/crypto/jws2020/src/main/java/org/eclipse/edc/security/signature/jws2020/JwsSignature2020Suite.java @@ -19,7 +19,6 @@ import com.apicatalog.ld.signature.CryptoSuite; import com.apicatalog.ld.signature.SignatureSuite; import com.fasterxml.jackson.databind.ObjectMapper; -import org.eclipse.edc.jsonld.util.JacksonJsonLd; import java.net.URI; @@ -34,7 +33,7 @@ public final class JwsSignature2020Suite implements SignatureSuite { /** * Creates a new {@link JwsSignature2020Suite} using an object mapper. That mapper is needed because parts of the schema are plain JSON. * - * @param mapper a JSON-aware {@link ObjectMapper}, e.g. using {@link JacksonJsonLd#createObjectMapper()} + * @param mapper a JSON-aware {@link ObjectMapper} * @see Jws2020Schema */ public JwsSignature2020Suite(ObjectMapper mapper) { diff --git a/extensions/common/crypto/jwt-verifiable-credentials/build.gradle.kts b/extensions/common/crypto/jwt-verifiable-credentials/build.gradle.kts index a3fdfc3f6c5..0fb011df011 100644 --- a/extensions/common/crypto/jwt-verifiable-credentials/build.gradle.kts +++ b/extensions/common/crypto/jwt-verifiable-credentials/build.gradle.kts @@ -26,9 +26,9 @@ dependencies { implementation(project(":core:common:token-core")) // for the token rules - testImplementation(project(":extensions:common:json-ld")) + testImplementation(project(":core:common:lib:json-ld-lib")) testImplementation(project(":core:common:junit")) - testImplementation(project(":extensions:common:crypto:crypto-common")) + testImplementation(project(":core:common:lib:crypto-common-lib")) testFixturesImplementation(libs.nimbus.jwt) testFixturesImplementation(project(":spi:common:identity-did-spi")) } \ No newline at end of file diff --git a/extensions/common/crypto/ldp-verifiable-credentials/build.gradle.kts b/extensions/common/crypto/ldp-verifiable-credentials/build.gradle.kts index f994c252cb3..59828a1b683 100644 --- a/extensions/common/crypto/ldp-verifiable-credentials/build.gradle.kts +++ b/extensions/common/crypto/ldp-verifiable-credentials/build.gradle.kts @@ -30,9 +30,11 @@ dependencies { testImplementation(testFixtures(project(":core:common:junit"))) testImplementation(project(":extensions:common:crypto:jws2020")) + testImplementation(project(":core:common:lib:json-ld-lib")) // deps for test fixtures - testFixturesApi(project(":extensions:common:json-ld")) + testFixturesImplementation(project(":spi:common:json-ld-spi")) + testFixturesImplementation(project(":core:common:lib:json-ld-lib")) testFixturesApi(libs.nimbus.jwt) testFixturesApi(testFixtures(project(":extensions:common:crypto:jws2020"))) diff --git a/extensions/common/http/jersey-core/build.gradle.kts b/extensions/common/http/jersey-core/build.gradle.kts index f72abd3f05f..942e9f89134 100644 --- a/extensions/common/http/jersey-core/build.gradle.kts +++ b/extensions/common/http/jersey-core/build.gradle.kts @@ -20,7 +20,8 @@ plugins { dependencies { api(project(":spi:common:web-spi")) api(project(":extensions:common:http:jetty-core")) - implementation(project(":core:common:jersey-providers")) + + implementation(project(":extensions:common:lib:jersey-providers-lib")) implementation(libs.bundles.jersey.core) implementation(libs.jetty.jakarta.servlet.api) @@ -30,9 +31,10 @@ dependencies { testImplementation(libs.restAssured) + testFixturesApi(project(":core:common:lib:json-ld-lib")) testFixturesApi(project(":core:common:junit")) testFixturesApi(project(":extensions:common:json-ld")) - testFixturesImplementation(project(":core:common:jersey-providers")) + testFixturesImplementation(project(":extensions:common:lib:jersey-providers-lib")) testFixturesApi(libs.jakarta.rsApi) testFixturesApi(libs.jacksonJsonP) testFixturesApi(libs.junit.jupiter.api) diff --git a/extensions/common/iam/identity-trust/identity-trust-core/build.gradle.kts b/extensions/common/iam/identity-trust/identity-trust-core/build.gradle.kts index 2abac1634db..2dd13347ccc 100644 --- a/extensions/common/iam/identity-trust/identity-trust-core/build.gradle.kts +++ b/extensions/common/iam/identity-trust/identity-trust-core/build.gradle.kts @@ -9,18 +9,19 @@ dependencies { implementation(project(":spi:common:http-spi")) implementation(project(":spi:common:json-ld-spi")) implementation(project(":core:common:util")) + implementation(project(":core:common:lib:crypto-common-lib")) implementation(project(":core:common:token-core")) implementation(project(":extensions:common:crypto:jws2020")) implementation(project(":extensions:common:crypto:jwt-verifiable-credentials")) implementation(project(":extensions:common:crypto:ldp-verifiable-credentials")) - implementation(project(":extensions:common:crypto:crypto-common")) implementation(project(":extensions:common:iam:identity-trust:identity-trust-service")) implementation(project(":extensions:common:iam:identity-trust:identity-trust-sts:identity-trust-sts-embedded")) implementation(libs.nimbus.jwt) testImplementation(project(":core:common:junit")) testImplementation(testFixtures(project(":spi:common:identity-trust-spi"))) - testImplementation(libs.nimbus.jwt) + testImplementation(project(":core:common:lib:json-ld-lib")) testImplementation(project(":extensions:common:json-ld")) + testImplementation(libs.nimbus.jwt) } diff --git a/extensions/common/iam/identity-trust/identity-trust-service/build.gradle.kts b/extensions/common/iam/identity-trust/identity-trust-service/build.gradle.kts index 83d106bd36f..d7e8d69af8d 100644 --- a/extensions/common/iam/identity-trust/identity-trust-service/build.gradle.kts +++ b/extensions/common/iam/identity-trust/identity-trust-service/build.gradle.kts @@ -7,14 +7,16 @@ dependencies { api(project(":spi:common:identity-trust-spi")) api(project(":spi:common:identity-did-spi")) api(project(":spi:common:jwt-spi")) + api(project(":spi:common:token-spi")) implementation(project(":core:common:util")) implementation(libs.nimbus.jwt) implementation(libs.iron.ed25519) testImplementation(testFixtures(project(":spi:common:identity-trust-spi"))) testImplementation(project(":core:common:junit")) - testImplementation(project(":extensions:common:json-ld")) - testImplementation(project(":extensions:common:crypto:crypto-common")) + testImplementation(project(":spi:common:json-ld-spi")) + testImplementation(project(":core:common:lib:json-ld-lib")) + testImplementation(project(":core:common:lib:crypto-common-lib")) testImplementation(testFixtures(project(":extensions:common:crypto:ldp-verifiable-credentials"))) testImplementation(testFixtures(project(":extensions:common:crypto:jwt-verifiable-credentials"))) diff --git a/extensions/common/iam/identity-trust/identity-trust-sts/identity-trust-sts-embedded/build.gradle.kts b/extensions/common/iam/identity-trust/identity-trust-sts/identity-trust-sts-embedded/build.gradle.kts index 83dd6e96659..8a7fbc101f6 100644 --- a/extensions/common/iam/identity-trust/identity-trust-sts/identity-trust-sts-embedded/build.gradle.kts +++ b/extensions/common/iam/identity-trust/identity-trust-sts/identity-trust-sts-embedded/build.gradle.kts @@ -6,6 +6,7 @@ plugins { dependencies { api(project(":spi:common:identity-trust-spi")) api(project(":spi:common:jwt-spi")) + api(project(":spi:common:token-spi")) implementation(project(":core:common:util")) testImplementation(testFixtures(project(":spi:common:identity-trust-spi"))) diff --git a/extensions/common/iam/identity-trust/identity-trust-transform/build.gradle.kts b/extensions/common/iam/identity-trust/identity-trust-transform/build.gradle.kts index 88951aa1ea5..4c54256ac5c 100644 --- a/extensions/common/iam/identity-trust/identity-trust-transform/build.gradle.kts +++ b/extensions/common/iam/identity-trust/identity-trust-transform/build.gradle.kts @@ -24,6 +24,7 @@ dependencies { api(project(":spi:common:transform-spi")) api(libs.nimbus.jwt) + testImplementation(project(":core:common:lib:json-ld-lib")) testImplementation(project(":extensions:common:json-ld")) testImplementation(project(":core:common:transform-core")) //for the TransformerContextImpl testImplementation(project(":core:common:junit")) //for the TestUtils diff --git a/extensions/common/json-ld/build.gradle.kts b/extensions/common/json-ld/build.gradle.kts index 0853fa3931c..2806bb7b86d 100644 --- a/extensions/common/json-ld/build.gradle.kts +++ b/extensions/common/json-ld/build.gradle.kts @@ -21,13 +21,13 @@ dependencies { api(libs.jacksonJsonP) api(libs.titaniumJsonLd) - api(project(":spi:common:catalog-spi")) api(project(":spi:common:core-spi")) api(project(":spi:common:json-ld-spi")) - api(project(":spi:common:transform-spi")) + implementation(project(":core:common:lib:json-ld-lib")) testImplementation(project(":core:common:junit")); testImplementation(libs.mockserver.netty) testImplementation(libs.mockserver.client) + } diff --git a/extensions/common/json-ld/src/main/java/org/eclipse/edc/jsonld/JsonLdExtension.java b/extensions/common/json-ld/src/main/java/org/eclipse/edc/jsonld/JsonLdExtension.java index 7ef787ed90a..9056f56d97f 100644 --- a/extensions/common/json-ld/src/main/java/org/eclipse/edc/jsonld/JsonLdExtension.java +++ b/extensions/common/json-ld/src/main/java/org/eclipse/edc/jsonld/JsonLdExtension.java @@ -15,6 +15,7 @@ package org.eclipse.edc.jsonld; import org.eclipse.edc.jsonld.spi.JsonLd; +import org.eclipse.edc.jsonld.spi.JsonLdKeywords; import org.eclipse.edc.jsonld.spi.transformer.JsonLdTransformer; import org.eclipse.edc.jsonld.util.JacksonJsonLd; import org.eclipse.edc.runtime.metamodel.annotation.BaseExtension; @@ -34,7 +35,6 @@ import java.net.URISyntaxException; import static java.lang.String.format; -import static org.eclipse.edc.jsonld.spi.JsonLdKeywords.VOCAB; import static org.eclipse.edc.spi.CoreConstants.EDC_NAMESPACE; import static org.eclipse.edc.spi.CoreConstants.EDC_PREFIX; import static org.eclipse.edc.spi.CoreConstants.JSON_LD; @@ -85,7 +85,7 @@ public JsonLd createJsonLdService(ServiceExtensionContext context) { var monitor = context.getMonitor(); var service = new TitaniumJsonLd(monitor, configuration); if (!config.getBoolean(AVOID_VOCAB_CONTEXT, Boolean.valueOf(DEFAULT_AVOID_VOCAB_CONTEXT))) { - service.registerNamespace(VOCAB, EDC_NAMESPACE); + service.registerNamespace(JsonLdKeywords.VOCAB, EDC_NAMESPACE); } service.registerNamespace(EDC_PREFIX, EDC_NAMESPACE); diff --git a/extensions/common/json-ld/src/test/java/org/eclipse/edc/jsonld/JsonLdExtensionTest.java b/extensions/common/json-ld/src/test/java/org/eclipse/edc/jsonld/JsonLdExtensionTest.java index cc4bbd70508..71a6fc5d1ce 100644 --- a/extensions/common/json-ld/src/test/java/org/eclipse/edc/jsonld/JsonLdExtensionTest.java +++ b/extensions/common/json-ld/src/test/java/org/eclipse/edc/jsonld/JsonLdExtensionTest.java @@ -18,6 +18,7 @@ import org.eclipse.edc.junit.extensions.DependencyInjectionExtension; import org.eclipse.edc.spi.system.ServiceExtensionContext; import org.eclipse.edc.spi.system.configuration.ConfigFactory; +import org.eclipse.edc.util.reflection.ReflectionUtil; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -27,7 +28,6 @@ import java.util.Map; import static org.assertj.core.api.Assertions.assertThat; -import static org.eclipse.edc.util.reflection.ReflectionUtil.getFieldValue; import static org.mockito.Mockito.when; @ExtendWith(DependencyInjectionExtension.class) @@ -49,8 +49,8 @@ void verifyCachedDocsFromConfig_oneValidEntry(ServiceExtensionContext context, J when(context.getConfig()).thenReturn(config); var service = (TitaniumJsonLd) extension.createJsonLdService(context); - DocumentLoader documentLoader = getFieldValue("documentLoader", service); - Map cache = getFieldValue("uriCache", documentLoader); + var documentLoader = ReflectionUtil.getFieldValue("documentLoader", service); + Map cache = ReflectionUtil.getFieldValue("uriCache", documentLoader); assertThat(cache).containsEntry("http://foo.org/doc.json", new File("/tmp/foo/doc.json").toURI()); } @@ -65,8 +65,8 @@ void verifyCachedDocsFromConfig_oneValidEntry_withSuperfluous(ServiceExtensionCo when(context.getConfig()).thenReturn(config); var service = (TitaniumJsonLd) extension.createJsonLdService(context); - DocumentLoader documentLoader = getFieldValue("documentLoader", service); - Map cache = getFieldValue("uriCache", documentLoader); + DocumentLoader documentLoader = ReflectionUtil.getFieldValue("documentLoader", service); + Map cache = ReflectionUtil.getFieldValue("uriCache", documentLoader); assertThat(cache).containsEntry("http://foo.org/doc.json", new File("/tmp/foo/doc.json").toURI()); } @@ -82,8 +82,8 @@ void verifyCachedDocsFromConfig_multipleValidEntries(ServiceExtensionContext con when(context.getConfig()).thenReturn(config); var service = (TitaniumJsonLd) extension.createJsonLdService(context); - DocumentLoader documentLoader = getFieldValue("documentLoader", service); - Map cache = getFieldValue("uriCache", documentLoader); + DocumentLoader documentLoader = ReflectionUtil.getFieldValue("documentLoader", service); + Map cache = ReflectionUtil.getFieldValue("uriCache", documentLoader); assertThat(cache).containsEntry("http://foo.org/doc.json", new File("/tmp/foo/doc.json").toURI()); assertThat(cache).containsEntry("http://bar.org/doc.json", new File("/tmp/bar/doc.json").toURI()); @@ -99,8 +99,8 @@ void verifyCachedDocsFromConfig_multipleEntries_oneIncomplete(ServiceExtensionCo when(context.getConfig()).thenReturn(config); var service = (TitaniumJsonLd) extension.createJsonLdService(context); - DocumentLoader documentLoader = getFieldValue("documentLoader", service); - Map cache = getFieldValue("uriCache", documentLoader); + DocumentLoader documentLoader = ReflectionUtil.getFieldValue("documentLoader", service); + Map cache = ReflectionUtil.getFieldValue("uriCache", documentLoader); assertThat(cache).containsEntry("http://foo.org/doc.json", new File("/tmp/foo/doc.json").toURI()) .noneSatisfy((s, uri) -> assertThat(s).isEqualTo("http://bar.org/doc.json")); @@ -117,8 +117,8 @@ void verifyCachedDocsFromConfig_multipleEntries_oneInvalid(ServiceExtensionConte when(context.getConfig()).thenReturn(config); var service = (TitaniumJsonLd) extension.createJsonLdService(context); - DocumentLoader documentLoader = getFieldValue("documentLoader", service); - Map cache = getFieldValue("uriCache", documentLoader); + DocumentLoader documentLoader = ReflectionUtil.getFieldValue("documentLoader", service); + Map cache = ReflectionUtil.getFieldValue("uriCache", documentLoader); assertThat(cache).containsEntry("http://foo.org/doc.json", new File("/tmp/foo/doc.json").toURI()) .noneSatisfy((s, uri) -> assertThat(s).isEqualTo("http://bar.org/doc.json")); diff --git a/extensions/common/json-ld/src/test/resources/.gitignore b/extensions/common/json-ld/src/test/resources/.gitignore deleted file mode 100644 index ddb07bbf963..00000000000 --- a/extensions/common/json-ld/src/test/resources/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# enable jars for this folder -!*.jar diff --git a/core/common/jersey-providers/build.gradle.kts b/extensions/common/lib/jersey-providers-lib/build.gradle.kts similarity index 100% rename from core/common/jersey-providers/build.gradle.kts rename to extensions/common/lib/jersey-providers-lib/build.gradle.kts diff --git a/core/common/jersey-providers/src/main/java/org/eclipse/edc/web/jersey/jsonld/JerseyJsonLdInterceptor.java b/extensions/common/lib/jersey-providers-lib/src/main/java/org/eclipse/edc/web/jersey/jsonld/JerseyJsonLdInterceptor.java similarity index 100% rename from core/common/jersey-providers/src/main/java/org/eclipse/edc/web/jersey/jsonld/JerseyJsonLdInterceptor.java rename to extensions/common/lib/jersey-providers-lib/src/main/java/org/eclipse/edc/web/jersey/jsonld/JerseyJsonLdInterceptor.java diff --git a/core/common/jersey-providers/src/main/java/org/eclipse/edc/web/jersey/jsonld/ObjectMapperProvider.java b/extensions/common/lib/jersey-providers-lib/src/main/java/org/eclipse/edc/web/jersey/jsonld/ObjectMapperProvider.java similarity index 100% rename from core/common/jersey-providers/src/main/java/org/eclipse/edc/web/jersey/jsonld/ObjectMapperProvider.java rename to extensions/common/lib/jersey-providers-lib/src/main/java/org/eclipse/edc/web/jersey/jsonld/ObjectMapperProvider.java diff --git a/core/common/jersey-providers/src/test/java/org/eclipse/edc/web/jersey/jsonld/JerseyJsonLdInterceptorTest.java b/extensions/common/lib/jersey-providers-lib/src/test/java/org/eclipse/edc/web/jersey/jsonld/JerseyJsonLdInterceptorTest.java similarity index 100% rename from core/common/jersey-providers/src/test/java/org/eclipse/edc/web/jersey/jsonld/JerseyJsonLdInterceptorTest.java rename to extensions/common/lib/jersey-providers-lib/src/test/java/org/eclipse/edc/web/jersey/jsonld/JerseyJsonLdInterceptorTest.java diff --git a/extensions/control-plane/api/control-plane-api-client/build.gradle.kts b/extensions/control-plane/api/control-plane-api-client/build.gradle.kts index a5ca7d5e06a..41e3f956be5 100644 --- a/extensions/control-plane/api/control-plane-api-client/build.gradle.kts +++ b/extensions/control-plane/api/control-plane-api-client/build.gradle.kts @@ -22,6 +22,7 @@ dependencies { implementation(libs.failsafe.core) + testImplementation(project(":core:common:connector-core")) testImplementation(project(":core:common:junit")) testImplementation(project(":core:control-plane:control-plane-core")) testImplementation(project(":core:data-plane:data-plane-core")) diff --git a/extensions/control-plane/api/control-plane-api/build.gradle.kts b/extensions/control-plane/api/control-plane-api/build.gradle.kts index d2158e74e32..4420e9c2032 100644 --- a/extensions/control-plane/api/control-plane-api/build.gradle.kts +++ b/extensions/control-plane/api/control-plane-api/build.gradle.kts @@ -26,6 +26,7 @@ dependencies { implementation(libs.jakarta.rsApi) + testImplementation(project(":core:common:connector-core")) testImplementation(project(":core:control-plane:control-plane-core")) testImplementation(project(":core:data-plane-selector:data-plane-selector-core")) testImplementation(project(":extensions:common:http")) diff --git a/extensions/control-plane/api/management-api/management-api-test-fixtures/build.gradle.kts b/extensions/control-plane/api/management-api/management-api-test-fixtures/build.gradle.kts index 88340bd28e4..56e88d750b5 100644 --- a/extensions/control-plane/api/management-api/management-api-test-fixtures/build.gradle.kts +++ b/extensions/control-plane/api/management-api/management-api-test-fixtures/build.gradle.kts @@ -19,10 +19,11 @@ plugins { dependencies { testFixturesApi(project(":core:common:junit")) + testFixturesApi(project(":spi:common:json-ld-spi")) testFixturesApi(project(":spi:control-plane:control-plane-spi")) testFixturesApi(project(":spi:control-plane:contract-spi")) testFixturesApi(project(":core:common:util")) - testFixturesApi(project(":extensions:common:json-ld")) + testFixturesApi(project(":core:common:lib:json-ld-lib")) testFixturesApi(libs.junit.jupiter.api) diff --git a/extensions/control-plane/edr/edr-store-receiver/build.gradle.kts b/extensions/control-plane/edr/edr-store-receiver/build.gradle.kts index ae7e76797b3..5a19bf83087 100644 --- a/extensions/control-plane/edr/edr-store-receiver/build.gradle.kts +++ b/extensions/control-plane/edr/edr-store-receiver/build.gradle.kts @@ -23,6 +23,8 @@ dependencies { api(project(":spi:control-plane:policy-spi")) api(project(":spi:common:edr-store-spi")) + implementation(project(":spi:common:transaction-spi")) + testImplementation(project(":core:common:junit")) } \ No newline at end of file diff --git a/extensions/control-plane/provision/provision-http/build.gradle.kts b/extensions/control-plane/provision/provision-http/build.gradle.kts index 1ff7f173cd2..da32c9439d1 100644 --- a/extensions/control-plane/provision/provision-http/build.gradle.kts +++ b/extensions/control-plane/provision/provision-http/build.gradle.kts @@ -28,6 +28,7 @@ dependencies { implementation(libs.jakarta.rsApi) + testImplementation(project(":core:common:connector-core")) testImplementation(project(":core:control-plane:control-plane-core")) testImplementation(project(":core:common:junit")) testImplementation(project(":core:data-plane-selector:data-plane-selector-core")) diff --git a/extensions/data-plane-selector/data-plane-selector-api/build.gradle.kts b/extensions/data-plane-selector/data-plane-selector-api/build.gradle.kts index 91391e08c1f..2cf5edb9221 100644 --- a/extensions/data-plane-selector/data-plane-selector-api/build.gradle.kts +++ b/extensions/data-plane-selector/data-plane-selector-api/build.gradle.kts @@ -20,6 +20,7 @@ plugins { dependencies { api(project(":spi:common:core-spi")) api(project(":spi:data-plane-selector:data-plane-selector-spi")) + implementation(project(":spi:common:transaction-spi")) implementation(project(":core:common:util")) implementation(project(":extensions:common:json-ld")) implementation(project(":extensions:common:api:management-api-configuration")) @@ -27,9 +28,11 @@ dependencies { implementation(project(":core:common:validator-core")) implementation(libs.jakarta.rsApi) + testImplementation(project(":core:common:lib:json-ld-lib")) + testImplementation(project(":core:common:connector-core")) + testImplementation(project(":core:common:junit")) testImplementation(project(":core:data-plane-selector:data-plane-selector-core")) testImplementation(project(":extensions:common:http")) - testImplementation(project(":core:common:junit")) // for the TypeTransformerRegistryImpl testImplementation(project(":core:common:transform-core")) // for the JsonObject-To-DataAddress transformer diff --git a/extensions/data-plane-selector/data-plane-selector-client/build.gradle.kts b/extensions/data-plane-selector/data-plane-selector-client/build.gradle.kts index afaa97df120..c3302a59cf2 100644 --- a/extensions/data-plane-selector/data-plane-selector-client/build.gradle.kts +++ b/extensions/data-plane-selector/data-plane-selector-client/build.gradle.kts @@ -28,7 +28,7 @@ dependencies { testImplementation(project(":core:common:junit")) testImplementation(project(":core:common:transform-core")) - testImplementation(project(":core:common:jersey-providers")) + testImplementation(project(":extensions:common:lib:jersey-providers-lib")) testImplementation(testFixtures(project(":core:common:lib:http-lib"))) testImplementation(testFixtures(project(":extensions:common:http:jersey-core"))) diff --git a/extensions/data-plane/data-plane-http/build.gradle.kts b/extensions/data-plane/data-plane-http/build.gradle.kts index 7b122f905c4..67f73505839 100644 --- a/extensions/data-plane/data-plane-http/build.gradle.kts +++ b/extensions/data-plane/data-plane-http/build.gradle.kts @@ -20,6 +20,7 @@ dependencies { api(project(":spi:common:http-spi")) api(project(":spi:data-plane:data-plane-spi")) api(project(":spi:data-plane:data-plane-http-spi")) + implementation(project(":core:common:connector-core")) implementation(project(":core:common:util")) implementation(project(":core:data-plane:data-plane-util")) diff --git a/extensions/data-plane/data-plane-integration-tests/build.gradle.kts b/extensions/data-plane/data-plane-integration-tests/build.gradle.kts index e6dbd44133b..a927cefe954 100644 --- a/extensions/data-plane/data-plane-integration-tests/build.gradle.kts +++ b/extensions/data-plane/data-plane-integration-tests/build.gradle.kts @@ -24,6 +24,7 @@ dependencies { testImplementation(libs.mockserver.netty) testImplementation(libs.mockserver.client) + testImplementation(project(":core:common:connector-core")) testImplementation(project(":core:common:junit")) testImplementation(testFixtures(project(":extensions:data-plane:data-plane-http"))) diff --git a/extensions/data-plane/data-plane-signaling/data-plane-signaling-api-configuration/build.gradle.kts b/extensions/data-plane/data-plane-signaling/data-plane-signaling-api-configuration/build.gradle.kts index dcca29683be..1ba44a9ab2a 100644 --- a/extensions/data-plane/data-plane-signaling/data-plane-signaling-api-configuration/build.gradle.kts +++ b/extensions/data-plane/data-plane-signaling/data-plane-signaling-api-configuration/build.gradle.kts @@ -23,7 +23,7 @@ dependencies { api(project(":spi:data-plane:data-plane-spi")) implementation(project(":core:common:transform-core")) - implementation(project(":core:common:jersey-providers")) + implementation(project(":extensions:common:lib:jersey-providers-lib")) implementation(project(":extensions:data-plane:data-plane-signaling:data-plane-signaling-transform")) implementation(libs.jakarta.rsApi) diff --git a/extensions/data-plane/data-plane-signaling/data-plane-signaling-client/build.gradle.kts b/extensions/data-plane/data-plane-signaling/data-plane-signaling-client/build.gradle.kts index 2c9ac799178..eeec765cf99 100644 --- a/extensions/data-plane/data-plane-signaling/data-plane-signaling-client/build.gradle.kts +++ b/extensions/data-plane/data-plane-signaling/data-plane-signaling-client/build.gradle.kts @@ -30,6 +30,7 @@ dependencies { testImplementation(project(":core:common:junit")) testImplementation(project(":core:common:transform-core")) + testImplementation(project(":core:common:lib:json-ld-lib")) testImplementation(project(":extensions:common:json-ld")) testImplementation(libs.restAssured) testImplementation(libs.mockserver.netty) diff --git a/extensions/data-plane/data-plane-signaling/data-plane-signaling-transform/build.gradle.kts b/extensions/data-plane/data-plane-signaling/data-plane-signaling-transform/build.gradle.kts index 1513629b949..92d45fd5fca 100644 --- a/extensions/data-plane/data-plane-signaling/data-plane-signaling-transform/build.gradle.kts +++ b/extensions/data-plane/data-plane-signaling/data-plane-signaling-transform/build.gradle.kts @@ -23,11 +23,11 @@ dependencies { api(project(":spi:data-plane:data-plane-spi")) implementation(project(":core:common:transform-core")) - implementation(project(":core:common:jersey-providers")) + implementation(project(":extensions:common:lib:jersey-providers-lib")) implementation(libs.jakarta.rsApi) testImplementation(project(":core:common:junit")) - testImplementation(project(":extensions:common:json-ld")) + testImplementation(project(":core:common:lib:json-ld-lib")) } edcBuild { swagger { diff --git a/settings.gradle.kts b/settings.gradle.kts index 9d8569f4bc4..df2ef0b6890 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -43,26 +43,30 @@ dependencyResolutionManagement { // EDC core modules -------------------------------------------------------------------------------- include(":core:common:boot") include(":core:common:connector-core") -include(":core:common:jersey-providers") include(":core:common:junit") include(":core:common:token-core") -include(":core:common:policy-engine") -include(":core:common:policy-evaluator") -include(":core:common:state-machine") include(":core:common:transform-core") include(":core:common:validator-core") include(":core:common:util") include(":core:common:edr-store-core") include(":core:common:lib:boot-lib") +include(":core:common:lib:policy-evaluator-lib") +include(":core:common:lib:policy-engine-lib") include(":core:common:lib:http-lib") include(":core:common:lib:keys-lib") +include(":core:common:lib:query-lib") +include(":core:common:lib:store-lib") +include(":core:common:lib:state-machine-lib") +include(":core:common:lib:crypto-common-lib") +include(":core:common:lib:json-ld-lib") include(":core:control-plane:catalog-core") include(":core:control-plane:contract-core") include(":core:control-plane:control-plane-core") include(":core:control-plane:control-plane-aggregate-services") include(":core:control-plane:transfer-core") +include(":core:control-plane:lib:control-plane-policies-lib") include(":core:data-plane:data-plane-util") include(":core:data-plane:data-plane-core") @@ -96,11 +100,11 @@ include(":extensions:common:api:api-core") include(":extensions:common:api:api-observability") include(":extensions:common:auth:auth-basic") include(":extensions:common:auth:auth-tokenbased") -include(":extensions:common:crypto:crypto-common") include(":extensions:common:crypto:ldp-verifiable-credentials") include(":extensions:common:crypto:jwt-verifiable-credentials") include(":extensions:common:crypto:jws2020") +include(":extensions:common:lib:jersey-providers-lib") include(":extensions:common:configuration:configuration-filesystem") include(":extensions:common:events:events-cloud-http") diff --git a/spi/common/edr-store-spi/build.gradle.kts b/spi/common/edr-store-spi/build.gradle.kts index edd9dfac2ef..9632a74d470 100644 --- a/spi/common/edr-store-spi/build.gradle.kts +++ b/spi/common/edr-store-spi/build.gradle.kts @@ -19,8 +19,7 @@ plugins { dependencies { api(project(":spi:common:core-spi")) - api(project(":spi:common:transaction-spi")) - + // needed by the abstract test spec located in testFixtures testFixturesImplementation(libs.bundles.jupiter) testFixturesImplementation(libs.mockito.core) diff --git a/spi/common/identity-trust-sts-spi/build.gradle.kts b/spi/common/identity-trust-sts-spi/build.gradle.kts index 9bae4b6e51c..f5faa696557 100644 --- a/spi/common/identity-trust-sts-spi/build.gradle.kts +++ b/spi/common/identity-trust-sts-spi/build.gradle.kts @@ -21,6 +21,7 @@ plugins { dependencies { api(project(":spi:common:core-spi")) api(project(":spi:common:jwt-spi")) + api(project(":spi:common:token-spi")) testFixturesImplementation(libs.bundles.jupiter) testFixturesImplementation(libs.assertj) diff --git a/spi/common/jwt-spi/build.gradle.kts b/spi/common/jwt-spi/build.gradle.kts index b07e60f4894..10454fad295 100644 --- a/spi/common/jwt-spi/build.gradle.kts +++ b/spi/common/jwt-spi/build.gradle.kts @@ -18,8 +18,7 @@ plugins { } dependencies { - api(project(":spi:common:core-spi")) - api(project(":spi:common:token-spi")) + implementation(libs.edc.runtime.metamodel) } diff --git a/spi/common/oauth2-spi/build.gradle.kts b/spi/common/oauth2-spi/build.gradle.kts index 78b04bb4213..ba6cc0f2e02 100644 --- a/spi/common/oauth2-spi/build.gradle.kts +++ b/spi/common/oauth2-spi/build.gradle.kts @@ -17,6 +17,7 @@ plugins { } dependencies { + api(project(":spi:common:token-spi")) api(project(":spi:common:jwt-spi")) } diff --git a/spi/common/transaction-datasource-spi/build.gradle.kts b/spi/common/transaction-datasource-spi/build.gradle.kts index daaffae8272..28427ae7b1d 100644 --- a/spi/common/transaction-datasource-spi/build.gradle.kts +++ b/spi/common/transaction-datasource-spi/build.gradle.kts @@ -17,7 +17,7 @@ plugins { } dependencies { - api(project(":spi:common:core-spi")) + api(libs.edc.runtime.metamodel) } diff --git a/system-tests/e2e-dataplane-tests/tests/build.gradle.kts b/system-tests/e2e-dataplane-tests/tests/build.gradle.kts index 0465f05567e..313f66b2034 100644 --- a/system-tests/e2e-dataplane-tests/tests/build.gradle.kts +++ b/system-tests/e2e-dataplane-tests/tests/build.gradle.kts @@ -36,7 +36,7 @@ dependencies { testImplementation(libs.mockserver.netty) testImplementation(libs.mockserver.client) testImplementation(project(":core:common:transform-core")) // for the transformer registry impl - testImplementation(project(":extensions:common:crypto:crypto-common")) + testImplementation(project(":core:common:lib:crypto-common-lib")) testCompileOnly(project(":system-tests:e2e-dataplane-tests:runtimes:data-plane")) } diff --git a/system-tests/e2e-transfer-test/backend-service/build.gradle.kts b/system-tests/e2e-transfer-test/backend-service/build.gradle.kts index 945d7a219b2..54c4027dc24 100644 --- a/system-tests/e2e-transfer-test/backend-service/build.gradle.kts +++ b/system-tests/e2e-transfer-test/backend-service/build.gradle.kts @@ -17,9 +17,9 @@ plugins { } dependencies { + implementation(project(":spi:common:http-spi")) implementation(project(":extensions:common:http")) implementation(project(":core:common:boot")) - implementation(project(":core:common:connector-core")) implementation(libs.nimbus.jwt) implementation(libs.jakarta.rsApi) diff --git a/system-tests/management-api/management-api-test-runner/build.gradle.kts b/system-tests/management-api/management-api-test-runner/build.gradle.kts index 0974ad8af90..383be35d312 100644 --- a/system-tests/management-api/management-api-test-runner/build.gradle.kts +++ b/system-tests/management-api/management-api-test-runner/build.gradle.kts @@ -21,6 +21,7 @@ dependencies { // gives access to the Json LD models, etc. testImplementation(project(":spi:common:json-ld-spi")) testImplementation(project(":spi:control-plane:contract-spi")) + testImplementation(project(":core:common:connector-core")) //useful for generic DTOs etc. testImplementation(project(":extensions:common:api:api-core")) @@ -28,6 +29,7 @@ dependencies { testImplementation(project(":spi:control-plane:transfer-spi")) //we need the JacksonJsonLd util class + testImplementation(project(":core:common:lib:json-ld-lib")) testImplementation(project(":extensions:common:json-ld")) testImplementation(libs.restAssured) diff --git a/system-tests/protocol-test/build.gradle.kts b/system-tests/protocol-test/build.gradle.kts index 641064e60bb..c045a357a83 100644 --- a/system-tests/protocol-test/build.gradle.kts +++ b/system-tests/protocol-test/build.gradle.kts @@ -18,7 +18,10 @@ plugins { dependencies { testImplementation(project(":data-protocols:dsp:dsp-http-spi")) + testImplementation(project(":core:common:connector-core")) testImplementation(project(":core:common:junit")) + testImplementation(project(":spi:common:json-ld-spi")) + testImplementation(project(":core:common:lib:json-ld-lib")) testImplementation(project(":extensions:common:json-ld")) testImplementation(libs.restAssured) } diff --git a/system-tests/telemetry/telemetry-test-runner/build.gradle.kts b/system-tests/telemetry/telemetry-test-runner/build.gradle.kts index b76f6dc358f..664ff403d4b 100644 --- a/system-tests/telemetry/telemetry-test-runner/build.gradle.kts +++ b/system-tests/telemetry/telemetry-test-runner/build.gradle.kts @@ -17,9 +17,11 @@ plugins { } dependencies { - testImplementation(project(":core:common:junit")) testImplementation(project(":spi:common:json-ld-spi")) + testImplementation(project(":spi:common:catalog-spi")) + testImplementation(project(":core:common:junit")) testImplementation(project(":extensions:common:json-ld")) + testImplementation(project(":core:common:connector-core")) testImplementation(libs.restAssured) testImplementation(libs.assertj) diff --git a/system-tests/telemetry/telemetry-test-runtime/build.gradle.kts b/system-tests/telemetry/telemetry-test-runtime/build.gradle.kts index fe59e7044b6..270178d4471 100644 --- a/system-tests/telemetry/telemetry-test-runtime/build.gradle.kts +++ b/system-tests/telemetry/telemetry-test-runtime/build.gradle.kts @@ -18,6 +18,7 @@ plugins { dependencies { implementation(project(":core:common:token-core")) + implementation(project(":core:common:connector-core")) implementation(project(":core:control-plane:control-plane-core")) implementation(project(":data-protocols:dsp")) implementation(project(":extensions:common:api:api-observability"))