From 7c424e546d3cfd4eedc416c1b0a0c8c441e13654 Mon Sep 17 00:00:00 2001 From: Jim Marino Date: Thu, 2 Nov 2023 10:16:56 +0100 Subject: [PATCH] chore: Decouple core modules (#3586) * Remove catalog-spi dependency on contract-spi * Remove control-plane-spi dependency on web-spi * Update dependencies * Update dependencies --- DEPENDENCIES | 4 +- .../policy/ContractExpiryCheckFunction.java | 2 +- ...ractExpiryCheckFunctionEvaluationTest.java | 4 +- .../catalog-core/build.gradle.kts | 1 + .../AbstractContractNegotiationManager.java | 4 +- ...onsumerContractNegotiationManagerImpl.java | 2 +- ...roviderContractNegotiationManagerImpl.java | 4 +- .../contract/policy/PolicyArchiveImpl.java | 2 +- .../ContractValidationServiceImpl.java | 8 ++-- .../ContractNegotiationEventListenerTest.java | 2 +- ...merContractNegotiationManagerImplTest.java | 4 +- .../ContractNegotiationIntegrationTest.java | 4 +- ...derContractNegotiationManagerImplTest.java | 4 +- .../policy/PolicyArchiveImplTest.java | 2 +- .../ContractValidationServiceImplTest.java | 28 ++++++------- .../ContractAgreementServiceImpl.java | 2 +- .../ContractNegotiationServiceImpl.java | 2 +- .../service/asset/AssetServiceImplTest.java | 2 +- .../ContractAgreementServiceImplTest.java | 2 +- .../ContractNegotiationEventDispatchTest.java | 2 +- ...actNegotiationProtocolServiceImplTest.java | 4 +- .../ContractNegotiationServiceImplTest.java | 4 +- .../TransferProcessEventDispatchTest.java | 2 +- ...ransferProcessProtocolServiceImplTest.java | 2 +- .../InMemoryContractNegotiationStore.java | 2 +- .../contractnegotiation/TestFunctions.java | 4 +- .../manager/PolicyMonitorManagerImpl.java | 2 +- .../manager/PolicyMonitorManagerImplTest.java | 2 +- .../dsp/dsp-http-core/build.gradle.kts | 3 +- ...ToContractAgreementMessageTransformer.java | 2 +- ...jectToContractOfferMessageTransformer.java | 14 +++---- ...ctToContractRequestMessageTransformer.java | 2 +- ...ntractAgreementMessageTransformerTest.java | 2 +- ...omContractOfferMessageTransformerTest.java | 34 ++++++++-------- ...ContractRequestMessageTransformerTest.java | 2 +- ...ntractAgreementMessageTransformerTest.java | 2 +- .../build.gradle.kts | 2 + .../configuration/ManagementApiSchema.java | 2 +- ...bjectFromContractAgreementTransformer.java | 14 +++---- .../ManagementApiSchemaTest.java | 12 +++--- ...tFromContractAgreementTransformerTest.java | 10 ++--- .../ContractAgreementApiController.java | 2 +- .../ContractAgreementApiControllerTest.java | 2 +- ...ectFromContractNegotiationTransformer.java | 2 +- ...sonObjectToContractRequestTransformer.java | 2 +- .../ContractNegotiationApiControllerTest.java | 4 +- ...romContractNegotiationTransformerTest.java | 2 +- .../HttpProvisionerExtensionEndToEndTest.java | 4 +- .../store/SqlContractNegotiationStore.java | 2 +- .../postgres/ContractAgreementMapping.java | 2 +- .../ContractValidationRuleTest.java | 2 +- spi/common/catalog-spi/build.gradle.kts | 1 - .../org/eclipse/edc/catalog/spi/Catalog.java | 40 +++++++++---------- .../domain}/agreement/ContractAgreement.java | 2 +- .../types/domain}/offer/ContractOffer.java | 4 +- .../ContractNegotiationEvent.java | 2 +- .../ContractNegotiationFinalized.java | 2 +- .../store/ContractNegotiationStore.java | 2 +- .../agreement/ContractAgreementMessage.java | 1 + .../negotiation/ContractNegotiation.java | 4 +- .../negotiation/ContractOfferMessage.java | 40 +++++++++---------- .../types/negotiation/ContractRequest.java | 2 +- .../negotiation/ContractRequestMessage.java | 2 +- .../validation/ContractValidationService.java | 18 ++++----- .../validation/ValidatedConsumerOffer.java | 2 +- .../contract/spi/event/ContractEventTest.java | 2 +- .../ContractRequestMessageTest.java | 2 +- .../spi/types/offer/ContractOfferTest.java | 1 + .../ContractNegotiationStoreTestBase.java | 2 +- .../negotiation/store/TestFunctions.java | 2 +- .../control-plane-spi/build.gradle.kts | 1 - .../ContractAgreementService.java | 2 +- .../ContractNegotiationService.java | 2 +- .../build.gradle.kts | 1 + .../ContractAgreementApiEndToEndTest.java | 4 +- .../ContractNegotiationApiEndToEndTest.java | 4 +- 76 files changed, 191 insertions(+), 186 deletions(-) rename spi/{control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/types => common/core-spi/src/main/java/org/eclipse/edc/spi/types/domain}/agreement/ContractAgreement.java (98%) rename spi/{control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/types => common/core-spi/src/main/java/org/eclipse/edc/spi/types/domain}/offer/ContractOffer.java (95%) diff --git a/DEPENDENCIES b/DEPENDENCIES index c60e74e7dbf..2f1b4d4f7a9 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -141,8 +141,8 @@ maven/mavencentral/io.rest-assured/xml-path/5.3.2, Apache-2.0, approved, #9267 maven/mavencentral/io.setl/rdf-urdna/1.1, Apache-2.0, approved, clearlydefined maven/mavencentral/io.swagger.core.v3/swagger-annotations-jakarta/2.2.15, Apache-2.0, approved, #5947 maven/mavencentral/io.swagger.core.v3/swagger-annotations-jakarta/2.2.18, Apache-2.0, approved, #5947 -maven/mavencentral/io.swagger.core.v3/swagger-annotations/2.2.15, Apache-2.0, approved, clearlydefined -maven/mavencentral/io.swagger.core.v3/swagger-annotations/2.2.8, Apache-2.0, approved, clearlydefined +maven/mavencentral/io.swagger.core.v3/swagger-annotations/2.2.15, Apache-2.0, approved, #11362 +maven/mavencentral/io.swagger.core.v3/swagger-annotations/2.2.8, Apache-2.0, approved, #11362 maven/mavencentral/io.swagger.core.v3/swagger-core-jakarta/2.2.15, Apache-2.0, approved, #5929 maven/mavencentral/io.swagger.core.v3/swagger-core/2.2.15, Apache-2.0, approved, #9265 maven/mavencentral/io.swagger.core.v3/swagger-core/2.2.8, Apache-2.0, approved, #9265 diff --git a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/policy/ContractExpiryCheckFunction.java b/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/policy/ContractExpiryCheckFunction.java index ef7feee8751..0cfd837c072 100644 --- a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/policy/ContractExpiryCheckFunction.java +++ b/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/policy/ContractExpiryCheckFunction.java @@ -14,12 +14,12 @@ package org.eclipse.edc.connector.core.policy; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.policy.engine.spi.AtomicConstraintFunction; import org.eclipse.edc.policy.engine.spi.PolicyContext; import org.eclipse.edc.policy.model.Operator; import org.eclipse.edc.policy.model.Permission; import org.eclipse.edc.spi.EdcException; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import java.time.Duration; import java.time.Instant; diff --git a/core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/policy/ContractExpiryCheckFunctionEvaluationTest.java b/core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/policy/ContractExpiryCheckFunctionEvaluationTest.java index b56ee7d8343..59438e5ec69 100644 --- a/core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/policy/ContractExpiryCheckFunctionEvaluationTest.java +++ b/core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/policy/ContractExpiryCheckFunctionEvaluationTest.java @@ -14,7 +14,6 @@ package org.eclipse.edc.connector.core.policy; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.junit.annotations.ComponentTest; import org.eclipse.edc.policy.engine.PolicyEngineImpl; import org.eclipse.edc.policy.engine.RuleBindingRegistryImpl; @@ -29,6 +28,7 @@ import org.eclipse.edc.policy.model.Operator; import org.eclipse.edc.policy.model.Permission; import org.eclipse.edc.policy.model.Policy; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.jupiter.params.ParameterizedTest; @@ -44,7 +44,6 @@ import static java.time.Duration.ofDays; import static java.time.Duration.ofSeconds; import static java.time.Instant.now; -import static org.eclipse.edc.connector.contract.spi.validation.ContractValidationService.TRANSFER_SCOPE; 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.policy.model.Operator.EQ; @@ -57,6 +56,7 @@ @ComponentTest class ContractExpiryCheckFunctionEvaluationTest { + private static final String TRANSFER_SCOPE = "transfer.process"; private static final Instant NOW = now(); private final ContractExpiryCheckFunction function = new ContractExpiryCheckFunction(); diff --git a/core/control-plane/catalog-core/build.gradle.kts b/core/control-plane/catalog-core/build.gradle.kts index df7a142a8da..8b1b5291c9a 100644 --- a/core/control-plane/catalog-core/build.gradle.kts +++ b/core/control-plane/catalog-core/build.gradle.kts @@ -18,6 +18,7 @@ plugins { dependencies { api(project(":spi:common:catalog-spi")) + api(project(":spi:control-plane:contract-spi")) api(project(":spi:data-plane-selector:data-plane-selector-spi")) testImplementation(project(":core:common:junit")) 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 7a1c5af3e40..ada6eba9889 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 @@ -18,7 +18,6 @@ import org.eclipse.edc.connector.contract.spi.negotiation.ContractNegotiationPendingGuard; import org.eclipse.edc.connector.contract.spi.negotiation.observe.ContractNegotiationObservable; import org.eclipse.edc.connector.contract.spi.negotiation.store.ContractNegotiationStore; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiationStates; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiationTerminationMessage; @@ -27,6 +26,7 @@ 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.statemachine.Processor; import org.eclipse.edc.statemachine.ProcessorImpl; @@ -49,7 +49,7 @@ public abstract class AbstractContractNegotiationManager extends AbstractStateEn abstract ContractNegotiation.Type type(); protected Processor processNegotiationsInState(ContractNegotiationStates state, Function function) { - var filter = new Criterion[] { hasState(state.code()), isNotPending(), new Criterion("type", "=", type().name()) }; + var filter = new Criterion[]{ hasState(state.code()), isNotPending(), new Criterion("type", "=", type().name()) }; return ProcessorImpl.Builder.newInstance(() -> store.nextNotLeased(batchSize, filter)) .process(telemetry.contextPropagationMiddleware(function)) .guard(pendingGuard, this::setPending) diff --git a/core/control-plane/contract-core/src/main/java/org/eclipse/edc/connector/contract/negotiation/ConsumerContractNegotiationManagerImpl.java b/core/control-plane/contract-core/src/main/java/org/eclipse/edc/connector/contract/negotiation/ConsumerContractNegotiationManagerImpl.java index bda521a5f1d..97568ca723f 100644 --- a/core/control-plane/contract-core/src/main/java/org/eclipse/edc/connector/contract/negotiation/ConsumerContractNegotiationManagerImpl.java +++ b/core/control-plane/contract-core/src/main/java/org/eclipse/edc/connector/contract/negotiation/ConsumerContractNegotiationManagerImpl.java @@ -20,13 +20,13 @@ import io.opentelemetry.instrumentation.annotations.WithSpan; import org.eclipse.edc.connector.contract.spi.negotiation.ConsumerContractNegotiationManager; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreementMessage; import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreementVerificationMessage; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractRequest; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractRequestMessage; import org.eclipse.edc.spi.response.StatusResult; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.statemachine.StateMachineManager; import java.util.UUID; diff --git a/core/control-plane/contract-core/src/main/java/org/eclipse/edc/connector/contract/negotiation/ProviderContractNegotiationManagerImpl.java b/core/control-plane/contract-core/src/main/java/org/eclipse/edc/connector/contract/negotiation/ProviderContractNegotiationManagerImpl.java index f4e9efcf651..92817f4877a 100644 --- a/core/control-plane/contract-core/src/main/java/org/eclipse/edc/connector/contract/negotiation/ProviderContractNegotiationManagerImpl.java +++ b/core/control-plane/contract-core/src/main/java/org/eclipse/edc/connector/contract/negotiation/ProviderContractNegotiationManagerImpl.java @@ -20,11 +20,11 @@ import io.opentelemetry.instrumentation.annotations.WithSpan; import org.eclipse.edc.connector.contract.spi.negotiation.ProviderContractNegotiationManager; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreementMessage; import org.eclipse.edc.connector.contract.spi.types.agreement.ContractNegotiationEventMessage; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractOfferMessage; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.statemachine.StateMachineManager; import static java.lang.String.format; @@ -72,7 +72,7 @@ protected ContractNegotiation.Type type() { @WithSpan private boolean processOffering(ContractNegotiation negotiation) { var currentOffer = negotiation.getLastContractOffer(); - + var contractOfferMessage = ContractOfferMessage.Builder.newInstance() .protocol(negotiation.getProtocol()) .counterPartyAddress(negotiation.getCounterPartyAddress()) diff --git a/core/control-plane/contract-core/src/main/java/org/eclipse/edc/connector/contract/policy/PolicyArchiveImpl.java b/core/control-plane/contract-core/src/main/java/org/eclipse/edc/connector/contract/policy/PolicyArchiveImpl.java index 1a4a21ae9c3..ffbaee44bfb 100644 --- a/core/control-plane/contract-core/src/main/java/org/eclipse/edc/connector/contract/policy/PolicyArchiveImpl.java +++ b/core/control-plane/contract-core/src/main/java/org/eclipse/edc/connector/contract/policy/PolicyArchiveImpl.java @@ -15,9 +15,9 @@ package org.eclipse.edc.connector.contract.policy; import org.eclipse.edc.connector.contract.spi.negotiation.store.ContractNegotiationStore; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.policy.spi.store.PolicyArchive; import org.eclipse.edc.policy.model.Policy; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import java.util.Optional; diff --git a/core/control-plane/contract-core/src/main/java/org/eclipse/edc/connector/contract/validation/ContractValidationServiceImpl.java b/core/control-plane/contract-core/src/main/java/org/eclipse/edc/connector/contract/validation/ContractValidationServiceImpl.java index ff29af642a5..2fef8982600 100644 --- a/core/control-plane/contract-core/src/main/java/org/eclipse/edc/connector/contract/validation/ContractValidationServiceImpl.java +++ b/core/control-plane/contract-core/src/main/java/org/eclipse/edc/connector/contract/validation/ContractValidationServiceImpl.java @@ -19,9 +19,7 @@ import org.eclipse.edc.connector.contract.policy.PolicyEquality; 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.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; -import org.eclipse.edc.connector.contract.spi.types.offer.ContractOffer; import org.eclipse.edc.connector.contract.spi.validation.ContractValidationService; import org.eclipse.edc.connector.contract.spi.validation.ValidatedConsumerOffer; import org.eclipse.edc.connector.policy.spi.store.PolicyDefinitionStore; @@ -34,7 +32,9 @@ import org.eclipse.edc.spi.iam.ClaimToken; import org.eclipse.edc.spi.query.Criterion; import org.eclipse.edc.spi.result.Result; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.spi.types.domain.asset.Asset; +import org.eclipse.edc.spi.types.domain.offer.ContractOffer; import org.jetbrains.annotations.NotNull; import java.time.Instant; @@ -113,7 +113,7 @@ public Result validateAgreement(ClaimToken token, ContractAgr } return success(agreement); } - + @Override public @NotNull Result validateRequest(ClaimToken token, ContractAgreement agreement) { var agent = agentService.createFor(token); @@ -122,7 +122,7 @@ public Result validateAgreement(ClaimToken token, ContractAgr .map(id -> Result.success()) .orElse(Result.failure("Invalid counter-party identity")); } - + @Override @NotNull public Result validateRequest(ClaimToken token, ContractNegotiation negotiation) { diff --git a/core/control-plane/contract-core/src/test/java/org/eclipse/edc/connector/contract/listener/ContractNegotiationEventListenerTest.java b/core/control-plane/contract-core/src/test/java/org/eclipse/edc/connector/contract/listener/ContractNegotiationEventListenerTest.java index e75542de45f..799eb82cc5f 100644 --- a/core/control-plane/contract-core/src/test/java/org/eclipse/edc/connector/contract/listener/ContractNegotiationEventListenerTest.java +++ b/core/control-plane/contract-core/src/test/java/org/eclipse/edc/connector/contract/listener/ContractNegotiationEventListenerTest.java @@ -23,11 +23,11 @@ import org.eclipse.edc.connector.contract.spi.event.contractnegotiation.ContractNegotiationRequested; import org.eclipse.edc.connector.contract.spi.event.contractnegotiation.ContractNegotiationTerminated; import org.eclipse.edc.connector.contract.spi.event.contractnegotiation.ContractNegotiationVerified; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; import org.eclipse.edc.policy.model.Policy; import org.eclipse.edc.spi.event.EventEnvelope; import org.eclipse.edc.spi.event.EventRouter; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.spi.types.domain.callback.CallbackAddress; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/core/control-plane/contract-core/src/test/java/org/eclipse/edc/connector/contract/negotiation/ConsumerContractNegotiationManagerImplTest.java b/core/control-plane/contract-core/src/test/java/org/eclipse/edc/connector/contract/negotiation/ConsumerContractNegotiationManagerImplTest.java index 6e5e316b469..ff82be9ada4 100644 --- a/core/control-plane/contract-core/src/test/java/org/eclipse/edc/connector/contract/negotiation/ConsumerContractNegotiationManagerImplTest.java +++ b/core/control-plane/contract-core/src/test/java/org/eclipse/edc/connector/contract/negotiation/ConsumerContractNegotiationManagerImplTest.java @@ -19,13 +19,11 @@ import org.eclipse.edc.connector.contract.spi.negotiation.ContractNegotiationPendingGuard; import org.eclipse.edc.connector.contract.spi.negotiation.observe.ContractNegotiationListener; import org.eclipse.edc.connector.contract.spi.negotiation.store.ContractNegotiationStore; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreementVerificationMessage; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiationStates; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractRequest; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractRequestMessage; -import org.eclipse.edc.connector.contract.spi.types.offer.ContractOffer; import org.eclipse.edc.connector.policy.spi.store.PolicyDefinitionStore; import org.eclipse.edc.policy.model.Policy; import org.eclipse.edc.spi.EdcException; @@ -35,7 +33,9 @@ import org.eclipse.edc.spi.query.Criterion; import org.eclipse.edc.spi.response.StatusResult; import org.eclipse.edc.spi.retry.ExponentialWaitStrategy; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.spi.types.domain.callback.CallbackAddress; +import org.eclipse.edc.spi.types.domain.offer.ContractOffer; import org.eclipse.edc.statemachine.retry.EntityRetryProcessConfiguration; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; 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 d30e31ff202..009ab8ebd1d 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 @@ -17,7 +17,6 @@ import org.eclipse.edc.connector.contract.observe.ContractNegotiationObservableImpl; import org.eclipse.edc.connector.contract.spi.ContractOfferId; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreementMessage; import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreementVerificationMessage; import org.eclipse.edc.connector.contract.spi.types.agreement.ContractNegotiationEventMessage; @@ -26,7 +25,6 @@ import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiationTerminationMessage; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractRequest; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractRequestMessage; -import org.eclipse.edc.connector.contract.spi.types.offer.ContractOffer; import org.eclipse.edc.connector.contract.spi.validation.ContractValidationService; import org.eclipse.edc.connector.contract.spi.validation.ValidatedConsumerOffer; import org.eclipse.edc.connector.defaults.storage.contractnegotiation.InMemoryContractNegotiationStore; @@ -46,7 +44,9 @@ import org.eclipse.edc.spi.result.Result; import org.eclipse.edc.spi.result.ServiceResult; import org.eclipse.edc.spi.telemetry.Telemetry; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.spi.types.domain.callback.CallbackAddress; +import org.eclipse.edc.spi.types.domain.offer.ContractOffer; import org.eclipse.edc.transaction.spi.NoopTransactionContext; import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.AfterEach; diff --git a/core/control-plane/contract-core/src/test/java/org/eclipse/edc/connector/contract/negotiation/ProviderContractNegotiationManagerImplTest.java b/core/control-plane/contract-core/src/test/java/org/eclipse/edc/connector/contract/negotiation/ProviderContractNegotiationManagerImplTest.java index fed33f029e6..a164bc8870c 100644 --- a/core/control-plane/contract-core/src/test/java/org/eclipse/edc/connector/contract/negotiation/ProviderContractNegotiationManagerImplTest.java +++ b/core/control-plane/contract-core/src/test/java/org/eclipse/edc/connector/contract/negotiation/ProviderContractNegotiationManagerImplTest.java @@ -20,13 +20,11 @@ import org.eclipse.edc.connector.contract.spi.negotiation.ContractNegotiationPendingGuard; import org.eclipse.edc.connector.contract.spi.negotiation.observe.ContractNegotiationListener; import org.eclipse.edc.connector.contract.spi.negotiation.store.ContractNegotiationStore; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreementMessage; import org.eclipse.edc.connector.contract.spi.types.agreement.ContractNegotiationEventMessage; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiationStates; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractOfferMessage; -import org.eclipse.edc.connector.contract.spi.types.offer.ContractOffer; import org.eclipse.edc.connector.policy.spi.PolicyDefinition; import org.eclipse.edc.connector.policy.spi.store.PolicyDefinitionStore; import org.eclipse.edc.policy.model.Policy; @@ -36,6 +34,8 @@ import org.eclipse.edc.spi.query.Criterion; import org.eclipse.edc.spi.response.StatusResult; import org.eclipse.edc.spi.retry.ExponentialWaitStrategy; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; +import org.eclipse.edc.spi.types.domain.offer.ContractOffer; import org.eclipse.edc.statemachine.retry.EntityRetryProcessConfiguration; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/core/control-plane/contract-core/src/test/java/org/eclipse/edc/connector/contract/policy/PolicyArchiveImplTest.java b/core/control-plane/contract-core/src/test/java/org/eclipse/edc/connector/contract/policy/PolicyArchiveImplTest.java index e523393dab1..5a54be21437 100644 --- a/core/control-plane/contract-core/src/test/java/org/eclipse/edc/connector/contract/policy/PolicyArchiveImplTest.java +++ b/core/control-plane/contract-core/src/test/java/org/eclipse/edc/connector/contract/policy/PolicyArchiveImplTest.java @@ -15,8 +15,8 @@ package org.eclipse.edc.connector.contract.policy; import org.eclipse.edc.connector.contract.spi.negotiation.store.ContractNegotiationStore; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.policy.model.Policy; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/core/control-plane/contract-core/src/test/java/org/eclipse/edc/connector/contract/validation/ContractValidationServiceImplTest.java b/core/control-plane/contract-core/src/test/java/org/eclipse/edc/connector/contract/validation/ContractValidationServiceImplTest.java index a48148d73f5..459ea897335 100644 --- a/core/control-plane/contract-core/src/test/java/org/eclipse/edc/connector/contract/validation/ContractValidationServiceImplTest.java +++ b/core/control-plane/contract-core/src/test/java/org/eclipse/edc/connector/contract/validation/ContractValidationServiceImplTest.java @@ -20,10 +20,8 @@ import org.eclipse.edc.connector.contract.policy.PolicyEquality; 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.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; import org.eclipse.edc.connector.contract.spi.types.offer.ContractDefinition; -import org.eclipse.edc.connector.contract.spi.types.offer.ContractOffer; import org.eclipse.edc.connector.policy.spi.PolicyDefinition; import org.eclipse.edc.connector.policy.spi.store.PolicyDefinitionStore; import org.eclipse.edc.policy.engine.spi.PolicyContext; @@ -36,7 +34,9 @@ import org.eclipse.edc.spi.asset.AssetIndex; import org.eclipse.edc.spi.iam.ClaimToken; import org.eclipse.edc.spi.result.Result; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.spi.types.domain.asset.Asset; +import org.eclipse.edc.spi.types.domain.offer.ContractOffer; import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -347,43 +347,43 @@ void validateConfirmed_failsIfPoliciesAreNotEqual() { verify(agentService).createFor(eq(token)); } - + @Test void validateRequest_shouldReturnSuccess_whenRequestingPartyProvider() { var token = ClaimToken.Builder.newInstance().build(); var agreement = createContractAgreement().build(); var participantAgent = new ParticipantAgent(Map.of(), Map.of(PARTICIPANT_IDENTITY, PROVIDER_ID)); - + when(agentService.createFor(token)).thenReturn(participantAgent); - + var result = validationService.validateRequest(token, agreement); - + assertThat(result).isSucceeded(); } - + @Test void validateRequest_shouldReturnSuccess_whenRequestingPartyConsumer() { var token = ClaimToken.Builder.newInstance().build(); var agreement = createContractAgreement().build(); var participantAgent = new ParticipantAgent(Map.of(), Map.of(PARTICIPANT_IDENTITY, CONSUMER_ID)); - + when(agentService.createFor(token)).thenReturn(participantAgent); - + var result = validationService.validateRequest(token, agreement); - + assertThat(result).isSucceeded(); } - + @Test void validateRequest_shouldReturnFailure_whenRequestingPartyUnauthorized() { var token = ClaimToken.Builder.newInstance().build(); var agreement = createContractAgreement().build(); var participantAgent = new ParticipantAgent(Map.of(), Map.of(PARTICIPANT_IDENTITY, "invalid")); - + when(agentService.createFor(token)).thenReturn(participantAgent); - + var result = validationService.validateRequest(token, agreement); - + assertThat(result).isFailed(); } diff --git a/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/contractagreement/ContractAgreementServiceImpl.java b/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/contractagreement/ContractAgreementServiceImpl.java index 13db29ab51c..fc0754076da 100644 --- a/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/contractagreement/ContractAgreementServiceImpl.java +++ b/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/contractagreement/ContractAgreementServiceImpl.java @@ -15,12 +15,12 @@ package org.eclipse.edc.connector.service.contractagreement; import org.eclipse.edc.connector.contract.spi.negotiation.store.ContractNegotiationStore; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; import org.eclipse.edc.connector.service.query.QueryValidator; import org.eclipse.edc.connector.spi.contractagreement.ContractAgreementService; import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.spi.result.ServiceResult; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.transaction.spi.TransactionContext; import java.util.stream.Stream; diff --git a/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/contractnegotiation/ContractNegotiationServiceImpl.java b/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/contractnegotiation/ContractNegotiationServiceImpl.java index 1d5575519a1..99565ab373e 100644 --- a/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/contractnegotiation/ContractNegotiationServiceImpl.java +++ b/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/contractnegotiation/ContractNegotiationServiceImpl.java @@ -16,7 +16,6 @@ import org.eclipse.edc.connector.contract.spi.negotiation.ConsumerContractNegotiationManager; import org.eclipse.edc.connector.contract.spi.negotiation.store.ContractNegotiationStore; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.command.TerminateNegotiationCommand; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiationStates; @@ -26,6 +25,7 @@ import org.eclipse.edc.spi.command.CommandHandlerRegistry; import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.spi.result.ServiceResult; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.transaction.spi.TransactionContext; import java.util.Optional; diff --git a/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/asset/AssetServiceImplTest.java b/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/asset/AssetServiceImplTest.java index 2ed502b8681..72783095094 100644 --- a/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/asset/AssetServiceImplTest.java +++ b/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/asset/AssetServiceImplTest.java @@ -17,7 +17,6 @@ import org.assertj.core.api.Assertions; import org.eclipse.edc.connector.asset.spi.observe.AssetObservable; import org.eclipse.edc.connector.contract.spi.negotiation.store.ContractNegotiationStore; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; import org.eclipse.edc.connector.spi.asset.AssetService; import org.eclipse.edc.policy.model.Policy; @@ -29,6 +28,7 @@ import org.eclipse.edc.spi.result.ServiceResult; import org.eclipse.edc.spi.result.StoreResult; import org.eclipse.edc.spi.types.domain.DataAddress; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.spi.types.domain.asset.Asset; import org.eclipse.edc.transaction.spi.NoopTransactionContext; import org.eclipse.edc.transaction.spi.TransactionContext; diff --git a/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/contractagreement/ContractAgreementServiceImplTest.java b/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/contractagreement/ContractAgreementServiceImplTest.java index 26eace43492..f58bbc02840 100644 --- a/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/contractagreement/ContractAgreementServiceImplTest.java +++ b/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/contractagreement/ContractAgreementServiceImplTest.java @@ -15,10 +15,10 @@ package org.eclipse.edc.connector.service.contractagreement; import org.eclipse.edc.connector.contract.spi.negotiation.store.ContractNegotiationStore; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; import org.eclipse.edc.policy.model.Policy; import org.eclipse.edc.spi.query.QuerySpec; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.spi.types.domain.callback.CallbackAddress; import org.eclipse.edc.transaction.spi.NoopTransactionContext; import org.eclipse.edc.transaction.spi.TransactionContext; diff --git a/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/contractnegotiation/ContractNegotiationEventDispatchTest.java b/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/contractnegotiation/ContractNegotiationEventDispatchTest.java index e37eccb2c19..0d114eb8018 100644 --- a/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/contractnegotiation/ContractNegotiationEventDispatchTest.java +++ b/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/contractnegotiation/ContractNegotiationEventDispatchTest.java @@ -22,7 +22,6 @@ import org.eclipse.edc.connector.contract.spi.offer.store.ContractDefinitionStore; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractRequestMessage; import org.eclipse.edc.connector.contract.spi.types.offer.ContractDefinition; -import org.eclipse.edc.connector.contract.spi.types.offer.ContractOffer; import org.eclipse.edc.connector.dataplane.selector.spi.store.DataPlaneInstanceStore; import org.eclipse.edc.connector.policy.spi.PolicyDefinition; import org.eclipse.edc.connector.policy.spi.store.PolicyDefinitionStore; @@ -40,6 +39,7 @@ import org.eclipse.edc.spi.response.StatusResult; import org.eclipse.edc.spi.types.domain.DataAddress; import org.eclipse.edc.spi.types.domain.asset.Asset; +import org.eclipse.edc.spi.types.domain.offer.ContractOffer; import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/contractnegotiation/ContractNegotiationProtocolServiceImplTest.java b/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/contractnegotiation/ContractNegotiationProtocolServiceImplTest.java index 8db7b08e224..8750d420c74 100644 --- a/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/contractnegotiation/ContractNegotiationProtocolServiceImplTest.java +++ b/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/contractnegotiation/ContractNegotiationProtocolServiceImplTest.java @@ -18,7 +18,6 @@ import org.eclipse.edc.connector.contract.spi.ContractOfferId; import org.eclipse.edc.connector.contract.spi.negotiation.observe.ContractNegotiationListener; import org.eclipse.edc.connector.contract.spi.negotiation.store.ContractNegotiationStore; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreementMessage; import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreementVerificationMessage; import org.eclipse.edc.connector.contract.spi.types.agreement.ContractNegotiationEventMessage; @@ -26,7 +25,6 @@ import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiationTerminationMessage; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractOfferMessage; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractRequestMessage; -import org.eclipse.edc.connector.contract.spi.types.offer.ContractOffer; import org.eclipse.edc.connector.contract.spi.validation.ContractValidationService; import org.eclipse.edc.connector.contract.spi.validation.ValidatedConsumerOffer; import org.eclipse.edc.connector.spi.contractnegotiation.ContractNegotiationProtocolService; @@ -36,7 +34,9 @@ import org.eclipse.edc.spi.result.ServiceFailure; import org.eclipse.edc.spi.result.ServiceResult; import org.eclipse.edc.spi.result.StoreResult; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.spi.types.domain.message.RemoteMessage; +import org.eclipse.edc.spi.types.domain.offer.ContractOffer; import org.eclipse.edc.transaction.spi.NoopTransactionContext; import org.eclipse.edc.transaction.spi.TransactionContext; import org.junit.jupiter.api.BeforeEach; diff --git a/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/contractnegotiation/ContractNegotiationServiceImplTest.java b/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/contractnegotiation/ContractNegotiationServiceImplTest.java index 61c5cd29838..821b6a0dabf 100644 --- a/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/contractnegotiation/ContractNegotiationServiceImplTest.java +++ b/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/contractnegotiation/ContractNegotiationServiceImplTest.java @@ -16,11 +16,9 @@ import org.eclipse.edc.connector.contract.spi.negotiation.ConsumerContractNegotiationManager; import org.eclipse.edc.connector.contract.spi.negotiation.store.ContractNegotiationStore; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.command.TerminateNegotiationCommand; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractRequest; -import org.eclipse.edc.connector.contract.spi.types.offer.ContractOffer; import org.eclipse.edc.policy.model.Policy; import org.eclipse.edc.spi.command.CommandHandlerRegistry; import org.eclipse.edc.spi.command.CommandResult; @@ -28,6 +26,8 @@ import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.spi.response.StatusResult; import org.eclipse.edc.spi.result.ServiceFailure; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; +import org.eclipse.edc.spi.types.domain.offer.ContractOffer; import org.eclipse.edc.transaction.spi.NoopTransactionContext; import org.eclipse.edc.transaction.spi.TransactionContext; import org.junit.jupiter.api.Test; diff --git a/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/transferprocess/TransferProcessEventDispatchTest.java b/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/transferprocess/TransferProcessEventDispatchTest.java index 840fe15afe3..f2b2a8af1a7 100644 --- a/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/transferprocess/TransferProcessEventDispatchTest.java +++ b/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/transferprocess/TransferProcessEventDispatchTest.java @@ -17,7 +17,6 @@ package org.eclipse.edc.connector.service.transferprocess; import org.eclipse.edc.connector.contract.spi.negotiation.store.ContractNegotiationStore; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.core.event.EventExecutorServiceContainer; import org.eclipse.edc.connector.dataplane.selector.spi.store.DataPlaneInstanceStore; import org.eclipse.edc.connector.policy.spi.store.PolicyArchive; @@ -49,6 +48,7 @@ import org.eclipse.edc.spi.protocol.ProtocolWebhook; import org.eclipse.edc.spi.response.StatusResult; import org.eclipse.edc.spi.types.domain.DataAddress; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.validator.spi.DataAddressValidatorRegistry; import org.eclipse.edc.validator.spi.ValidationResult; import org.jetbrains.annotations.NotNull; diff --git a/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/transferprocess/TransferProcessProtocolServiceImplTest.java b/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/transferprocess/TransferProcessProtocolServiceImplTest.java index 8cbe17a9534..dc18fd79c18 100644 --- a/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/transferprocess/TransferProcessProtocolServiceImplTest.java +++ b/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/transferprocess/TransferProcessProtocolServiceImplTest.java @@ -16,7 +16,6 @@ package org.eclipse.edc.connector.service.transferprocess; import org.eclipse.edc.connector.contract.spi.negotiation.store.ContractNegotiationStore; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.validation.ContractValidationService; import org.eclipse.edc.connector.spi.transferprocess.TransferProcessProtocolService; import org.eclipse.edc.connector.transfer.observe.TransferProcessObservableImpl; @@ -37,6 +36,7 @@ import org.eclipse.edc.spi.result.ServiceResult; import org.eclipse.edc.spi.result.StoreResult; import org.eclipse.edc.spi.types.domain.DataAddress; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.spi.types.domain.message.RemoteMessage; import org.eclipse.edc.transaction.spi.NoopTransactionContext; import org.eclipse.edc.transaction.spi.TransactionContext; 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 e3e5ca0a76e..f6bdaee9a7e 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 @@ -16,13 +16,13 @@ package org.eclipse.edc.connector.defaults.storage.contractnegotiation; import org.eclipse.edc.connector.contract.spi.negotiation.store.ContractNegotiationStore; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; 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.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.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/core/control-plane/control-plane-core/src/test/java/org/eclipse/edc/connector/defaults/storage/contractnegotiation/TestFunctions.java b/core/control-plane/control-plane-core/src/test/java/org/eclipse/edc/connector/defaults/storage/contractnegotiation/TestFunctions.java index 15e70d1910a..f06027bf4f0 100644 --- a/core/control-plane/control-plane-core/src/test/java/org/eclipse/edc/connector/defaults/storage/contractnegotiation/TestFunctions.java +++ b/core/control-plane/control-plane-core/src/test/java/org/eclipse/edc/connector/defaults/storage/contractnegotiation/TestFunctions.java @@ -15,10 +15,10 @@ package org.eclipse.edc.connector.defaults.storage.contractnegotiation; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; -import org.eclipse.edc.connector.contract.spi.types.offer.ContractOffer; import org.eclipse.edc.policy.model.Policy; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; +import org.eclipse.edc.spi.types.domain.offer.ContractOffer; import java.time.Instant; import java.util.List; 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 474a67d9704..ba05f3bd71e 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.contract.spi.types.agreement.ContractAgreement; 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; @@ -27,6 +26,7 @@ import org.eclipse.edc.policy.engine.spi.PolicyContextImpl; 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.Processor; import org.eclipse.edc.statemachine.ProcessorImpl; import org.eclipse.edc.statemachine.StateMachineManager; diff --git a/core/policy-monitor/policy-monitor-core/src/test/java/org/eclipse/edc/connector/policy/monitor/manager/PolicyMonitorManagerImplTest.java b/core/policy-monitor/policy-monitor-core/src/test/java/org/eclipse/edc/connector/policy/monitor/manager/PolicyMonitorManagerImplTest.java index 647fc339765..7837e26e6fa 100644 --- a/core/policy-monitor/policy-monitor-core/src/test/java/org/eclipse/edc/connector/policy/monitor/manager/PolicyMonitorManagerImplTest.java +++ b/core/policy-monitor/policy-monitor-core/src/test/java/org/eclipse/edc/connector/policy/monitor/manager/PolicyMonitorManagerImplTest.java @@ -14,7 +14,6 @@ package org.eclipse.edc.connector.policy.monitor.manager; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.policy.monitor.spi.PolicyMonitorEntry; import org.eclipse.edc.connector.policy.monitor.spi.PolicyMonitorManager; import org.eclipse.edc.connector.policy.monitor.spi.PolicyMonitorStore; @@ -30,6 +29,7 @@ import org.eclipse.edc.spi.result.Result; import org.eclipse.edc.spi.result.ServiceResult; import org.eclipse.edc.spi.system.ExecutorInstrumentation; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; diff --git a/data-protocols/dsp/dsp-http-core/build.gradle.kts b/data-protocols/dsp/dsp-http-core/build.gradle.kts index c1db7a7284b..cd0c16720f2 100644 --- a/data-protocols/dsp/dsp-http-core/build.gradle.kts +++ b/data-protocols/dsp/dsp-http-core/build.gradle.kts @@ -19,10 +19,11 @@ plugins { dependencies { api(project(":spi:common:http-spi")) api(project(":spi:common:json-ld-spi")) + api(project(":spi:control-plane:contract-spi")) api(project(":spi:control-plane:transfer-spi")) api(project(":extensions:common:json-ld")) api(project(":data-protocols:dsp:dsp-spi")) api(project(":data-protocols:dsp:dsp-http-spi")) - + testImplementation(project(":core:common:junit")) } diff --git a/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/main/java/org/eclipse/edc/protocol/dsp/negotiation/transform/to/JsonObjectToContractAgreementMessageTransformer.java b/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/main/java/org/eclipse/edc/protocol/dsp/negotiation/transform/to/JsonObjectToContractAgreementMessageTransformer.java index 00d989df084..a7702e73739 100644 --- a/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/main/java/org/eclipse/edc/protocol/dsp/negotiation/transform/to/JsonObjectToContractAgreementMessageTransformer.java +++ b/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/main/java/org/eclipse/edc/protocol/dsp/negotiation/transform/to/JsonObjectToContractAgreementMessageTransformer.java @@ -16,10 +16,10 @@ import jakarta.json.Json; import jakarta.json.JsonObject; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreementMessage; import org.eclipse.edc.jsonld.spi.transformer.AbstractJsonLdTransformer; import org.eclipse.edc.policy.model.Policy; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.transform.spi.TransformerContext; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/main/java/org/eclipse/edc/protocol/dsp/negotiation/transform/to/JsonObjectToContractOfferMessageTransformer.java b/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/main/java/org/eclipse/edc/protocol/dsp/negotiation/transform/to/JsonObjectToContractOfferMessageTransformer.java index 62b8dd859b7..1d247afbeef 100644 --- a/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/main/java/org/eclipse/edc/protocol/dsp/negotiation/transform/to/JsonObjectToContractOfferMessageTransformer.java +++ b/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/main/java/org/eclipse/edc/protocol/dsp/negotiation/transform/to/JsonObjectToContractOfferMessageTransformer.java @@ -16,9 +16,9 @@ import jakarta.json.JsonObject; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractOfferMessage; -import org.eclipse.edc.connector.contract.spi.types.offer.ContractOffer; import org.eclipse.edc.jsonld.spi.transformer.AbstractJsonLdTransformer; import org.eclipse.edc.policy.model.Policy; +import org.eclipse.edc.spi.types.domain.offer.ContractOffer; import org.eclipse.edc.transform.spi.TransformerContext; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -33,11 +33,11 @@ * Creates a {@link ContractOfferMessage} from a {@link JsonObject}. */ public class JsonObjectToContractOfferMessageTransformer extends AbstractJsonLdTransformer { - + public JsonObjectToContractOfferMessageTransformer() { super(JsonObject.class, ContractOfferMessage.class); } - + @Override public @Nullable ContractOfferMessage transform(@NotNull JsonObject jsonObject, @NotNull TransformerContext context) { var builder = ContractOfferMessage.Builder.newInstance(); @@ -45,12 +45,12 @@ public JsonObjectToContractOfferMessageTransformer() { reportMissingProperty(DSPACE_TYPE_CONTRACT_OFFER_MESSAGE, DSPACE_PROPERTY_PROCESS_ID, context); return null; } - + var callback = jsonObject.get(DSPACE_PROPERTY_CALLBACK_ADDRESS); if (callback != null) { builder.callbackAddress(transformString(callback, context)); } - + var contractOffer = returnJsonObject(jsonObject.get(DSPACE_PROPERTY_OFFER), context, DSPACE_PROPERTY_OFFER, false); if (contractOffer != null) { var policy = transformObject(contractOffer, Policy.class, context); @@ -73,10 +73,10 @@ public JsonObjectToContractOfferMessageTransformer() { reportMissingProperty(DSPACE_TYPE_CONTRACT_OFFER_MESSAGE, DSPACE_PROPERTY_OFFER, context); return null; } - + return builder.build(); } - + private void reportMissingProperty(String type, String property, TransformerContext context) { context.problem() .missingProperty() diff --git a/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/main/java/org/eclipse/edc/protocol/dsp/negotiation/transform/to/JsonObjectToContractRequestMessageTransformer.java b/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/main/java/org/eclipse/edc/protocol/dsp/negotiation/transform/to/JsonObjectToContractRequestMessageTransformer.java index 43c4b3d59a5..9369f0ab057 100644 --- a/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/main/java/org/eclipse/edc/protocol/dsp/negotiation/transform/to/JsonObjectToContractRequestMessageTransformer.java +++ b/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/main/java/org/eclipse/edc/protocol/dsp/negotiation/transform/to/JsonObjectToContractRequestMessageTransformer.java @@ -16,9 +16,9 @@ import jakarta.json.JsonObject; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractRequestMessage; -import org.eclipse.edc.connector.contract.spi.types.offer.ContractOffer; import org.eclipse.edc.jsonld.spi.transformer.AbstractJsonLdTransformer; import org.eclipse.edc.policy.model.Policy; +import org.eclipse.edc.spi.types.domain.offer.ContractOffer; import org.eclipse.edc.transform.spi.TransformerContext; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/test/java/org/eclipse/edc/protocol/dsp/negotiation/transform/from/JsonObjectFromContractAgreementMessageTransformerTest.java b/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/test/java/org/eclipse/edc/protocol/dsp/negotiation/transform/from/JsonObjectFromContractAgreementMessageTransformerTest.java index b2e492e4ae8..663fd477813 100644 --- a/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/test/java/org/eclipse/edc/protocol/dsp/negotiation/transform/from/JsonObjectFromContractAgreementMessageTransformerTest.java +++ b/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/test/java/org/eclipse/edc/protocol/dsp/negotiation/transform/from/JsonObjectFromContractAgreementMessageTransformerTest.java @@ -17,13 +17,13 @@ import jakarta.json.Json; import jakarta.json.JsonBuilderFactory; import jakarta.json.JsonObject; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreementMessage; import org.eclipse.edc.policy.model.Action; import org.eclipse.edc.policy.model.Duty; import org.eclipse.edc.policy.model.Permission; import org.eclipse.edc.policy.model.Policy; import org.eclipse.edc.policy.model.Prohibition; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.transform.spi.ProblemBuilder; import org.eclipse.edc.transform.spi.TransformerContext; import org.junit.jupiter.api.BeforeEach; diff --git a/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/test/java/org/eclipse/edc/protocol/dsp/negotiation/transform/from/JsonObjectFromContractOfferMessageTransformerTest.java b/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/test/java/org/eclipse/edc/protocol/dsp/negotiation/transform/from/JsonObjectFromContractOfferMessageTransformerTest.java index 24f0262e7bb..a1ad0999717 100644 --- a/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/test/java/org/eclipse/edc/protocol/dsp/negotiation/transform/from/JsonObjectFromContractOfferMessageTransformerTest.java +++ b/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/test/java/org/eclipse/edc/protocol/dsp/negotiation/transform/from/JsonObjectFromContractOfferMessageTransformerTest.java @@ -18,8 +18,8 @@ import jakarta.json.JsonBuilderFactory; import jakarta.json.JsonObject; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractOfferMessage; -import org.eclipse.edc.connector.contract.spi.types.offer.ContractOffer; import org.eclipse.edc.policy.model.Policy; +import org.eclipse.edc.spi.types.domain.offer.ContractOffer; import org.eclipse.edc.transform.spi.ProblemBuilder; import org.eclipse.edc.transform.spi.TransformerContext; import org.junit.jupiter.api.BeforeEach; @@ -44,32 +44,32 @@ import static org.mockito.Mockito.when; class JsonObjectFromContractOfferMessageTransformerTest { - + private static final String MESSAGE_ID = "messageId"; private static final String CALLBACK_ADDRESS = "https://test.com"; private static final String PROCESS_ID = "processId"; private static final String PROTOCOL = "DSP"; private static final String CONTRACT_OFFER_ID = "contractId"; - + private final JsonBuilderFactory jsonFactory = Json.createBuilderFactory(Map.of()); private final TransformerContext context = mock(TransformerContext.class); - + private JsonObjectFromContractOfferMessageTransformer transformer; - + @BeforeEach void setUp() { transformer = new JsonObjectFromContractOfferMessageTransformer(jsonFactory); } - + @Test void transform_shouldReturnJsonObject_whenValidMessage() { var message = message(); var policyJson = jsonFactory.createObjectBuilder().build(); - + when(context.transform(any(Policy.class), eq(JsonObject.class))).thenReturn(policyJson); - + var result = transformer.transform(message, context); - + assertThat(result).isNotNull(); assertThat(result.getJsonString(ID).getString()).isNotEmpty(); assertThat(result.getJsonString(TYPE).getString()).isEqualTo(DSPACE_TYPE_CONTRACT_OFFER_MESSAGE); @@ -78,23 +78,23 @@ void transform_shouldReturnJsonObject_whenValidMessage() { assertThat(result.getJsonObject(DSPACE_PROPERTY_OFFER)).isNotNull(); assertThat(result.getJsonObject(DSPACE_PROPERTY_OFFER)).isNotNull(); assertThat(result.getJsonObject(DSPACE_PROPERTY_OFFER).getJsonString(ID).getString()).isEqualTo(CONTRACT_OFFER_ID); - + verify(context, never()).reportProblem(anyString()); } - + @Test void transform_shouldReportProblem_whenPolicyTransformationFails() { var message = message(); - + when(context.transform(any(Policy.class), eq(JsonObject.class))).thenReturn(null); when(context.problem()).thenReturn(new ProblemBuilder(context)); - + var result = transformer.transform(message, context); - + assertThat(result).isNull(); verify(context, times(1)).reportProblem(any()); } - + private ContractOfferMessage message() { return ContractOfferMessage.Builder.newInstance() .id(MESSAGE_ID) @@ -104,7 +104,7 @@ private ContractOfferMessage message() { .contractOffer(contractOffer()) .build(); } - + private ContractOffer contractOffer() { return ContractOffer.Builder.newInstance() .id(CONTRACT_OFFER_ID) @@ -112,5 +112,5 @@ private ContractOffer contractOffer() { .policy(Policy.Builder.newInstance().build()) .build(); } - + } diff --git a/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/test/java/org/eclipse/edc/protocol/dsp/negotiation/transform/from/JsonObjectFromContractRequestMessageTransformerTest.java b/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/test/java/org/eclipse/edc/protocol/dsp/negotiation/transform/from/JsonObjectFromContractRequestMessageTransformerTest.java index dd80af6745c..33c74884d93 100644 --- a/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/test/java/org/eclipse/edc/protocol/dsp/negotiation/transform/from/JsonObjectFromContractRequestMessageTransformerTest.java +++ b/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/test/java/org/eclipse/edc/protocol/dsp/negotiation/transform/from/JsonObjectFromContractRequestMessageTransformerTest.java @@ -18,8 +18,8 @@ import jakarta.json.JsonBuilderFactory; import jakarta.json.JsonObject; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractRequestMessage; -import org.eclipse.edc.connector.contract.spi.types.offer.ContractOffer; import org.eclipse.edc.policy.model.Policy; +import org.eclipse.edc.spi.types.domain.offer.ContractOffer; import org.eclipse.edc.transform.spi.ProblemBuilder; import org.eclipse.edc.transform.spi.TransformerContext; import org.junit.jupiter.api.BeforeEach; diff --git a/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/test/java/org/eclipse/edc/protocol/dsp/negotiation/transform/to/JsonObjectToContractAgreementMessageTransformerTest.java b/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/test/java/org/eclipse/edc/protocol/dsp/negotiation/transform/to/JsonObjectToContractAgreementMessageTransformerTest.java index 454919ec503..de651d9eba9 100644 --- a/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/test/java/org/eclipse/edc/protocol/dsp/negotiation/transform/to/JsonObjectToContractAgreementMessageTransformerTest.java +++ b/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/test/java/org/eclipse/edc/protocol/dsp/negotiation/transform/to/JsonObjectToContractAgreementMessageTransformerTest.java @@ -17,7 +17,6 @@ import jakarta.json.Json; import jakarta.json.JsonBuilderFactory; import jakarta.json.JsonObject; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreementMessage; import org.eclipse.edc.jsonld.spi.JsonLdKeywords; import org.eclipse.edc.policy.model.Action; @@ -25,6 +24,7 @@ import org.eclipse.edc.policy.model.Permission; import org.eclipse.edc.policy.model.Policy; import org.eclipse.edc.policy.model.Prohibition; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.transform.spi.ProblemBuilder; import org.eclipse.edc.transform.spi.TransformerContext; import org.junit.jupiter.api.BeforeEach; diff --git a/extensions/common/api/management-api-configuration/build.gradle.kts b/extensions/common/api/management-api-configuration/build.gradle.kts index 884a0a826b7..410e0cb0e6c 100644 --- a/extensions/common/api/management-api-configuration/build.gradle.kts +++ b/extensions/common/api/management-api-configuration/build.gradle.kts @@ -20,6 +20,8 @@ plugins { dependencies { api(project(":spi:common:json-ld-spi")) 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:api:api-core")) diff --git a/extensions/common/api/management-api-configuration/src/main/java/org/eclipse/edc/connector/api/management/configuration/ManagementApiSchema.java b/extensions/common/api/management-api-configuration/src/main/java/org/eclipse/edc/connector/api/management/configuration/ManagementApiSchema.java index f72ee111154..d3d01daf955 100644 --- a/extensions/common/api/management-api-configuration/src/main/java/org/eclipse/edc/connector/api/management/configuration/ManagementApiSchema.java +++ b/extensions/common/api/management-api-configuration/src/main/java/org/eclipse/edc/connector/api/management/configuration/ManagementApiSchema.java @@ -15,9 +15,9 @@ package org.eclipse.edc.connector.api.management.configuration; import io.swagger.v3.oas.annotations.media.Schema; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; import org.eclipse.edc.spi.types.domain.DataAddress; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.spi.types.domain.callback.CallbackAddress; import java.util.List; diff --git a/extensions/common/api/management-api-configuration/src/main/java/org/eclipse/edc/connector/api/management/configuration/transform/JsonObjectFromContractAgreementTransformer.java b/extensions/common/api/management-api-configuration/src/main/java/org/eclipse/edc/connector/api/management/configuration/transform/JsonObjectFromContractAgreementTransformer.java index e9fa70a7bad..21606d38341 100644 --- a/extensions/common/api/management-api-configuration/src/main/java/org/eclipse/edc/connector/api/management/configuration/transform/JsonObjectFromContractAgreementTransformer.java +++ b/extensions/common/api/management-api-configuration/src/main/java/org/eclipse/edc/connector/api/management/configuration/transform/JsonObjectFromContractAgreementTransformer.java @@ -16,20 +16,20 @@ import jakarta.json.JsonBuilderFactory; import jakarta.json.JsonObject; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.jsonld.spi.transformer.AbstractJsonLdTransformer; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.transform.spi.TransformerContext; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import static org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement.CONTRACT_AGREEMENT_ASSET_ID; -import static org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement.CONTRACT_AGREEMENT_CONSUMER_ID; -import static org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement.CONTRACT_AGREEMENT_POLICY; -import static org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement.CONTRACT_AGREEMENT_PROVIDER_ID; -import static org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement.CONTRACT_AGREEMENT_SIGNING_DATE; -import static org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement.CONTRACT_AGREEMENT_TYPE; import static org.eclipse.edc.jsonld.spi.JsonLdKeywords.ID; import static org.eclipse.edc.jsonld.spi.JsonLdKeywords.TYPE; +import static org.eclipse.edc.spi.types.domain.agreement.ContractAgreement.CONTRACT_AGREEMENT_ASSET_ID; +import static org.eclipse.edc.spi.types.domain.agreement.ContractAgreement.CONTRACT_AGREEMENT_CONSUMER_ID; +import static org.eclipse.edc.spi.types.domain.agreement.ContractAgreement.CONTRACT_AGREEMENT_POLICY; +import static org.eclipse.edc.spi.types.domain.agreement.ContractAgreement.CONTRACT_AGREEMENT_PROVIDER_ID; +import static org.eclipse.edc.spi.types.domain.agreement.ContractAgreement.CONTRACT_AGREEMENT_SIGNING_DATE; +import static org.eclipse.edc.spi.types.domain.agreement.ContractAgreement.CONTRACT_AGREEMENT_TYPE; public class JsonObjectFromContractAgreementTransformer extends AbstractJsonLdTransformer { private final JsonBuilderFactory jsonFactory; diff --git a/extensions/common/api/management-api-configuration/src/test/java/org/eclipse/edc/connector/api/management/configuration/ManagementApiSchemaTest.java b/extensions/common/api/management-api-configuration/src/test/java/org/eclipse/edc/connector/api/management/configuration/ManagementApiSchemaTest.java index 26d1ceca13d..0e404b0fe32 100644 --- a/extensions/common/api/management-api-configuration/src/test/java/org/eclipse/edc/connector/api/management/configuration/ManagementApiSchemaTest.java +++ b/extensions/common/api/management-api-configuration/src/test/java/org/eclipse/edc/connector/api/management/configuration/ManagementApiSchemaTest.java @@ -35,12 +35,6 @@ import static org.eclipse.edc.connector.api.management.configuration.ManagementApiSchema.ContractNegotiationSchema.CONTRACT_NEGOTIATION_EXAMPLE; import static org.eclipse.edc.connector.api.management.configuration.ManagementApiSchema.DataAddressSchema.DATA_ADDRESS_EXAMPLE; import static org.eclipse.edc.connector.api.management.configuration.ManagementApiSchema.PolicySchema.POLICY_EXAMPLE; -import static org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement.CONTRACT_AGREEMENT_ASSET_ID; -import static org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement.CONTRACT_AGREEMENT_CONSUMER_ID; -import static org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement.CONTRACT_AGREEMENT_POLICY; -import static org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement.CONTRACT_AGREEMENT_PROVIDER_ID; -import static org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement.CONTRACT_AGREEMENT_SIGNING_DATE; -import static org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement.CONTRACT_AGREEMENT_TYPE; import static org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation.CONTRACT_NEGOTIATION_AGREEMENT_ID; import static org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation.CONTRACT_NEGOTIATION_CALLBACK_ADDR; import static org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation.CONTRACT_NEGOTIATION_COUNTERPARTY_ADDR; @@ -57,6 +51,12 @@ import static org.eclipse.edc.jsonld.spi.PropertyAndTypeNames.ODRL_PERMISSION_ATTRIBUTE; import static org.eclipse.edc.junit.assertions.AbstractResultAssert.assertThat; import static org.eclipse.edc.junit.extensions.TestServiceExtensionContext.testServiceExtensionContext; +import static org.eclipse.edc.spi.types.domain.agreement.ContractAgreement.CONTRACT_AGREEMENT_ASSET_ID; +import static org.eclipse.edc.spi.types.domain.agreement.ContractAgreement.CONTRACT_AGREEMENT_CONSUMER_ID; +import static org.eclipse.edc.spi.types.domain.agreement.ContractAgreement.CONTRACT_AGREEMENT_POLICY; +import static org.eclipse.edc.spi.types.domain.agreement.ContractAgreement.CONTRACT_AGREEMENT_PROVIDER_ID; +import static org.eclipse.edc.spi.types.domain.agreement.ContractAgreement.CONTRACT_AGREEMENT_SIGNING_DATE; +import static org.eclipse.edc.spi.types.domain.agreement.ContractAgreement.CONTRACT_AGREEMENT_TYPE; class ManagementApiSchemaTest { diff --git a/extensions/common/api/management-api-configuration/src/test/java/org/eclipse/edc/connector/api/management/configuration/transform/JsonObjectFromContractAgreementTransformerTest.java b/extensions/common/api/management-api-configuration/src/test/java/org/eclipse/edc/connector/api/management/configuration/transform/JsonObjectFromContractAgreementTransformerTest.java index 5f6eb845d0a..30f96094e0e 100644 --- a/extensions/common/api/management-api-configuration/src/test/java/org/eclipse/edc/connector/api/management/configuration/transform/JsonObjectFromContractAgreementTransformerTest.java +++ b/extensions/common/api/management-api-configuration/src/test/java/org/eclipse/edc/connector/api/management/configuration/transform/JsonObjectFromContractAgreementTransformerTest.java @@ -17,8 +17,8 @@ import jakarta.json.Json; import jakarta.json.JsonObject; import jakarta.json.JsonString; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.policy.model.Policy; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.transform.spi.TransformerContext; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -26,10 +26,10 @@ import java.util.Map; import static org.assertj.core.api.Assertions.assertThat; -import static org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement.CONTRACT_AGREEMENT_ASSET_ID; -import static org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement.CONTRACT_AGREEMENT_CONSUMER_ID; -import static org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement.CONTRACT_AGREEMENT_POLICY; -import static org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement.CONTRACT_AGREEMENT_PROVIDER_ID; +import static org.eclipse.edc.spi.types.domain.agreement.ContractAgreement.CONTRACT_AGREEMENT_ASSET_ID; +import static org.eclipse.edc.spi.types.domain.agreement.ContractAgreement.CONTRACT_AGREEMENT_CONSUMER_ID; +import static org.eclipse.edc.spi.types.domain.agreement.ContractAgreement.CONTRACT_AGREEMENT_POLICY; +import static org.eclipse.edc.spi.types.domain.agreement.ContractAgreement.CONTRACT_AGREEMENT_PROVIDER_ID; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; diff --git a/extensions/control-plane/api/management-api/contract-agreement-api/src/main/java/org/eclipse/edc/connector/api/management/contractagreement/ContractAgreementApiController.java b/extensions/control-plane/api/management-api/contract-agreement-api/src/main/java/org/eclipse/edc/connector/api/management/contractagreement/ContractAgreementApiController.java index eb35df67b9e..1d39faa06a6 100644 --- a/extensions/control-plane/api/management-api/contract-agreement-api/src/main/java/org/eclipse/edc/connector/api/management/contractagreement/ContractAgreementApiController.java +++ b/extensions/control-plane/api/management-api/contract-agreement-api/src/main/java/org/eclipse/edc/connector/api/management/contractagreement/ContractAgreementApiController.java @@ -22,13 +22,13 @@ import jakarta.ws.rs.PathParam; import jakarta.ws.rs.Produces; import jakarta.ws.rs.core.MediaType; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.offer.ContractDefinition; import org.eclipse.edc.connector.spi.contractagreement.ContractAgreementService; import org.eclipse.edc.spi.EdcException; import org.eclipse.edc.spi.monitor.Monitor; import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.spi.result.Result; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.transform.spi.TypeTransformerRegistry; import org.eclipse.edc.validator.spi.JsonObjectValidatorRegistry; import org.eclipse.edc.web.spi.exception.InvalidRequestException; diff --git a/extensions/control-plane/api/management-api/contract-agreement-api/src/test/java/org/eclipse/edc/connector/api/management/contractagreement/ContractAgreementApiControllerTest.java b/extensions/control-plane/api/management-api/contract-agreement-api/src/test/java/org/eclipse/edc/connector/api/management/contractagreement/ContractAgreementApiControllerTest.java index 12837c02f74..d0c1486d752 100644 --- a/extensions/control-plane/api/management-api/contract-agreement-api/src/test/java/org/eclipse/edc/connector/api/management/contractagreement/ContractAgreementApiControllerTest.java +++ b/extensions/control-plane/api/management-api/contract-agreement-api/src/test/java/org/eclipse/edc/connector/api/management/contractagreement/ContractAgreementApiControllerTest.java @@ -17,7 +17,6 @@ import io.restassured.specification.RequestSpecification; import jakarta.json.Json; import jakarta.json.JsonObject; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; import org.eclipse.edc.connector.spi.contractagreement.ContractAgreementService; import org.eclipse.edc.junit.annotations.ApiTest; @@ -25,6 +24,7 @@ import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.spi.result.Result; import org.eclipse.edc.spi.result.ServiceResult; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.spi.types.domain.callback.CallbackAddress; import org.eclipse.edc.transform.spi.TypeTransformerRegistry; import org.eclipse.edc.validator.spi.JsonObjectValidatorRegistry; diff --git a/extensions/control-plane/api/management-api/contract-negotiation-api/src/main/java/org/eclipse/edc/connector/api/management/contractnegotiation/transform/JsonObjectFromContractNegotiationTransformer.java b/extensions/control-plane/api/management-api/contract-negotiation-api/src/main/java/org/eclipse/edc/connector/api/management/contractnegotiation/transform/JsonObjectFromContractNegotiationTransformer.java index b8b3021b0d7..170d6670923 100644 --- a/extensions/control-plane/api/management-api/contract-negotiation-api/src/main/java/org/eclipse/edc/connector/api/management/contractnegotiation/transform/JsonObjectFromContractNegotiationTransformer.java +++ b/extensions/control-plane/api/management-api/contract-negotiation-api/src/main/java/org/eclipse/edc/connector/api/management/contractnegotiation/transform/JsonObjectFromContractNegotiationTransformer.java @@ -16,10 +16,10 @@ import jakarta.json.JsonBuilderFactory; import jakarta.json.JsonObject; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiationStates; import org.eclipse.edc.jsonld.spi.transformer.AbstractJsonLdTransformer; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.transform.spi.TransformerContext; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/extensions/control-plane/api/management-api/contract-negotiation-api/src/main/java/org/eclipse/edc/connector/api/management/contractnegotiation/transform/JsonObjectToContractRequestTransformer.java b/extensions/control-plane/api/management-api/contract-negotiation-api/src/main/java/org/eclipse/edc/connector/api/management/contractnegotiation/transform/JsonObjectToContractRequestTransformer.java index 2c563b24c37..c0924e17f21 100644 --- a/extensions/control-plane/api/management-api/contract-negotiation-api/src/main/java/org/eclipse/edc/connector/api/management/contractnegotiation/transform/JsonObjectToContractRequestTransformer.java +++ b/extensions/control-plane/api/management-api/contract-negotiation-api/src/main/java/org/eclipse/edc/connector/api/management/contractnegotiation/transform/JsonObjectToContractRequestTransformer.java @@ -17,9 +17,9 @@ import jakarta.json.JsonObject; import org.eclipse.edc.connector.api.management.contractnegotiation.model.ContractOfferDescription; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractRequest; -import org.eclipse.edc.connector.contract.spi.types.offer.ContractOffer; import org.eclipse.edc.jsonld.spi.transformer.AbstractJsonLdTransformer; import org.eclipse.edc.spi.types.domain.callback.CallbackAddress; +import org.eclipse.edc.spi.types.domain.offer.ContractOffer; import org.eclipse.edc.transform.spi.TransformerContext; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/extensions/control-plane/api/management-api/contract-negotiation-api/src/test/java/org/eclipse/edc/connector/api/management/contractnegotiation/ContractNegotiationApiControllerTest.java b/extensions/control-plane/api/management-api/contract-negotiation-api/src/test/java/org/eclipse/edc/connector/api/management/contractnegotiation/ContractNegotiationApiControllerTest.java index 7e27736cfac..02fe385fafb 100644 --- a/extensions/control-plane/api/management-api/contract-negotiation-api/src/test/java/org/eclipse/edc/connector/api/management/contractnegotiation/ContractNegotiationApiControllerTest.java +++ b/extensions/control-plane/api/management-api/contract-negotiation-api/src/test/java/org/eclipse/edc/connector/api/management/contractnegotiation/ContractNegotiationApiControllerTest.java @@ -21,18 +21,18 @@ import jakarta.json.JsonObject; import org.eclipse.edc.api.model.IdResponse; import org.eclipse.edc.connector.api.management.contractnegotiation.model.NegotiationState; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.command.TerminateNegotiationCommand; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractRequest; -import org.eclipse.edc.connector.contract.spi.types.offer.ContractOffer; import org.eclipse.edc.connector.spi.contractnegotiation.ContractNegotiationService; import org.eclipse.edc.junit.annotations.ApiTest; import org.eclipse.edc.policy.model.Policy; import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.spi.result.Result; import org.eclipse.edc.spi.result.ServiceResult; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.spi.types.domain.callback.CallbackAddress; +import org.eclipse.edc.spi.types.domain.offer.ContractOffer; import org.eclipse.edc.transform.spi.TypeTransformerRegistry; import org.eclipse.edc.validator.spi.JsonObjectValidatorRegistry; import org.eclipse.edc.validator.spi.ValidationResult; diff --git a/extensions/control-plane/api/management-api/contract-negotiation-api/src/test/java/org/eclipse/edc/connector/api/management/contractnegotiation/transform/JsonObjectFromContractNegotiationTransformerTest.java b/extensions/control-plane/api/management-api/contract-negotiation-api/src/test/java/org/eclipse/edc/connector/api/management/contractnegotiation/transform/JsonObjectFromContractNegotiationTransformerTest.java index ddccfa06890..c3583d74da1 100644 --- a/extensions/control-plane/api/management-api/contract-negotiation-api/src/test/java/org/eclipse/edc/connector/api/management/contractnegotiation/transform/JsonObjectFromContractNegotiationTransformerTest.java +++ b/extensions/control-plane/api/management-api/contract-negotiation-api/src/test/java/org/eclipse/edc/connector/api/management/contractnegotiation/transform/JsonObjectFromContractNegotiationTransformerTest.java @@ -16,9 +16,9 @@ import jakarta.json.Json; import jakarta.json.JsonObject; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; import org.eclipse.edc.policy.model.Policy; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.spi.types.domain.callback.CallbackAddress; import org.eclipse.edc.transform.spi.TransformerContext; import org.junit.jupiter.api.Test; diff --git a/extensions/control-plane/provision/provision-http/src/test/java/org/eclipse/edc/connector/provision/http/impl/HttpProvisionerExtensionEndToEndTest.java b/extensions/control-plane/provision/provision-http/src/test/java/org/eclipse/edc/connector/provision/http/impl/HttpProvisionerExtensionEndToEndTest.java index 2c1ebeddbbf..7f62bdf773a 100644 --- a/extensions/control-plane/provision/provision-http/src/test/java/org/eclipse/edc/connector/provision/http/impl/HttpProvisionerExtensionEndToEndTest.java +++ b/extensions/control-plane/provision/provision-http/src/test/java/org/eclipse/edc/connector/provision/http/impl/HttpProvisionerExtensionEndToEndTest.java @@ -16,9 +16,7 @@ import okhttp3.Interceptor; import org.eclipse.edc.connector.contract.spi.negotiation.store.ContractNegotiationStore; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; -import org.eclipse.edc.connector.contract.spi.types.offer.ContractOffer; import org.eclipse.edc.connector.contract.spi.validation.ContractValidationService; import org.eclipse.edc.connector.policy.spi.PolicyDefinition; import org.eclipse.edc.connector.policy.spi.store.PolicyDefinitionStore; @@ -41,7 +39,9 @@ import org.eclipse.edc.spi.system.ServiceExtension; import org.eclipse.edc.spi.system.ServiceExtensionContext; import org.eclipse.edc.spi.types.domain.DataAddress; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.spi.types.domain.asset.Asset; +import org.eclipse.edc.spi.types.domain.offer.ContractOffer; import org.eclipse.edc.validator.spi.DataAddressValidatorRegistry; import org.eclipse.edc.validator.spi.ValidationResult; import org.jetbrains.annotations.NotNull; diff --git a/extensions/control-plane/store/sql/contract-negotiation-store-sql/src/main/java/org/eclipse/edc/connector/store/sql/contractnegotiation/store/SqlContractNegotiationStore.java b/extensions/control-plane/store/sql/contract-negotiation-store-sql/src/main/java/org/eclipse/edc/connector/store/sql/contractnegotiation/store/SqlContractNegotiationStore.java index b5f02a72585..4a6b0d009e0 100644 --- a/extensions/control-plane/store/sql/contract-negotiation-store-sql/src/main/java/org/eclipse/edc/connector/store/sql/contractnegotiation/store/SqlContractNegotiationStore.java +++ b/extensions/control-plane/store/sql/contract-negotiation-store-sql/src/main/java/org/eclipse/edc/connector/store/sql/contractnegotiation/store/SqlContractNegotiationStore.java @@ -18,13 +18,13 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import org.eclipse.edc.connector.contract.spi.negotiation.store.ContractNegotiationStore; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; import org.eclipse.edc.connector.store.sql.contractnegotiation.store.schema.ContractNegotiationStatements; import org.eclipse.edc.spi.persistence.EdcPersistenceException; import org.eclipse.edc.spi.query.Criterion; 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.sql.QueryExecutor; import org.eclipse.edc.sql.ResultSetMapper; import org.eclipse.edc.sql.lease.SqlLeaseContextBuilder; diff --git a/extensions/control-plane/store/sql/contract-negotiation-store-sql/src/main/java/org/eclipse/edc/connector/store/sql/contractnegotiation/store/schema/postgres/ContractAgreementMapping.java b/extensions/control-plane/store/sql/contract-negotiation-store-sql/src/main/java/org/eclipse/edc/connector/store/sql/contractnegotiation/store/schema/postgres/ContractAgreementMapping.java index 1e33e3d6881..bef483d95c9 100644 --- a/extensions/control-plane/store/sql/contract-negotiation-store-sql/src/main/java/org/eclipse/edc/connector/store/sql/contractnegotiation/store/schema/postgres/ContractAgreementMapping.java +++ b/extensions/control-plane/store/sql/contract-negotiation-store-sql/src/main/java/org/eclipse/edc/connector/store/sql/contractnegotiation/store/schema/postgres/ContractAgreementMapping.java @@ -14,8 +14,8 @@ package org.eclipse.edc.connector.store.sql.contractnegotiation.store.schema.postgres; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.store.sql.contractnegotiation.store.schema.ContractNegotiationStatements; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.sql.translation.JsonFieldMapping; import org.eclipse.edc.sql.translation.TranslationMapping; diff --git a/extensions/control-plane/transfer/transfer-data-plane/src/test/java/org/eclipse/edc/connector/transfer/dataplane/validation/ContractValidationRuleTest.java b/extensions/control-plane/transfer/transfer-data-plane/src/test/java/org/eclipse/edc/connector/transfer/dataplane/validation/ContractValidationRuleTest.java index a698b134054..a0a74c48b50 100644 --- a/extensions/control-plane/transfer/transfer-data-plane/src/test/java/org/eclipse/edc/connector/transfer/dataplane/validation/ContractValidationRuleTest.java +++ b/extensions/control-plane/transfer/transfer-data-plane/src/test/java/org/eclipse/edc/connector/transfer/dataplane/validation/ContractValidationRuleTest.java @@ -15,9 +15,9 @@ package org.eclipse.edc.connector.transfer.dataplane.validation; import org.eclipse.edc.connector.contract.spi.negotiation.store.ContractNegotiationStore; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.policy.model.Policy; import org.eclipse.edc.spi.iam.ClaimToken; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/spi/common/catalog-spi/build.gradle.kts b/spi/common/catalog-spi/build.gradle.kts index 755d210d439..53ddc892a50 100644 --- a/spi/common/catalog-spi/build.gradle.kts +++ b/spi/common/catalog-spi/build.gradle.kts @@ -19,7 +19,6 @@ plugins { dependencies { api(project(":spi:common:core-spi")) - api(project(":spi:control-plane:contract-spi")) } diff --git a/spi/common/catalog-spi/src/main/java/org/eclipse/edc/catalog/spi/Catalog.java b/spi/common/catalog-spi/src/main/java/org/eclipse/edc/catalog/spi/Catalog.java index 3a855d0f30c..5f32671d8a5 100644 --- a/spi/common/catalog-spi/src/main/java/org/eclipse/edc/catalog/spi/Catalog.java +++ b/spi/common/catalog-spi/src/main/java/org/eclipse/edc/catalog/spi/Catalog.java @@ -17,7 +17,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; -import org.eclipse.edc.connector.contract.spi.types.offer.ContractOffer; +import org.eclipse.edc.spi.types.domain.offer.ContractOffer; import java.util.ArrayList; import java.util.HashMap; @@ -36,54 +36,54 @@ public class Catalog { private List datasets; private List dataServices; private Map properties; - + public String getId() { return id; } - + public List getContractOffers() { return contractOffers; } - + public List getDatasets() { return datasets; } - + public List getDataServices() { return dataServices; } - + public Map getProperties() { return properties; } - + @JsonPOJOBuilder(withPrefix = "") public static class Builder { private Catalog catalog; - + private Builder() { catalog = new Catalog(); } - + public static Builder newInstance() { return new Builder(); } - + public Builder id(String id) { catalog.id = id; return this; } - + public Builder contractOffers(List contractOffers) { catalog.contractOffers = contractOffers; return this; } - + public Builder datasets(List datasets) { catalog.datasets = datasets; return this; } - + public Builder dataset(Dataset dataset) { if (catalog.datasets == null) { catalog.datasets = new ArrayList<>(); @@ -91,12 +91,12 @@ public Builder dataset(Dataset dataset) { catalog.datasets.add(dataset); return this; } - + public Builder dataServices(List dataServices) { catalog.dataServices = dataServices; return this; } - + public Builder dataService(DataService dataService) { if (catalog.dataServices == null) { catalog.dataServices = new ArrayList<>(); @@ -104,12 +104,12 @@ public Builder dataService(DataService dataService) { catalog.dataServices.add(dataService); return this; } - + public Builder properties(Map properties) { catalog.properties = properties; return this; } - + public Builder property(String key, Object value) { if (catalog.properties == null) { catalog.properties = new HashMap<>(); @@ -117,14 +117,14 @@ public Builder property(String key, Object value) { catalog.properties.put(key, value); return this; } - + public Catalog build() { if (catalog.id == null) { catalog.id = randomUUID().toString(); } - + return catalog; } - + } } diff --git a/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/types/agreement/ContractAgreement.java b/spi/common/core-spi/src/main/java/org/eclipse/edc/spi/types/domain/agreement/ContractAgreement.java similarity index 98% rename from spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/types/agreement/ContractAgreement.java rename to spi/common/core-spi/src/main/java/org/eclipse/edc/spi/types/domain/agreement/ContractAgreement.java index 4b8ef950b3d..fa2e18d6674 100644 --- a/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/types/agreement/ContractAgreement.java +++ b/spi/common/core-spi/src/main/java/org/eclipse/edc/spi/types/domain/agreement/ContractAgreement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.edc.connector.contract.spi.types.agreement; +package org.eclipse.edc.spi.types.domain.agreement; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; diff --git a/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/types/offer/ContractOffer.java b/spi/common/core-spi/src/main/java/org/eclipse/edc/spi/types/domain/offer/ContractOffer.java similarity index 95% rename from spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/types/offer/ContractOffer.java rename to spi/common/core-spi/src/main/java/org/eclipse/edc/spi/types/domain/offer/ContractOffer.java index 19f90190f44..d863d6bdd54 100644 --- a/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/types/offer/ContractOffer.java +++ b/spi/common/core-spi/src/main/java/org/eclipse/edc/spi/types/domain/offer/ContractOffer.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.connector.contract.spi.types.offer; +package org.eclipse.edc.spi.types.domain.offer; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @@ -102,7 +102,7 @@ public Builder policy(Policy policy) { } public ContractOffer build() { - Objects.requireNonNull(contractOffer.id); + Objects.requireNonNull(contractOffer.id, "Id must not be null"); Objects.requireNonNull(contractOffer.assetId, "Asset id must not be null"); Objects.requireNonNull(contractOffer.policy, "Policy must not be null"); return contractOffer; diff --git a/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/event/contractnegotiation/ContractNegotiationEvent.java b/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/event/contractnegotiation/ContractNegotiationEvent.java index 2a1ff64179a..3ebe837926f 100644 --- a/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/event/contractnegotiation/ContractNegotiationEvent.java +++ b/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/event/contractnegotiation/ContractNegotiationEvent.java @@ -14,9 +14,9 @@ package org.eclipse.edc.connector.contract.spi.event.contractnegotiation; -import org.eclipse.edc.connector.contract.spi.types.offer.ContractOffer; import org.eclipse.edc.spi.event.Event; import org.eclipse.edc.spi.types.domain.callback.CallbackAddress; +import org.eclipse.edc.spi.types.domain.offer.ContractOffer; import java.util.ArrayList; import java.util.List; diff --git a/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/event/contractnegotiation/ContractNegotiationFinalized.java b/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/event/contractnegotiation/ContractNegotiationFinalized.java index 9f66ccc8d1b..1d5262c0899 100644 --- a/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/event/contractnegotiation/ContractNegotiationFinalized.java +++ b/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/event/contractnegotiation/ContractNegotiationFinalized.java @@ -17,7 +17,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import java.util.Objects; diff --git a/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/negotiation/store/ContractNegotiationStore.java b/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/negotiation/store/ContractNegotiationStore.java index 007a1a5a4eb..6e2ece6f38a 100644 --- a/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/negotiation/store/ContractNegotiationStore.java +++ b/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/negotiation/store/ContractNegotiationStore.java @@ -15,12 +15,12 @@ package org.eclipse.edc.connector.contract.spi.negotiation.store; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; import org.eclipse.edc.runtime.metamodel.annotation.ExtensionPoint; import org.eclipse.edc.spi.persistence.StateEntityStore; 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.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/types/agreement/ContractAgreementMessage.java b/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/types/agreement/ContractAgreementMessage.java index c1ecf212a30..bab6fbf0ebb 100644 --- a/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/types/agreement/ContractAgreementMessage.java +++ b/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/types/agreement/ContractAgreementMessage.java @@ -16,6 +16,7 @@ import org.eclipse.edc.connector.contract.spi.types.protocol.ContractRemoteMessage; import org.eclipse.edc.policy.model.Policy; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.jetbrains.annotations.NotNull; import java.util.Objects; diff --git a/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/types/negotiation/ContractNegotiation.java b/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/types/negotiation/ContractNegotiation.java index e51d6fb4931..5d53319373d 100644 --- a/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/types/negotiation/ContractNegotiation.java +++ b/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/types/negotiation/ContractNegotiation.java @@ -20,10 +20,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; -import org.eclipse.edc.connector.contract.spi.types.offer.ContractOffer; import org.eclipse.edc.spi.entity.StatefulEntity; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.spi.types.domain.callback.CallbackAddress; +import org.eclipse.edc.spi.types.domain.offer.ContractOffer; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/types/negotiation/ContractOfferMessage.java b/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/types/negotiation/ContractOfferMessage.java index 80be0b35c62..87ef99c1fde 100644 --- a/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/types/negotiation/ContractOfferMessage.java +++ b/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/types/negotiation/ContractOfferMessage.java @@ -14,9 +14,9 @@ package org.eclipse.edc.connector.contract.spi.types.negotiation; -import org.eclipse.edc.connector.contract.spi.types.offer.ContractOffer; import org.eclipse.edc.connector.contract.spi.types.protocol.ContractRemoteMessage; import org.eclipse.edc.policy.model.Policy; +import org.eclipse.edc.spi.types.domain.offer.ContractOffer; import org.jetbrains.annotations.NotNull; import java.util.Objects; @@ -29,94 +29,94 @@ * Sent by the provider. */ public class ContractOfferMessage implements ContractRemoteMessage { - + private String id; private String protocol = "unknown"; private String counterPartyAddress; private String callbackAddress; private String processId; private ContractOffer contractOffer; - + @Override public @NotNull String getId() { return id; } - + @Override public @NotNull String getProcessId() { return processId; } - + @Override public void setProtocol(String protocol) { Objects.requireNonNull(protocol); this.protocol = protocol; } - + @Override public String getProtocol() { return protocol; } - + public String getCallbackAddress() { return callbackAddress; } - + @Override public String getCounterPartyAddress() { return counterPartyAddress; } - + public ContractOffer getContractOffer() { return contractOffer; } - + @Override public Policy getPolicy() { return contractOffer.getPolicy(); } - + public static class Builder { private final ContractOfferMessage message; - + private Builder() { message = new ContractOfferMessage(); } - + public static Builder newInstance() { return new Builder(); } - + public Builder id(String id) { message.id = id; return this; } - + public Builder protocol(String protocol) { message.protocol = protocol; return this; } - + public Builder callbackAddress(String callbackAddress) { message.callbackAddress = callbackAddress; return this; } - + public Builder counterPartyAddress(String counterPartyAddress) { message.counterPartyAddress = counterPartyAddress; return this; } - + public Builder processId(String processId) { message.processId = processId; return this; } - + public Builder contractOffer(ContractOffer contractOffer) { message.contractOffer = contractOffer; return this; } - + public ContractOfferMessage build() { if (message.id == null) { message.id = randomUUID().toString(); diff --git a/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/types/negotiation/ContractRequest.java b/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/types/negotiation/ContractRequest.java index 32622aa6ffb..98d66709fd9 100644 --- a/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/types/negotiation/ContractRequest.java +++ b/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/types/negotiation/ContractRequest.java @@ -14,8 +14,8 @@ package org.eclipse.edc.connector.contract.spi.types.negotiation; -import org.eclipse.edc.connector.contract.spi.types.offer.ContractOffer; import org.eclipse.edc.spi.types.domain.callback.CallbackAddress; +import org.eclipse.edc.spi.types.domain.offer.ContractOffer; import java.util.ArrayList; import java.util.List; diff --git a/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/types/negotiation/ContractRequestMessage.java b/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/types/negotiation/ContractRequestMessage.java index d4e596383fa..466d8bd5803 100644 --- a/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/types/negotiation/ContractRequestMessage.java +++ b/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/types/negotiation/ContractRequestMessage.java @@ -14,9 +14,9 @@ package org.eclipse.edc.connector.contract.spi.types.negotiation; -import org.eclipse.edc.connector.contract.spi.types.offer.ContractOffer; import org.eclipse.edc.connector.contract.spi.types.protocol.ContractRemoteMessage; import org.eclipse.edc.policy.model.Policy; +import org.eclipse.edc.spi.types.domain.offer.ContractOffer; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/validation/ContractValidationService.java b/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/validation/ContractValidationService.java index c773b5f56b3..7cef1d0ac3f 100644 --- a/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/validation/ContractValidationService.java +++ b/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/validation/ContractValidationService.java @@ -15,13 +15,13 @@ package org.eclipse.edc.connector.contract.spi.validation; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; -import org.eclipse.edc.connector.contract.spi.types.offer.ContractOffer; import org.eclipse.edc.policy.engine.spi.PolicyScope; import org.eclipse.edc.runtime.metamodel.annotation.ExtensionPoint; import org.eclipse.edc.spi.iam.ClaimToken; import org.eclipse.edc.spi.result.Result; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; +import org.eclipse.edc.spi.types.domain.offer.ContractOffer; import org.jetbrains.annotations.NotNull; /** @@ -53,7 +53,7 @@ public interface ContractValidationService { /** * Validates the contract offer for the consumer represented by the given claims. * - * @param token The {@link ClaimToken} of the consumer + * @param token The {@link ClaimToken} of the consumer * @param offerId The initial {@link ContractOffer} id to validate * @return The referenced {@link ContractOffer}. */ @@ -64,18 +64,18 @@ public interface ContractValidationService { * Validates the contract agreement that the consumer referenced in its transfer request. * The {@code ClaimToken} must represent the counter-party that is referenced in the contract agreement. * - * @param token The {@link ClaimToken} of the consumer + * @param token The {@link ClaimToken} of the consumer * @param agreement The {@link ContractAgreement} between consumer and provider to validate * @return The result of the validation */ @NotNull Result validateAgreement(ClaimToken token, ContractAgreement agreement); - + /** * Validates the request for a contract agreement. Verifies that the requesting party is involved * in the contract agreement, but does not perform policy evaluation. * - * @param token The {@link ClaimToken} of the counter-party + * @param token The {@link ClaimToken} of the counter-party * @param agreement The agreement * @return The result of the validation */ @@ -85,7 +85,7 @@ public interface ContractValidationService { /** * Validates the request for a contract negotiation. * - * @param token The {@link ClaimToken} of the consumer + * @param token The {@link ClaimToken} of the consumer * @param negotiation The negotiation * @return The result of the validation */ @@ -95,8 +95,8 @@ public interface ContractValidationService { /** * When the negotiation has been confirmed by the provider, the consumer must validate it ensuring that it is the same that was sent in the last offer. * - * @param token The {@link ClaimToken} the provider token - * @param agreement The {@link ContractAgreement} between consumer and provider + * @param token The {@link ClaimToken} the provider token + * @param agreement The {@link ContractAgreement} between consumer and provider * @param latestOffer The last {@link ContractOffer} */ @NotNull diff --git a/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/validation/ValidatedConsumerOffer.java b/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/validation/ValidatedConsumerOffer.java index d41a8a4c9c4..aa4daa48232 100644 --- a/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/validation/ValidatedConsumerOffer.java +++ b/spi/control-plane/contract-spi/src/main/java/org/eclipse/edc/connector/contract/spi/validation/ValidatedConsumerOffer.java @@ -14,7 +14,7 @@ package org.eclipse.edc.connector.contract.spi.validation; -import org.eclipse.edc.connector.contract.spi.types.offer.ContractOffer; +import org.eclipse.edc.spi.types.domain.offer.ContractOffer; import static java.util.Objects.requireNonNull; diff --git a/spi/control-plane/contract-spi/src/test/java/org/eclipse/edc/connector/contract/spi/event/ContractEventTest.java b/spi/control-plane/contract-spi/src/test/java/org/eclipse/edc/connector/contract/spi/event/ContractEventTest.java index 0bf9d671f65..5f060089407 100644 --- a/spi/control-plane/contract-spi/src/test/java/org/eclipse/edc/connector/contract/spi/event/ContractEventTest.java +++ b/spi/control-plane/contract-spi/src/test/java/org/eclipse/edc/connector/contract/spi/event/ContractEventTest.java @@ -24,10 +24,10 @@ import org.eclipse.edc.connector.contract.spi.event.contractnegotiation.ContractNegotiationOffered; import org.eclipse.edc.connector.contract.spi.event.contractnegotiation.ContractNegotiationRequested; import org.eclipse.edc.connector.contract.spi.event.contractnegotiation.ContractNegotiationTerminated; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.policy.model.Policy; import org.eclipse.edc.spi.event.EventEnvelope; import org.eclipse.edc.spi.types.TypeManager; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.spi.types.domain.callback.CallbackAddress; import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.jupiter.params.ParameterizedTest; diff --git a/spi/control-plane/contract-spi/src/test/java/org/eclipse/edc/connector/contract/spi/types/negotiation/ContractRequestMessageTest.java b/spi/control-plane/contract-spi/src/test/java/org/eclipse/edc/connector/contract/spi/types/negotiation/ContractRequestMessageTest.java index 3bdc5d3cfd3..70b377c5832 100644 --- a/spi/control-plane/contract-spi/src/test/java/org/eclipse/edc/connector/contract/spi/types/negotiation/ContractRequestMessageTest.java +++ b/spi/control-plane/contract-spi/src/test/java/org/eclipse/edc/connector/contract/spi/types/negotiation/ContractRequestMessageTest.java @@ -14,8 +14,8 @@ package org.eclipse.edc.connector.contract.spi.types.negotiation; -import org.eclipse.edc.connector.contract.spi.types.offer.ContractOffer; import org.eclipse.edc.policy.model.Policy; +import org.eclipse.edc.spi.types.domain.offer.ContractOffer; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThatThrownBy; diff --git a/spi/control-plane/contract-spi/src/test/java/org/eclipse/edc/connector/contract/spi/types/offer/ContractOfferTest.java b/spi/control-plane/contract-spi/src/test/java/org/eclipse/edc/connector/contract/spi/types/offer/ContractOfferTest.java index 4e3b293d019..56eab39849a 100644 --- a/spi/control-plane/contract-spi/src/test/java/org/eclipse/edc/connector/contract/spi/types/offer/ContractOfferTest.java +++ b/spi/control-plane/contract-spi/src/test/java/org/eclipse/edc/connector/contract/spi/types/offer/ContractOfferTest.java @@ -15,6 +15,7 @@ package org.eclipse.edc.connector.contract.spi.types.offer; import org.eclipse.edc.policy.model.Policy; +import org.eclipse.edc.spi.types.domain.offer.ContractOffer; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThatThrownBy; diff --git a/spi/control-plane/contract-spi/src/testFixtures/java/org/eclipse/edc/connector/contract/spi/testfixtures/negotiation/store/ContractNegotiationStoreTestBase.java b/spi/control-plane/contract-spi/src/testFixtures/java/org/eclipse/edc/connector/contract/spi/testfixtures/negotiation/store/ContractNegotiationStoreTestBase.java index 9cf5ebad7a0..24d0e293341 100644 --- a/spi/control-plane/contract-spi/src/testFixtures/java/org/eclipse/edc/connector/contract/spi/testfixtures/negotiation/store/ContractNegotiationStoreTestBase.java +++ b/spi/control-plane/contract-spi/src/testFixtures/java/org/eclipse/edc/connector/contract/spi/testfixtures/negotiation/store/ContractNegotiationStoreTestBase.java @@ -17,7 +17,6 @@ import org.eclipse.edc.connector.contract.spi.ContractOfferId; import org.eclipse.edc.connector.contract.spi.negotiation.store.ContractNegotiationStore; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiationStates; import org.eclipse.edc.policy.model.Action; @@ -30,6 +29,7 @@ import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.spi.query.SortOrder; import org.eclipse.edc.spi.result.StoreFailure; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.spi.types.domain.callback.CallbackAddress; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; diff --git a/spi/control-plane/contract-spi/src/testFixtures/java/org/eclipse/edc/connector/contract/spi/testfixtures/negotiation/store/TestFunctions.java b/spi/control-plane/contract-spi/src/testFixtures/java/org/eclipse/edc/connector/contract/spi/testfixtures/negotiation/store/TestFunctions.java index d2bb36d6415..7c2b7ab29e6 100644 --- a/spi/control-plane/contract-spi/src/testFixtures/java/org/eclipse/edc/connector/contract/spi/testfixtures/negotiation/store/TestFunctions.java +++ b/spi/control-plane/contract-spi/src/testFixtures/java/org/eclipse/edc/connector/contract/spi/testfixtures/negotiation/store/TestFunctions.java @@ -16,7 +16,6 @@ package org.eclipse.edc.connector.contract.spi.testfixtures.negotiation.store; import org.eclipse.edc.connector.contract.spi.ContractOfferId; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiationStates; import org.eclipse.edc.policy.model.Action; @@ -25,6 +24,7 @@ import org.eclipse.edc.policy.model.Operator; import org.eclipse.edc.policy.model.Permission; import org.eclipse.edc.policy.model.Policy; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.spi.types.domain.callback.CallbackAddress; import java.time.Instant; diff --git a/spi/control-plane/control-plane-spi/build.gradle.kts b/spi/control-plane/control-plane-spi/build.gradle.kts index a5ec22f195e..b497f8d0a16 100644 --- a/spi/control-plane/control-plane-spi/build.gradle.kts +++ b/spi/control-plane/control-plane-spi/build.gradle.kts @@ -21,7 +21,6 @@ dependencies { api(project(":spi:common:core-spi")) api(project(":spi:common:transaction-spi")) api(project(":spi:common:transform-spi")) - api(project(":spi:common:web-spi")) api(project(":spi:control-plane:contract-spi")) api(project(":spi:control-plane:transfer-data-plane-spi")) api(project(":spi:control-plane:policy-spi")) diff --git a/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/contractagreement/ContractAgreementService.java b/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/contractagreement/ContractAgreementService.java index 7c52e82a14b..15d3917c7b0 100644 --- a/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/contractagreement/ContractAgreementService.java +++ b/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/contractagreement/ContractAgreementService.java @@ -14,10 +14,10 @@ package org.eclipse.edc.connector.spi.contractagreement; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.spi.result.ServiceResult; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import java.util.stream.Stream; diff --git a/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/contractnegotiation/ContractNegotiationService.java b/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/contractnegotiation/ContractNegotiationService.java index af8ee11d954..461dd1e129a 100644 --- a/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/contractnegotiation/ContractNegotiationService.java +++ b/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/contractnegotiation/ContractNegotiationService.java @@ -14,12 +14,12 @@ package org.eclipse.edc.connector.spi.contractnegotiation; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.command.TerminateNegotiationCommand; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractRequest; import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.spi.result.ServiceResult; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import java.util.stream.Stream; 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 f38c56d4ded..5855ea63a4a 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 @@ -20,6 +20,7 @@ dependencies { testImplementation(project(":core:common:junit")) // gives access to the Json LD models, etc. testImplementation(project(":spi:common:json-ld-spi")) + testImplementation(project(":spi:control-plane:contract-spi")) //useful for generic DTOs etc. testImplementation(project(":extensions:common:api:api-core")) diff --git a/system-tests/management-api/management-api-test-runner/src/test/java/org/eclipse/edc/test/e2e/managementapi/ContractAgreementApiEndToEndTest.java b/system-tests/management-api/management-api-test-runner/src/test/java/org/eclipse/edc/test/e2e/managementapi/ContractAgreementApiEndToEndTest.java index db7abab4819..62af35d27e9 100644 --- a/system-tests/management-api/management-api-test-runner/src/test/java/org/eclipse/edc/test/e2e/managementapi/ContractAgreementApiEndToEndTest.java +++ b/system-tests/management-api/management-api-test-runner/src/test/java/org/eclipse/edc/test/e2e/managementapi/ContractAgreementApiEndToEndTest.java @@ -15,12 +15,12 @@ package org.eclipse.edc.test.e2e.managementapi; import org.eclipse.edc.connector.contract.spi.negotiation.store.ContractNegotiationStore; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; -import org.eclipse.edc.connector.contract.spi.types.offer.ContractOffer; import org.eclipse.edc.junit.annotations.EndToEndTest; import org.eclipse.edc.policy.model.Policy; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.spi.types.domain.callback.CallbackAddress; +import org.eclipse.edc.spi.types.domain.offer.ContractOffer; import org.junit.jupiter.api.Test; import java.util.List; diff --git a/system-tests/management-api/management-api-test-runner/src/test/java/org/eclipse/edc/test/e2e/managementapi/ContractNegotiationApiEndToEndTest.java b/system-tests/management-api/management-api-test-runner/src/test/java/org/eclipse/edc/test/e2e/managementapi/ContractNegotiationApiEndToEndTest.java index 0ca24f2bec3..fac45856a94 100644 --- a/system-tests/management-api/management-api-test-runner/src/test/java/org/eclipse/edc/test/e2e/managementapi/ContractNegotiationApiEndToEndTest.java +++ b/system-tests/management-api/management-api-test-runner/src/test/java/org/eclipse/edc/test/e2e/managementapi/ContractNegotiationApiEndToEndTest.java @@ -18,13 +18,13 @@ import jakarta.json.JsonArrayBuilder; import jakarta.json.JsonObject; import org.eclipse.edc.connector.contract.spi.negotiation.store.ContractNegotiationStore; -import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiationStates; -import org.eclipse.edc.connector.contract.spi.types.offer.ContractOffer; import org.eclipse.edc.junit.annotations.EndToEndTest; import org.eclipse.edc.policy.model.Policy; +import org.eclipse.edc.spi.types.domain.agreement.ContractAgreement; import org.eclipse.edc.spi.types.domain.callback.CallbackAddress; +import org.eclipse.edc.spi.types.domain.offer.ContractOffer; import org.junit.jupiter.api.Test; import java.util.List;