From 32f44af94314f61445133eff10875d02d3567205 Mon Sep 17 00:00:00 2001 From: Jim Marino Date: Mon, 30 Oct 2023 16:20:56 +0100 Subject: [PATCH] chore: Remove aggregate-service-spi and move result classes to core-spi (#3578) Remove aggregate-service-spi and move result classes to core-spi --- .../ContractNegotiationIntegrationTest.java | 2 +- .../service/asset/AssetServiceImpl.java | 2 +- .../catalog/CatalogProtocolServiceImpl.java | 2 +- .../ContractAgreementServiceImpl.java | 2 +- .../ContractDefinitionServiceImpl.java | 2 +- ...ontractNegotiationProtocolServiceImpl.java | 4 +- .../ContractNegotiationServiceImpl.java | 2 +- .../PolicyDefinitionServiceImpl.java | 2 +- .../TransferProcessProtocolServiceImpl.java | 2 +- .../TransferProcessServiceImpl.java | 2 +- .../service/asset/AssetServiceImplTest.java | 60 ++++++------------- .../CatalogProtocolServiceImplTest.java | 4 +- .../ContractDefinitionServiceImplTest.java | 4 +- ...actNegotiationProtocolServiceImplTest.java | 38 ++++++------ .../ContractNegotiationServiceImplTest.java | 4 +- .../PolicyDefinitionServiceImplTest.java | 4 +- ...ransferProcessProtocolServiceImplTest.java | 10 ++-- .../TransferProcessServiceImplTest.java | 8 +-- .../DataPlaneSelectorServiceImpl.java | 2 +- .../manager/PolicyMonitorManagerImplTest.java | 2 +- .../configuration/error/DspErrorResponse.java | 2 +- .../message/DspRequestHandlerImplTest.java | 2 +- .../dsp/dsp-http-spi/build.gradle.kts | 1 - .../protocol/dsp/spi/message/DspRequest.java | 2 +- .../DspNegotiationApiController.java | 2 +- .../common/api/api-core/build.gradle.kts | 1 - .../service/StsClientServiceImpl.java | 2 +- .../StsClientTokenGeneratorServiceImpl.java | 2 +- ...tsClientTokenGeneratorServiceImplTest.java | 2 +- .../api/sts/exception/StsTokenException.java | 2 +- .../exception/StsTokenExceptionMapper.java | 10 ++-- .../SecureServiceTokenApiControllerTest.java | 4 +- ...ansferProcessControlApiControllerTest.java | 4 +- .../asset/v3/AssetApiControllerTest.java | 2 +- .../ContractAgreementApiControllerTest.java | 2 +- .../ContractDefinitionApiControllerTest.java | 2 +- .../ContractNegotiationApiControllerTest.java | 2 +- .../PolicyDefinitionApiControllerTest.java | 2 +- .../TransferProcessApiControllerTest.java | 2 +- ...tpProvisionerWebhookApiControllerTest.java | 2 +- .../data-plane-selector-api/build.gradle.kts | 1 - settings.gradle.kts | 1 - .../aggregate-service-spi/build.gradle.kts | 24 -------- .../edc}/spi/result/ServiceFailure.java | 7 ++- .../edc}/spi/result/ServiceResult.java | 15 ++--- .../edc}/spi/result/ServiceResultTest.java | 9 ++- .../identity-trust-sts-spi/build.gradle.kts | 1 - .../sts/service/StsClientService.java | 2 +- .../StsClientTokenGeneratorService.java | 2 +- spi/common/web-spi/build.gradle.kts | 1 - .../spi/exception/ServiceResultHandler.java | 4 +- .../control-plane-spi/build.gradle.kts | 1 - .../edc/connector/spi/asset/AssetService.java | 2 +- .../spi/catalog/CatalogProtocolService.java | 2 +- .../ContractAgreementService.java | 2 +- .../ContractDefinitionService.java | 2 +- .../ContractNegotiationProtocolService.java | 4 +- .../ContractNegotiationService.java | 2 +- .../PolicyDefinitionService.java | 2 +- .../TransferProcessProtocolService.java | 4 +- .../TransferProcessService.java | 2 +- .../data-plane-selector-spi/build.gradle.kts | 1 - .../spi/DataPlaneSelectorService.java | 2 +- 63 files changed, 122 insertions(+), 179 deletions(-) delete mode 100644 spi/common/aggregate-service-spi/build.gradle.kts rename spi/common/{aggregate-service-spi/src/main/java/org/eclipse/edc/service => core-spi/src/main/java/org/eclipse/edc}/spi/result/ServiceFailure.java (89%) rename spi/common/{aggregate-service-spi/src/main/java/org/eclipse/edc/service => core-spi/src/main/java/org/eclipse/edc}/spi/result/ServiceResult.java (88%) rename spi/common/{aggregate-service-spi/src/test/java/org/eclipse/edc/service => core-spi/src/test/java/org/eclipse/edc}/spi/result/ServiceResultTest.java (84%) 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 a3a06c623d7..d30e31ff202 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 @@ -38,13 +38,13 @@ import org.eclipse.edc.policy.model.Duty; import org.eclipse.edc.policy.model.Policy; import org.eclipse.edc.policy.model.PolicyType; -import org.eclipse.edc.service.spi.result.ServiceResult; import org.eclipse.edc.spi.iam.ClaimToken; import org.eclipse.edc.spi.message.RemoteMessageDispatcherRegistry; import org.eclipse.edc.spi.monitor.ConsoleMonitor; import org.eclipse.edc.spi.protocol.ProtocolWebhook; import org.eclipse.edc.spi.response.StatusResult; 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.callback.CallbackAddress; import org.eclipse.edc.transaction.spi.NoopTransactionContext; diff --git a/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/asset/AssetServiceImpl.java b/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/asset/AssetServiceImpl.java index a44aab250ce..e194ce4be29 100644 --- a/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/asset/AssetServiceImpl.java +++ b/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/asset/AssetServiceImpl.java @@ -18,10 +18,10 @@ import org.eclipse.edc.connector.contract.spi.negotiation.store.ContractNegotiationStore; import org.eclipse.edc.connector.service.query.QueryValidator; import org.eclipse.edc.connector.spi.asset.AssetService; -import org.eclipse.edc.service.spi.result.ServiceResult; import org.eclipse.edc.spi.asset.AssetIndex; import org.eclipse.edc.spi.query.Criterion; import org.eclipse.edc.spi.query.QuerySpec; +import org.eclipse.edc.spi.result.ServiceResult; import org.eclipse.edc.spi.types.domain.asset.Asset; import org.eclipse.edc.transaction.spi.TransactionContext; import org.eclipse.edc.validator.spi.DataAddressValidatorRegistry; diff --git a/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/catalog/CatalogProtocolServiceImpl.java b/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/catalog/CatalogProtocolServiceImpl.java index df74cea89f9..fdc76761915 100644 --- a/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/catalog/CatalogProtocolServiceImpl.java +++ b/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/catalog/CatalogProtocolServiceImpl.java @@ -20,9 +20,9 @@ import org.eclipse.edc.catalog.spi.Dataset; import org.eclipse.edc.catalog.spi.DatasetResolver; import org.eclipse.edc.connector.spi.catalog.CatalogProtocolService; -import org.eclipse.edc.service.spi.result.ServiceResult; import org.eclipse.edc.spi.agent.ParticipantAgentService; import org.eclipse.edc.spi.iam.ClaimToken; +import org.eclipse.edc.spi.result.ServiceResult; import org.jetbrains.annotations.NotNull; import static java.lang.String.format; 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 657ae04fe64..13db29ab51c 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 @@ -19,8 +19,8 @@ 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.service.spi.result.ServiceResult; import org.eclipse.edc.spi.query.QuerySpec; +import org.eclipse.edc.spi.result.ServiceResult; 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/contractdefinition/ContractDefinitionServiceImpl.java b/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/contractdefinition/ContractDefinitionServiceImpl.java index a2bda928e41..bdc0e26d227 100644 --- a/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/contractdefinition/ContractDefinitionServiceImpl.java +++ b/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/contractdefinition/ContractDefinitionServiceImpl.java @@ -19,8 +19,8 @@ import org.eclipse.edc.connector.contract.spi.types.offer.ContractDefinition; import org.eclipse.edc.connector.service.query.QueryValidator; import org.eclipse.edc.connector.spi.contractdefinition.ContractDefinitionService; -import org.eclipse.edc.service.spi.result.ServiceResult; import org.eclipse.edc.spi.query.QuerySpec; +import org.eclipse.edc.spi.result.ServiceResult; 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/ContractNegotiationProtocolServiceImpl.java b/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/contractnegotiation/ContractNegotiationProtocolServiceImpl.java index 20ddb398b6f..11cf7e55b11 100644 --- a/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/contractnegotiation/ContractNegotiationProtocolServiceImpl.java +++ b/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/contractnegotiation/ContractNegotiationProtocolServiceImpl.java @@ -29,9 +29,9 @@ 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; -import org.eclipse.edc.service.spi.result.ServiceResult; import org.eclipse.edc.spi.iam.ClaimToken; import org.eclipse.edc.spi.monitor.Monitor; +import org.eclipse.edc.spi.result.ServiceResult; import org.eclipse.edc.spi.telemetry.Telemetry; import org.eclipse.edc.transaction.spi.TransactionContext; import org.jetbrains.annotations.NotNull; @@ -157,7 +157,7 @@ public ServiceResult notifyTerminated(ContractNegotiationTe observable.invokeForEach(l -> l.terminated(negotiation)); })); } - + @Override @WithSpan @NotNull 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 05ec3d608a9..1d5575519a1 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 @@ -23,9 +23,9 @@ import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractRequest; import org.eclipse.edc.connector.service.query.QueryValidator; import org.eclipse.edc.connector.spi.contractnegotiation.ContractNegotiationService; -import org.eclipse.edc.service.spi.result.ServiceResult; 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.transaction.spi.TransactionContext; import java.util.Optional; diff --git a/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/policydefinition/PolicyDefinitionServiceImpl.java b/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/policydefinition/PolicyDefinitionServiceImpl.java index 8db178fec42..448b3eee41d 100644 --- a/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/policydefinition/PolicyDefinitionServiceImpl.java +++ b/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/policydefinition/PolicyDefinitionServiceImpl.java @@ -28,8 +28,8 @@ import org.eclipse.edc.policy.model.MultiplicityConstraint; import org.eclipse.edc.policy.model.OrConstraint; import org.eclipse.edc.policy.model.XoneConstraint; -import org.eclipse.edc.service.spi.result.ServiceResult; import org.eclipse.edc.spi.query.QuerySpec; +import org.eclipse.edc.spi.result.ServiceResult; import org.eclipse.edc.transaction.spi.TransactionContext; import org.jetbrains.annotations.NotNull; diff --git a/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/transferprocess/TransferProcessProtocolServiceImpl.java b/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/transferprocess/TransferProcessProtocolServiceImpl.java index 89139f4c0d9..1d8f9608b1a 100644 --- a/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/transferprocess/TransferProcessProtocolServiceImpl.java +++ b/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/transferprocess/TransferProcessProtocolServiceImpl.java @@ -30,10 +30,10 @@ import org.eclipse.edc.connector.transfer.spi.types.protocol.TransferRequestMessage; import org.eclipse.edc.connector.transfer.spi.types.protocol.TransferStartMessage; import org.eclipse.edc.connector.transfer.spi.types.protocol.TransferTerminationMessage; -import org.eclipse.edc.service.spi.result.ServiceResult; import org.eclipse.edc.spi.iam.ClaimToken; import org.eclipse.edc.spi.monitor.Monitor; 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.DataAddress; import org.eclipse.edc.transaction.spi.TransactionContext; diff --git a/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/transferprocess/TransferProcessServiceImpl.java b/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/transferprocess/TransferProcessServiceImpl.java index e53e21c44cb..ea95ce4991e 100644 --- a/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/transferprocess/TransferProcessServiceImpl.java +++ b/core/control-plane/control-plane-aggregate-services/src/main/java/org/eclipse/edc/connector/service/transferprocess/TransferProcessServiceImpl.java @@ -33,10 +33,10 @@ import org.eclipse.edc.connector.transfer.spi.types.command.DeprovisionCompleteCommand; import org.eclipse.edc.connector.transfer.spi.types.command.DeprovisionRequest; import org.eclipse.edc.connector.transfer.spi.types.command.TerminateTransferCommand; -import org.eclipse.edc.service.spi.result.ServiceResult; import org.eclipse.edc.spi.command.CommandHandlerRegistry; import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.spi.result.AbstractResult; +import org.eclipse.edc.spi.result.ServiceResult; import org.eclipse.edc.transaction.spi.TransactionContext; import org.eclipse.edc.validator.spi.DataAddressValidatorRegistry; import org.jetbrains.annotations.NotNull; 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 54463522e5f..2ed502b8681 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 @@ -21,12 +21,12 @@ 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; -import org.eclipse.edc.service.spi.result.ServiceFailure; -import org.eclipse.edc.service.spi.result.ServiceResult; import org.eclipse.edc.spi.asset.AssetIndex; import org.eclipse.edc.spi.query.Criterion; import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.spi.result.Failure; +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.DataAddress; import org.eclipse.edc.spi.types.domain.asset.Asset; @@ -50,10 +50,10 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.eclipse.edc.junit.assertions.AbstractResultAssert.assertThat; -import static org.eclipse.edc.service.spi.result.ServiceFailure.Reason.BAD_REQUEST; -import static org.eclipse.edc.service.spi.result.ServiceFailure.Reason.CONFLICT; -import static org.eclipse.edc.service.spi.result.ServiceFailure.Reason.NOT_FOUND; import static org.eclipse.edc.spi.query.Criterion.criterion; +import static org.eclipse.edc.spi.result.ServiceFailure.Reason.BAD_REQUEST; +import static org.eclipse.edc.spi.result.ServiceFailure.Reason.CONFLICT; +import static org.eclipse.edc.spi.result.ServiceFailure.Reason.NOT_FOUND; import static org.eclipse.edc.validator.spi.Violation.violation; import static org.junit.jupiter.params.provider.Arguments.arguments; import static org.mockito.AdditionalMatchers.and; @@ -77,8 +77,7 @@ class AssetServiceImplTest { private final AssetObservable observable = mock(); private final DataAddressValidatorRegistry dataAddressValidator = mock(); - private final AssetService service = new AssetServiceImpl(index, contractNegotiationStore, dummyTransactionContext, - observable, dataAddressValidator); + private final AssetService service = new AssetServiceImpl(index, contractNegotiationStore, dummyTransactionContext, observable, dataAddressValidator); @Test void findById_shouldRelyOnAssetIndex() { @@ -102,17 +101,9 @@ void query_shouldRelyOnAssetIndex() { } @ParameterizedTest - @ValueSource(strings = { - Asset.PROPERTY_ID, - Asset.PROPERTY_NAME, - Asset.PROPERTY_DESCRIPTION, - Asset.PROPERTY_VERSION, - Asset.PROPERTY_CONTENT_TYPE - }) + @ValueSource(strings = { Asset.PROPERTY_ID, Asset.PROPERTY_NAME, Asset.PROPERTY_DESCRIPTION, Asset.PROPERTY_VERSION, Asset.PROPERTY_CONTENT_TYPE }) void query_validFilter(String filter) { - var query = QuerySpec.Builder.newInstance() - .filter(criterion(filter, "=", "somevalue")) - .build(); + var query = QuerySpec.Builder.newInstance().filter(criterion(filter, "=", "somevalue")).build(); service.query(query); @@ -122,14 +113,11 @@ void query_validFilter(String filter) { @ParameterizedTest @ArgumentsSource(InvalidFilters.class) void query_invalidFilter(Criterion filter) { - var query = QuerySpec.Builder.newInstance() - .filter(filter) - .build(); + var query = QuerySpec.Builder.newInstance().filter(filter).build(); var result = service.query(query); - assertThat(result).isFailed() - .extracting(Failure::getMessages).asList().hasSize(1); + assertThat(result).isFailed().extracting(Failure::getMessages).asList().hasSize(1); } @Test @@ -166,25 +154,18 @@ void createAsset_shouldNotCreateAssetIfDataAddressInvalid() { var result = service.create(asset); - Assertions.assertThat(result).satisfies(ServiceResult::failed) - .extracting(ServiceResult::reason) - .isEqualTo(BAD_REQUEST); + Assertions.assertThat(result).satisfies(ServiceResult::failed).extracting(ServiceResult::reason).isEqualTo(BAD_REQUEST); verifyNoInteractions(index); } @Test void createAsset_shouldFail_whenPropertiesAreDuplicated() { - var asset = createAssetBuilder("assetId") - .property("property", "value") - .privateProperty("property", "other-value") - .build(); + var asset = createAssetBuilder("assetId").property("property", "value").privateProperty("property", "other-value").build(); when(dataAddressValidator.validateSource(any())).thenReturn(ValidationResult.success()); var result = service.create(asset); - assertThat(result).isFailed() - .extracting(ServiceFailure::getReason) - .isEqualTo(BAD_REQUEST); + assertThat(result).isFailed().extracting(ServiceFailure::getReason).isEqualTo(BAD_REQUEST); verifyNoInteractions(index); } @@ -243,8 +224,7 @@ void delete_verifyCorrectQuery() { var deleted = service.delete("test-asset"); assertThat(deleted.succeeded()).isTrue(); - verify(contractNegotiationStore).queryNegotiations(argThat(argument -> argument.getFilterExpression().size() == 1 && - argument.getFilterExpression().get(0).getOperandLeft().equals("contractAgreement.assetId"))); + verify(contractNegotiationStore).queryNegotiations(argThat(argument -> argument.getFilterExpression().size() == 1 && argument.getFilterExpression().get(0).getOperandLeft().equals("contractAgreement.assetId"))); } @Test @@ -278,24 +258,18 @@ void updateAsset_shouldReturnNotFound_whenNotExists() { @Test void updateAsset_shouldFail_whenPropertiesAreDuplicated() { - var asset = createAssetBuilder("assetId") - .property("property", "value") - .privateProperty("property", "other-value") - .build(); + var asset = createAssetBuilder("assetId").property("property", "value").privateProperty("property", "other-value").build(); var result = service.update(asset); - assertThat(result).isFailed() - .extracting(ServiceFailure::getReason) - .isEqualTo(BAD_REQUEST); + assertThat(result).isFailed().extracting(ServiceFailure::getReason).isEqualTo(BAD_REQUEST); verifyNoInteractions(index); } private static class InvalidFilters implements ArgumentsProvider { @Override public Stream provideArguments(ExtensionContext context) { - return Stream.of( - arguments(criterion(" asset_prop_id", "in", "(foo, bar)")), // invalid leading whitespace + return Stream.of(arguments(criterion(" asset_prop_id", "in", "(foo, bar)")), // invalid leading whitespace arguments(criterion(".customProp", "=", "whatever")) // invalid leading dot ); } diff --git a/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/catalog/CatalogProtocolServiceImplTest.java b/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/catalog/CatalogProtocolServiceImplTest.java index 3c816067b3c..454b427f400 100644 --- a/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/catalog/CatalogProtocolServiceImplTest.java +++ b/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/catalog/CatalogProtocolServiceImplTest.java @@ -21,11 +21,11 @@ import org.eclipse.edc.catalog.spi.DatasetResolver; import org.eclipse.edc.catalog.spi.Distribution; import org.eclipse.edc.policy.model.Policy; -import org.eclipse.edc.service.spi.result.ServiceFailure; import org.eclipse.edc.spi.agent.ParticipantAgent; import org.eclipse.edc.spi.agent.ParticipantAgentService; import org.eclipse.edc.spi.iam.ClaimToken; import org.eclipse.edc.spi.query.QuerySpec; +import org.eclipse.edc.spi.result.ServiceFailure; import org.junit.jupiter.api.Test; import java.util.List; @@ -35,7 +35,7 @@ import static java.util.Collections.emptyMap; import static org.assertj.core.api.Assertions.assertThat; import static org.eclipse.edc.junit.assertions.AbstractResultAssert.assertThat; -import static org.eclipse.edc.service.spi.result.ServiceFailure.Reason.NOT_FOUND; +import static org.eclipse.edc.spi.result.ServiceFailure.Reason.NOT_FOUND; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; diff --git a/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/contractdefinition/ContractDefinitionServiceImplTest.java b/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/contractdefinition/ContractDefinitionServiceImplTest.java index 543eae77830..0f2227dd3cc 100644 --- a/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/contractdefinition/ContractDefinitionServiceImplTest.java +++ b/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/contractdefinition/ContractDefinitionServiceImplTest.java @@ -38,9 +38,9 @@ import java.util.stream.Stream; import static org.assertj.core.api.Assertions.assertThat; -import static org.eclipse.edc.service.spi.result.ServiceFailure.Reason.CONFLICT; -import static org.eclipse.edc.service.spi.result.ServiceFailure.Reason.NOT_FOUND; import static org.eclipse.edc.spi.query.Criterion.criterion; +import static org.eclipse.edc.spi.result.ServiceFailure.Reason.CONFLICT; +import static org.eclipse.edc.spi.result.ServiceFailure.Reason.NOT_FOUND; import static org.junit.jupiter.params.provider.Arguments.arguments; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; 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 032490ad33b..8db7b08e224 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 @@ -31,10 +31,10 @@ import org.eclipse.edc.connector.contract.spi.validation.ValidatedConsumerOffer; import org.eclipse.edc.connector.spi.contractnegotiation.ContractNegotiationProtocolService; import org.eclipse.edc.policy.model.Policy; -import org.eclipse.edc.service.spi.result.ServiceFailure; -import org.eclipse.edc.service.spi.result.ServiceResult; import org.eclipse.edc.spi.iam.ClaimToken; import org.eclipse.edc.spi.result.Result; +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.message.RemoteMessage; import org.eclipse.edc.transaction.spi.NoopTransactionContext; @@ -63,8 +63,8 @@ import static org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiationStates.VERIFIED; import static org.eclipse.edc.connector.service.contractnegotiation.ContractNegotiationProtocolServiceImplTest.TestFunctions.contractOffer; import static org.eclipse.edc.junit.assertions.AbstractResultAssert.assertThat; -import static org.eclipse.edc.service.spi.result.ServiceFailure.Reason.BAD_REQUEST; -import static org.eclipse.edc.service.spi.result.ServiceFailure.Reason.NOT_FOUND; +import static org.eclipse.edc.spi.result.ServiceFailure.Reason.BAD_REQUEST; +import static org.eclipse.edc.spi.result.ServiceFailure.Reason.NOT_FOUND; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.argThat; import static org.mockito.ArgumentMatchers.eq; @@ -172,17 +172,17 @@ void notifyOffered_shouldTransitionToOffered_whenNegotiationFound() { .processId(processId) .build(); var negotiation = createContractNegotiationRequested(); - + when(store.findByCorrelationIdAndLease(processId)).thenReturn(StoreResult.success(negotiation)); when(validationService.validateRequest(token, negotiation)).thenReturn(Result.success()); - + var result = service.notifyOffered(message, token); - + assertThat(result).isSucceeded(); var updatedNegotiation = result.getContent(); assertThat(updatedNegotiation.getContractOffers()).hasSize(2); assertThat(updatedNegotiation.getLastContractOffer()).isEqualTo(contractOffer); - + verify(listener).offered(any()); verify(transactionContext, atLeastOnce()).execute(any(TransactionContext.ResultTransactionBlock.class)); } @@ -299,46 +299,46 @@ void notifyTerminated_shouldTransitionToTerminated() { verify(validationService).validateRequest(any(), any(ContractNegotiation.class)); verify(transactionContext, atLeastOnce()).execute(any(TransactionContext.ResultTransactionBlock.class)); } - + @Test void findById_shouldReturnNegotiation_whenValidCounterParty() { var id = "negotiationId"; var token = ClaimToken.Builder.newInstance().build(); var negotiation = contractNegotiationBuilder().id(id).type(PROVIDER).state(VERIFIED.code()).build(); - + when(store.findById(id)).thenReturn(negotiation); when(validationService.validateRequest(token, negotiation)).thenReturn(Result.success()); - + var result = service.findById(id, token); - + assertThat(result) .isSucceeded() .isEqualTo(negotiation); } - + @Test void findById_shouldReturnNotFound_whenNegotiationNotFound() { when(store.findById(any())).thenReturn(null); - + var result = service.findById("invalidId", ClaimToken.Builder.newInstance().build()); - + assertThat(result) .isFailed() .extracting(ServiceFailure::getReason) .isEqualTo(NOT_FOUND); } - + @Test void findById_shouldReturnBadRequest_whenCounterPartyUnauthorized() { var id = "negotiationId"; var token = ClaimToken.Builder.newInstance().build(); var negotiation = contractNegotiationBuilder().id(id).type(PROVIDER).state(VERIFIED.code()).build(); - + when(store.findById(id)).thenReturn(negotiation); when(validationService.validateRequest(token, negotiation)).thenReturn(Result.failure("validation error")); - + var result = service.findById(id, token); - + assertThat(result) .isFailed() .extracting(ServiceFailure::getReason) 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 bb50eb075a2..61c5cd29838 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 @@ -22,12 +22,12 @@ 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.service.spi.result.ServiceFailure; import org.eclipse.edc.spi.command.CommandHandlerRegistry; import org.eclipse.edc.spi.command.CommandResult; import org.eclipse.edc.spi.query.Criterion; 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.transaction.spi.NoopTransactionContext; import org.eclipse.edc.transaction.spi.TransactionContext; import org.junit.jupiter.api.Test; @@ -43,8 +43,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiationStates.REQUESTED; import static org.eclipse.edc.junit.assertions.AbstractResultAssert.assertThat; -import static org.eclipse.edc.service.spi.result.ServiceFailure.Reason.NOT_FOUND; import static org.eclipse.edc.spi.query.Criterion.criterion; +import static org.eclipse.edc.spi.result.ServiceFailure.Reason.NOT_FOUND; import static org.junit.jupiter.params.provider.Arguments.arguments; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.isA; diff --git a/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/policydefinition/PolicyDefinitionServiceImplTest.java b/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/policydefinition/PolicyDefinitionServiceImplTest.java index a9a2aeb9c5e..28b0c60dd21 100644 --- a/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/policydefinition/PolicyDefinitionServiceImplTest.java +++ b/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/policydefinition/PolicyDefinitionServiceImplTest.java @@ -38,9 +38,9 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.eclipse.edc.junit.assertions.AbstractResultAssert.assertThat; -import static org.eclipse.edc.service.spi.result.ServiceFailure.Reason.CONFLICT; -import static org.eclipse.edc.service.spi.result.ServiceFailure.Reason.NOT_FOUND; import static org.eclipse.edc.spi.query.Criterion.criterion; +import static org.eclipse.edc.spi.result.ServiceFailure.Reason.CONFLICT; +import static org.eclipse.edc.spi.result.ServiceFailure.Reason.NOT_FOUND; import static org.junit.jupiter.params.provider.Arguments.arguments; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; 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 b180e4d9a45..8cbe17a9534 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 @@ -31,10 +31,10 @@ import org.eclipse.edc.connector.transfer.spi.types.protocol.TransferStartMessage; import org.eclipse.edc.connector.transfer.spi.types.protocol.TransferTerminationMessage; import org.eclipse.edc.policy.model.Policy; -import org.eclipse.edc.service.spi.result.ServiceFailure; -import org.eclipse.edc.service.spi.result.ServiceResult; import org.eclipse.edc.spi.iam.ClaimToken; import org.eclipse.edc.spi.result.Result; +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.DataAddress; import org.eclipse.edc.spi.types.domain.message.RemoteMessage; @@ -62,9 +62,9 @@ import static org.eclipse.edc.connector.transfer.spi.types.TransferProcessStates.STARTED; import static org.eclipse.edc.connector.transfer.spi.types.TransferProcessStates.TERMINATED; import static org.eclipse.edc.junit.assertions.AbstractResultAssert.assertThat; -import static org.eclipse.edc.service.spi.result.ServiceFailure.Reason.BAD_REQUEST; -import static org.eclipse.edc.service.spi.result.ServiceFailure.Reason.CONFLICT; -import static org.eclipse.edc.service.spi.result.ServiceFailure.Reason.NOT_FOUND; +import static org.eclipse.edc.spi.result.ServiceFailure.Reason.BAD_REQUEST; +import static org.eclipse.edc.spi.result.ServiceFailure.Reason.CONFLICT; +import static org.eclipse.edc.spi.result.ServiceFailure.Reason.NOT_FOUND; import static org.eclipse.edc.validator.spi.Violation.violation; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.argThat; diff --git a/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/transferprocess/TransferProcessServiceImplTest.java b/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/transferprocess/TransferProcessServiceImplTest.java index 50a7ebc1b2c..54f952d1c30 100644 --- a/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/transferprocess/TransferProcessServiceImplTest.java +++ b/core/control-plane/control-plane-aggregate-services/src/test/java/org/eclipse/edc/connector/service/transferprocess/TransferProcessServiceImplTest.java @@ -25,13 +25,13 @@ import org.eclipse.edc.connector.transfer.spi.types.TransferRequest; import org.eclipse.edc.connector.transfer.spi.types.command.DeprovisionRequest; import org.eclipse.edc.connector.transfer.spi.types.command.TerminateTransferCommand; -import org.eclipse.edc.service.spi.result.ServiceFailure; -import org.eclipse.edc.service.spi.result.ServiceResult; import org.eclipse.edc.spi.command.CommandHandlerRegistry; import org.eclipse.edc.spi.command.CommandResult; import org.eclipse.edc.spi.query.Criterion; 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.result.ServiceResult; import org.eclipse.edc.spi.types.domain.DataAddress; import org.eclipse.edc.transaction.spi.NoopTransactionContext; import org.eclipse.edc.transaction.spi.TransactionContext; @@ -50,9 +50,9 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.eclipse.edc.junit.assertions.AbstractResultAssert.assertThat; -import static org.eclipse.edc.service.spi.result.ServiceFailure.Reason.BAD_REQUEST; -import static org.eclipse.edc.service.spi.result.ServiceFailure.Reason.NOT_FOUND; import static org.eclipse.edc.spi.query.Criterion.criterion; +import static org.eclipse.edc.spi.result.ServiceFailure.Reason.BAD_REQUEST; +import static org.eclipse.edc.spi.result.ServiceFailure.Reason.NOT_FOUND; import static org.eclipse.edc.validator.spi.Violation.violation; import static org.junit.jupiter.params.provider.Arguments.arguments; import static org.mockito.ArgumentMatchers.any; diff --git a/core/data-plane-selector/data-plane-selector-core/src/main/java/org/eclipse/edc/connector/dataplane/selector/DataPlaneSelectorServiceImpl.java b/core/data-plane-selector/data-plane-selector-core/src/main/java/org/eclipse/edc/connector/dataplane/selector/DataPlaneSelectorServiceImpl.java index 4e6369124cc..19582a8589c 100644 --- a/core/data-plane-selector/data-plane-selector-core/src/main/java/org/eclipse/edc/connector/dataplane/selector/DataPlaneSelectorServiceImpl.java +++ b/core/data-plane-selector/data-plane-selector-core/src/main/java/org/eclipse/edc/connector/dataplane/selector/DataPlaneSelectorServiceImpl.java @@ -19,7 +19,7 @@ import org.eclipse.edc.connector.dataplane.selector.spi.instance.DataPlaneInstance; import org.eclipse.edc.connector.dataplane.selector.spi.store.DataPlaneInstanceStore; import org.eclipse.edc.connector.dataplane.selector.spi.strategy.SelectionStrategyRegistry; -import org.eclipse.edc.service.spi.result.ServiceResult; +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.transaction.spi.TransactionContext; 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 8729ae47af4..647fc339765 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 @@ -26,9 +26,9 @@ import org.eclipse.edc.policy.engine.spi.PolicyContextImpl; import org.eclipse.edc.policy.engine.spi.PolicyEngine; import org.eclipse.edc.policy.model.Policy; -import org.eclipse.edc.service.spi.result.ServiceResult; import org.eclipse.edc.spi.query.Criterion; import org.eclipse.edc.spi.result.Result; +import org.eclipse.edc.spi.result.ServiceResult; import org.eclipse.edc.spi.system.ExecutorInstrumentation; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/data-protocols/dsp/dsp-api-configuration/src/main/java/org/eclipse/edc/protocol/dsp/api/configuration/error/DspErrorResponse.java b/data-protocols/dsp/dsp-api-configuration/src/main/java/org/eclipse/edc/protocol/dsp/api/configuration/error/DspErrorResponse.java index 07ba2302ff2..40ccb350d5b 100644 --- a/data-protocols/dsp/dsp-api-configuration/src/main/java/org/eclipse/edc/protocol/dsp/api/configuration/error/DspErrorResponse.java +++ b/data-protocols/dsp/dsp-api-configuration/src/main/java/org/eclipse/edc/protocol/dsp/api/configuration/error/DspErrorResponse.java @@ -17,7 +17,7 @@ import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; import org.eclipse.edc.protocol.dsp.DspError; -import org.eclipse.edc.service.spi.result.ServiceFailure; +import org.eclipse.edc.spi.result.ServiceFailure; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; diff --git a/data-protocols/dsp/dsp-api-configuration/src/test/java/org/eclipse/edc/protocol/dsp/api/configuration/message/DspRequestHandlerImplTest.java b/data-protocols/dsp/dsp-api-configuration/src/test/java/org/eclipse/edc/protocol/dsp/api/configuration/message/DspRequestHandlerImplTest.java index aeb0adae61c..3b5f0ef6f15 100644 --- a/data-protocols/dsp/dsp-api-configuration/src/test/java/org/eclipse/edc/protocol/dsp/api/configuration/message/DspRequestHandlerImplTest.java +++ b/data-protocols/dsp/dsp-api-configuration/src/test/java/org/eclipse/edc/protocol/dsp/api/configuration/message/DspRequestHandlerImplTest.java @@ -18,10 +18,10 @@ import jakarta.json.JsonObject; import org.eclipse.edc.protocol.dsp.spi.message.GetDspRequest; import org.eclipse.edc.protocol.dsp.spi.message.PostDspRequest; -import org.eclipse.edc.service.spi.result.ServiceResult; import org.eclipse.edc.spi.iam.ClaimToken; import org.eclipse.edc.spi.iam.IdentityService; import org.eclipse.edc.spi.result.Result; +import org.eclipse.edc.spi.result.ServiceResult; import org.eclipse.edc.spi.types.domain.message.ProcessRemoteMessage; import org.eclipse.edc.transform.spi.TypeTransformerRegistry; import org.eclipse.edc.validator.spi.JsonObjectValidatorRegistry; diff --git a/data-protocols/dsp/dsp-http-spi/build.gradle.kts b/data-protocols/dsp/dsp-http-spi/build.gradle.kts index 01d09872835..6d16371ca6a 100644 --- a/data-protocols/dsp/dsp-http-spi/build.gradle.kts +++ b/data-protocols/dsp/dsp-http-spi/build.gradle.kts @@ -18,7 +18,6 @@ plugins { } dependencies { - api(project(":spi:common:aggregate-service-spi")) api(project(":spi:common:core-spi")) api(libs.okhttp) diff --git a/data-protocols/dsp/dsp-http-spi/src/main/java/org/eclipse/edc/protocol/dsp/spi/message/DspRequest.java b/data-protocols/dsp/dsp-http-spi/src/main/java/org/eclipse/edc/protocol/dsp/spi/message/DspRequest.java index a8df29a0fdf..042d50c6368 100644 --- a/data-protocols/dsp/dsp-http-spi/src/main/java/org/eclipse/edc/protocol/dsp/spi/message/DspRequest.java +++ b/data-protocols/dsp/dsp-http-spi/src/main/java/org/eclipse/edc/protocol/dsp/spi/message/DspRequest.java @@ -14,8 +14,8 @@ package org.eclipse.edc.protocol.dsp.spi.message; -import org.eclipse.edc.service.spi.result.ServiceResult; import org.eclipse.edc.spi.iam.ClaimToken; +import org.eclipse.edc.spi.result.ServiceResult; import java.util.function.BiFunction; diff --git a/data-protocols/dsp/dsp-negotiation/dsp-negotiation-api/src/main/java/org/eclipse/edc/protocol/dsp/negotiation/api/controller/DspNegotiationApiController.java b/data-protocols/dsp/dsp-negotiation/dsp-negotiation-api/src/main/java/org/eclipse/edc/protocol/dsp/negotiation/api/controller/DspNegotiationApiController.java index 41018788e2e..7f3a1cf6344 100644 --- a/data-protocols/dsp/dsp-negotiation/dsp-negotiation-api/src/main/java/org/eclipse/edc/protocol/dsp/negotiation/api/controller/DspNegotiationApiController.java +++ b/data-protocols/dsp/dsp-negotiation/dsp-negotiation-api/src/main/java/org/eclipse/edc/protocol/dsp/negotiation/api/controller/DspNegotiationApiController.java @@ -35,9 +35,9 @@ import org.eclipse.edc.protocol.dsp.spi.message.DspRequestHandler; import org.eclipse.edc.protocol.dsp.spi.message.GetDspRequest; import org.eclipse.edc.protocol.dsp.spi.message.PostDspRequest; -import org.eclipse.edc.service.spi.result.ServiceResult; import org.eclipse.edc.spi.iam.ClaimToken; import org.eclipse.edc.spi.monitor.Monitor; +import org.eclipse.edc.spi.result.ServiceResult; import org.eclipse.edc.transform.spi.TypeTransformerRegistry; import org.eclipse.edc.web.spi.exception.InvalidRequestException; import org.jetbrains.annotations.NotNull; diff --git a/extensions/common/api/api-core/build.gradle.kts b/extensions/common/api/api-core/build.gradle.kts index 991ee88196f..dcfbc3459d9 100644 --- a/extensions/common/api/api-core/build.gradle.kts +++ b/extensions/common/api/api-core/build.gradle.kts @@ -18,7 +18,6 @@ plugins { dependencies { api(project(":spi:common:auth-spi")) - api(project(":spi:common:aggregate-service-spi")) api(project(":spi:common:transform-spi")) api(project(":spi:common:web-spi")) api(project(":spi:common:json-ld-spi")) diff --git a/extensions/common/iam/identity-trust/identity-trust-sts-core/src/main/java/org/eclipse/edc/iam/identitytrust/sts/core/defaults/service/StsClientServiceImpl.java b/extensions/common/iam/identity-trust/identity-trust-sts-core/src/main/java/org/eclipse/edc/iam/identitytrust/sts/core/defaults/service/StsClientServiceImpl.java index 1bb872f9896..2cea23fb80a 100644 --- a/extensions/common/iam/identity-trust/identity-trust-sts-core/src/main/java/org/eclipse/edc/iam/identitytrust/sts/core/defaults/service/StsClientServiceImpl.java +++ b/extensions/common/iam/identity-trust/identity-trust-sts-core/src/main/java/org/eclipse/edc/iam/identitytrust/sts/core/defaults/service/StsClientServiceImpl.java @@ -17,7 +17,7 @@ import org.eclipse.edc.iam.identitytrust.sts.model.StsClient; import org.eclipse.edc.iam.identitytrust.sts.service.StsClientService; import org.eclipse.edc.iam.identitytrust.sts.store.StsClientStore; -import org.eclipse.edc.service.spi.result.ServiceResult; +import org.eclipse.edc.spi.result.ServiceResult; import org.eclipse.edc.spi.security.Vault; import org.eclipse.edc.transaction.spi.TransactionContext; diff --git a/extensions/common/iam/identity-trust/identity-trust-sts-core/src/main/java/org/eclipse/edc/iam/identitytrust/sts/core/defaults/service/StsClientTokenGeneratorServiceImpl.java b/extensions/common/iam/identity-trust/identity-trust-sts-core/src/main/java/org/eclipse/edc/iam/identitytrust/sts/core/defaults/service/StsClientTokenGeneratorServiceImpl.java index 6f5109f1874..68bcd584e30 100644 --- a/extensions/common/iam/identity-trust/identity-trust-sts-core/src/main/java/org/eclipse/edc/iam/identitytrust/sts/core/defaults/service/StsClientTokenGeneratorServiceImpl.java +++ b/extensions/common/iam/identity-trust/identity-trust-sts-core/src/main/java/org/eclipse/edc/iam/identitytrust/sts/core/defaults/service/StsClientTokenGeneratorServiceImpl.java @@ -19,8 +19,8 @@ import org.eclipse.edc.iam.identitytrust.sts.model.StsClientTokenAdditionalParams; import org.eclipse.edc.iam.identitytrust.sts.service.StsClientTokenGeneratorService; import org.eclipse.edc.iam.identitytrust.sts.service.StsTokenGenerationProvider; -import org.eclipse.edc.service.spi.result.ServiceResult; import org.eclipse.edc.spi.iam.TokenRepresentation; +import org.eclipse.edc.spi.result.ServiceResult; import java.time.Clock; import java.util.Map; diff --git a/extensions/common/iam/identity-trust/identity-trust-sts-core/src/test/java/org/eclipse/edc/iam/identitytrust/sts/core/defaults/service/StsClientTokenGeneratorServiceImplTest.java b/extensions/common/iam/identity-trust/identity-trust-sts-core/src/test/java/org/eclipse/edc/iam/identitytrust/sts/core/defaults/service/StsClientTokenGeneratorServiceImplTest.java index cab0afcaa65..58862cdc66f 100644 --- a/extensions/common/iam/identity-trust/identity-trust-sts-core/src/test/java/org/eclipse/edc/iam/identitytrust/sts/core/defaults/service/StsClientTokenGeneratorServiceImplTest.java +++ b/extensions/common/iam/identity-trust/identity-trust-sts-core/src/test/java/org/eclipse/edc/iam/identitytrust/sts/core/defaults/service/StsClientTokenGeneratorServiceImplTest.java @@ -18,9 +18,9 @@ import org.eclipse.edc.iam.identitytrust.sts.model.StsClientTokenAdditionalParams; import org.eclipse.edc.iam.identitytrust.sts.service.StsTokenGenerationProvider; import org.eclipse.edc.jwt.spi.TokenGenerationService; -import org.eclipse.edc.service.spi.result.ServiceFailure; import org.eclipse.edc.spi.iam.TokenRepresentation; import org.eclipse.edc.spi.result.Result; +import org.eclipse.edc.spi.result.ServiceFailure; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/extensions/common/iam/identity-trust/identity-trust-sts/identity-trust-sts-api/src/main/java/org/eclipse/edc/connector/api/sts/exception/StsTokenException.java b/extensions/common/iam/identity-trust/identity-trust-sts/identity-trust-sts-api/src/main/java/org/eclipse/edc/connector/api/sts/exception/StsTokenException.java index 1807f0c9613..c90b059471f 100644 --- a/extensions/common/iam/identity-trust/identity-trust-sts/identity-trust-sts-api/src/main/java/org/eclipse/edc/connector/api/sts/exception/StsTokenException.java +++ b/extensions/common/iam/identity-trust/identity-trust-sts/identity-trust-sts-api/src/main/java/org/eclipse/edc/connector/api/sts/exception/StsTokenException.java @@ -15,8 +15,8 @@ package org.eclipse.edc.connector.api.sts.exception; import org.eclipse.edc.connector.api.sts.model.StsTokenErrorResponse; -import org.eclipse.edc.service.spi.result.ServiceFailure; import org.eclipse.edc.spi.EdcException; +import org.eclipse.edc.spi.result.ServiceFailure; import org.eclipse.edc.validator.spi.ValidationFailure; import org.jetbrains.annotations.Nullable; diff --git a/extensions/common/iam/identity-trust/identity-trust-sts/identity-trust-sts-api/src/main/java/org/eclipse/edc/connector/api/sts/exception/StsTokenExceptionMapper.java b/extensions/common/iam/identity-trust/identity-trust-sts/identity-trust-sts-api/src/main/java/org/eclipse/edc/connector/api/sts/exception/StsTokenExceptionMapper.java index 594d6d0ac11..392cb55b7af 100644 --- a/extensions/common/iam/identity-trust/identity-trust-sts/identity-trust-sts-api/src/main/java/org/eclipse/edc/connector/api/sts/exception/StsTokenExceptionMapper.java +++ b/extensions/common/iam/identity-trust/identity-trust-sts/identity-trust-sts-api/src/main/java/org/eclipse/edc/connector/api/sts/exception/StsTokenExceptionMapper.java @@ -18,15 +18,15 @@ import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper; import org.eclipse.edc.connector.api.sts.model.StsTokenErrorResponse; -import org.eclipse.edc.service.spi.result.ServiceFailure; +import org.eclipse.edc.spi.result.ServiceFailure; import java.util.Map; import static jakarta.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR; -import static org.eclipse.edc.service.spi.result.ServiceFailure.Reason.BAD_REQUEST; -import static org.eclipse.edc.service.spi.result.ServiceFailure.Reason.CONFLICT; -import static org.eclipse.edc.service.spi.result.ServiceFailure.Reason.NOT_FOUND; -import static org.eclipse.edc.service.spi.result.ServiceFailure.Reason.UNAUTHORIZED; +import static org.eclipse.edc.spi.result.ServiceFailure.Reason.BAD_REQUEST; +import static org.eclipse.edc.spi.result.ServiceFailure.Reason.CONFLICT; +import static org.eclipse.edc.spi.result.ServiceFailure.Reason.NOT_FOUND; +import static org.eclipse.edc.spi.result.ServiceFailure.Reason.UNAUTHORIZED; /** * Exception mapper that catches the `StsTokenException` exception, map it to a response code with a detailed response body diff --git a/extensions/common/iam/identity-trust/identity-trust-sts/identity-trust-sts-api/src/test/java/org/eclipse/edc/connector/api/sts/controller/SecureServiceTokenApiControllerTest.java b/extensions/common/iam/identity-trust/identity-trust-sts/identity-trust-sts-api/src/test/java/org/eclipse/edc/connector/api/sts/controller/SecureServiceTokenApiControllerTest.java index 2849afa50c9..562db0d9c5c 100644 --- a/extensions/common/iam/identity-trust/identity-trust-sts/identity-trust-sts-api/src/test/java/org/eclipse/edc/connector/api/sts/controller/SecureServiceTokenApiControllerTest.java +++ b/extensions/common/iam/identity-trust/identity-trust-sts/identity-trust-sts-api/src/test/java/org/eclipse/edc/connector/api/sts/controller/SecureServiceTokenApiControllerTest.java @@ -21,8 +21,8 @@ import org.eclipse.edc.iam.identitytrust.sts.service.StsClientService; import org.eclipse.edc.iam.identitytrust.sts.service.StsClientTokenGeneratorService; import org.eclipse.edc.junit.annotations.ApiTest; -import org.eclipse.edc.service.spi.result.ServiceResult; import org.eclipse.edc.spi.iam.TokenRepresentation; +import org.eclipse.edc.spi.result.ServiceResult; import org.eclipse.edc.validator.spi.ValidationResult; import org.eclipse.edc.validator.spi.Validator; import org.eclipse.edc.web.jersey.testfixtures.RestControllerTestBase; @@ -153,4 +153,4 @@ private RequestSpecification baseRequest() { .baseUri("http://localhost:" + port) .when(); } -} \ No newline at end of file +} diff --git a/extensions/control-plane/api/control-plane-api/src/test/java/org/eclipse/edc/connector/api/transferprocess/TransferProcessControlApiControllerTest.java b/extensions/control-plane/api/control-plane-api/src/test/java/org/eclipse/edc/connector/api/transferprocess/TransferProcessControlApiControllerTest.java index 2e6ffe1b388..1ef670fb7e9 100644 --- a/extensions/control-plane/api/control-plane-api/src/test/java/org/eclipse/edc/connector/api/transferprocess/TransferProcessControlApiControllerTest.java +++ b/extensions/control-plane/api/control-plane-api/src/test/java/org/eclipse/edc/connector/api/transferprocess/TransferProcessControlApiControllerTest.java @@ -18,7 +18,7 @@ import org.eclipse.edc.connector.spi.transferprocess.TransferProcessService; import org.eclipse.edc.connector.transfer.spi.types.command.TerminateTransferCommand; import org.eclipse.edc.junit.annotations.ApiTest; -import org.eclipse.edc.service.spi.result.ServiceResult; +import org.eclipse.edc.spi.result.ServiceResult; import org.eclipse.edc.web.jersey.testfixtures.RestControllerTestBase; import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; @@ -58,7 +58,7 @@ void fail() { "errorMessage": "testError" } """; - + when(transferProcessService.terminate(any())).thenReturn(ServiceResult.success()); baseRequest() .contentType(JSON) diff --git a/extensions/control-plane/api/management-api/asset-api/src/test/java/org/eclipse/edc/connector/api/management/asset/v3/AssetApiControllerTest.java b/extensions/control-plane/api/management-api/asset-api/src/test/java/org/eclipse/edc/connector/api/management/asset/v3/AssetApiControllerTest.java index 137f7bda2d1..783c151a5d6 100644 --- a/extensions/control-plane/api/management-api/asset-api/src/test/java/org/eclipse/edc/connector/api/management/asset/v3/AssetApiControllerTest.java +++ b/extensions/control-plane/api/management-api/asset-api/src/test/java/org/eclipse/edc/connector/api/management/asset/v3/AssetApiControllerTest.java @@ -20,9 +20,9 @@ import org.eclipse.edc.api.model.IdResponse; import org.eclipse.edc.connector.spi.asset.AssetService; import org.eclipse.edc.junit.annotations.ApiTest; -import org.eclipse.edc.service.spi.result.ServiceResult; 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.DataAddress; import org.eclipse.edc.spi.types.domain.asset.Asset; import org.eclipse.edc.transform.spi.TypeTransformerRegistry; 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 31bfa603f90..12837c02f74 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 @@ -22,9 +22,9 @@ import org.eclipse.edc.connector.spi.contractagreement.ContractAgreementService; import org.eclipse.edc.junit.annotations.ApiTest; import org.eclipse.edc.policy.model.Policy; -import org.eclipse.edc.service.spi.result.ServiceResult; 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.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-definition-api/src/test/java/org/eclipse/edc/connector/api/management/contractdefinition/ContractDefinitionApiControllerTest.java b/extensions/control-plane/api/management-api/contract-definition-api/src/test/java/org/eclipse/edc/connector/api/management/contractdefinition/ContractDefinitionApiControllerTest.java index 6c69d429421..0d24c68a767 100644 --- a/extensions/control-plane/api/management-api/contract-definition-api/src/test/java/org/eclipse/edc/connector/api/management/contractdefinition/ContractDefinitionApiControllerTest.java +++ b/extensions/control-plane/api/management-api/contract-definition-api/src/test/java/org/eclipse/edc/connector/api/management/contractdefinition/ContractDefinitionApiControllerTest.java @@ -23,9 +23,9 @@ import org.eclipse.edc.connector.contract.spi.types.offer.ContractDefinition; import org.eclipse.edc.connector.spi.contractdefinition.ContractDefinitionService; import org.eclipse.edc.junit.annotations.ApiTest; -import org.eclipse.edc.service.spi.result.ServiceResult; 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.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/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 e9aaca9c342..7e27736cfac 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 @@ -29,9 +29,9 @@ 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.service.spi.result.ServiceResult; 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.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/policy-definition-api/src/test/java/org/eclipse/edc/connector/api/management/policy/PolicyDefinitionApiControllerTest.java b/extensions/control-plane/api/management-api/policy-definition-api/src/test/java/org/eclipse/edc/connector/api/management/policy/PolicyDefinitionApiControllerTest.java index e9715e42959..4c0aef11835 100644 --- a/extensions/control-plane/api/management-api/policy-definition-api/src/test/java/org/eclipse/edc/connector/api/management/policy/PolicyDefinitionApiControllerTest.java +++ b/extensions/control-plane/api/management-api/policy-definition-api/src/test/java/org/eclipse/edc/connector/api/management/policy/PolicyDefinitionApiControllerTest.java @@ -21,9 +21,9 @@ import org.eclipse.edc.connector.spi.policydefinition.PolicyDefinitionService; import org.eclipse.edc.junit.annotations.ApiTest; import org.eclipse.edc.policy.model.Policy; -import org.eclipse.edc.service.spi.result.ServiceResult; 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.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/transfer-process-api/src/test/java/org/eclipse/edc/connector/api/management/transferprocess/TransferProcessApiControllerTest.java b/extensions/control-plane/api/management-api/transfer-process-api/src/test/java/org/eclipse/edc/connector/api/management/transferprocess/TransferProcessApiControllerTest.java index aee05feb040..0e18b76cacf 100644 --- a/extensions/control-plane/api/management-api/transfer-process-api/src/test/java/org/eclipse/edc/connector/api/management/transferprocess/TransferProcessApiControllerTest.java +++ b/extensions/control-plane/api/management-api/transfer-process-api/src/test/java/org/eclipse/edc/connector/api/management/transferprocess/TransferProcessApiControllerTest.java @@ -23,9 +23,9 @@ import org.eclipse.edc.connector.transfer.spi.types.TransferRequest; import org.eclipse.edc.connector.transfer.spi.types.command.TerminateTransferCommand; import org.eclipse.edc.junit.annotations.ApiTest; -import org.eclipse.edc.service.spi.result.ServiceResult; 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.transform.spi.TypeTransformerRegistry; import org.eclipse.edc.validator.spi.JsonObjectValidatorRegistry; import org.eclipse.edc.validator.spi.ValidationResult; diff --git a/extensions/control-plane/provision/provision-http/src/test/java/org/eclipse/edc/connector/provision/http/webhook/HttpProvisionerWebhookApiControllerTest.java b/extensions/control-plane/provision/provision-http/src/test/java/org/eclipse/edc/connector/provision/http/webhook/HttpProvisionerWebhookApiControllerTest.java index cd8acfa0e32..cab7b1fde78 100644 --- a/extensions/control-plane/provision/provision-http/src/test/java/org/eclipse/edc/connector/provision/http/webhook/HttpProvisionerWebhookApiControllerTest.java +++ b/extensions/control-plane/provision/provision-http/src/test/java/org/eclipse/edc/connector/provision/http/webhook/HttpProvisionerWebhookApiControllerTest.java @@ -18,7 +18,7 @@ import org.eclipse.edc.connector.spi.transferprocess.TransferProcessService; import org.eclipse.edc.connector.transfer.spi.types.DeprovisionedResource; import org.eclipse.edc.junit.annotations.ApiTest; -import org.eclipse.edc.service.spi.result.ServiceResult; +import org.eclipse.edc.spi.result.ServiceResult; import org.eclipse.edc.spi.types.domain.DataAddress; import org.eclipse.edc.web.jersey.testfixtures.RestControllerTestBase; import org.junit.jupiter.api.Test; diff --git a/extensions/data-plane-selector/data-plane-selector-api/build.gradle.kts b/extensions/data-plane-selector/data-plane-selector-api/build.gradle.kts index 47c4f8c41b0..91391e08c1f 100644 --- a/extensions/data-plane-selector/data-plane-selector-api/build.gradle.kts +++ b/extensions/data-plane-selector/data-plane-selector-api/build.gradle.kts @@ -20,7 +20,6 @@ plugins { dependencies { api(project(":spi:common:core-spi")) api(project(":spi:data-plane-selector:data-plane-selector-spi")) - api(project(":spi:common:aggregate-service-spi")) implementation(project(":core:common:util")) implementation(project(":extensions:common:json-ld")) implementation(project(":extensions:common:api:management-api-configuration")) diff --git a/settings.gradle.kts b/settings.gradle.kts index 98cc102f9ec..9209006293e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -189,7 +189,6 @@ include(":launchers:dpf-selector") include(":launchers:sts-server") // extension points for a connector ---------------------------------------------------------------- -include(":spi:common:aggregate-service-spi") include(":spi:common:auth-spi") include(":spi:common:catalog-spi") include(":spi:common:core-spi") diff --git a/spi/common/aggregate-service-spi/build.gradle.kts b/spi/common/aggregate-service-spi/build.gradle.kts deleted file mode 100644 index 25aad7bbe9d..00000000000 --- a/spi/common/aggregate-service-spi/build.gradle.kts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - * - * Contributors: - * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial implementation - * - */ - -plugins { - `java-library` - `maven-publish` -} - -dependencies { - api(project(":spi:common:core-spi")) -} - - diff --git a/spi/common/aggregate-service-spi/src/main/java/org/eclipse/edc/service/spi/result/ServiceFailure.java b/spi/common/core-spi/src/main/java/org/eclipse/edc/spi/result/ServiceFailure.java similarity index 89% rename from spi/common/aggregate-service-spi/src/main/java/org/eclipse/edc/service/spi/result/ServiceFailure.java rename to spi/common/core-spi/src/main/java/org/eclipse/edc/spi/result/ServiceFailure.java index d032bbf7577..87ff49ce242 100644 --- a/spi/common/aggregate-service-spi/src/main/java/org/eclipse/edc/service/spi/result/ServiceFailure.java +++ b/spi/common/core-spi/src/main/java/org/eclipse/edc/spi/result/ServiceFailure.java @@ -12,12 +12,13 @@ * */ -package org.eclipse.edc.service.spi.result; - -import org.eclipse.edc.spi.result.Failure; +package org.eclipse.edc.spi.result; import java.util.List; +/** + * A failure encountered during a service invocation. + */ public class ServiceFailure extends Failure { private final Reason reason; diff --git a/spi/common/aggregate-service-spi/src/main/java/org/eclipse/edc/service/spi/result/ServiceResult.java b/spi/common/core-spi/src/main/java/org/eclipse/edc/spi/result/ServiceResult.java similarity index 88% rename from spi/common/aggregate-service-spi/src/main/java/org/eclipse/edc/service/spi/result/ServiceResult.java rename to spi/common/core-spi/src/main/java/org/eclipse/edc/spi/result/ServiceResult.java index d9a3f7a0a02..f5e800ed47a 100644 --- a/spi/common/aggregate-service-spi/src/main/java/org/eclipse/edc/service/spi/result/ServiceResult.java +++ b/spi/common/core-spi/src/main/java/org/eclipse/edc/spi/result/ServiceResult.java @@ -12,21 +12,22 @@ * */ -package org.eclipse.edc.service.spi.result; +package org.eclipse.edc.spi.result; import org.eclipse.edc.spi.command.CommandResult; -import org.eclipse.edc.spi.result.AbstractResult; -import org.eclipse.edc.spi.result.StoreResult; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.List; -import static org.eclipse.edc.service.spi.result.ServiceFailure.Reason.BAD_REQUEST; -import static org.eclipse.edc.service.spi.result.ServiceFailure.Reason.CONFLICT; -import static org.eclipse.edc.service.spi.result.ServiceFailure.Reason.NOT_FOUND; -import static org.eclipse.edc.service.spi.result.ServiceFailure.Reason.UNAUTHORIZED; +import static org.eclipse.edc.spi.result.ServiceFailure.Reason.BAD_REQUEST; +import static org.eclipse.edc.spi.result.ServiceFailure.Reason.CONFLICT; +import static org.eclipse.edc.spi.result.ServiceFailure.Reason.NOT_FOUND; +import static org.eclipse.edc.spi.result.ServiceFailure.Reason.UNAUTHORIZED; +/** + * Result type for a service invocation. + */ public class ServiceResult extends AbstractResult> { protected ServiceResult(T content, ServiceFailure failure) { diff --git a/spi/common/aggregate-service-spi/src/test/java/org/eclipse/edc/service/spi/result/ServiceResultTest.java b/spi/common/core-spi/src/test/java/org/eclipse/edc/spi/result/ServiceResultTest.java similarity index 84% rename from spi/common/aggregate-service-spi/src/test/java/org/eclipse/edc/service/spi/result/ServiceResultTest.java rename to spi/common/core-spi/src/test/java/org/eclipse/edc/spi/result/ServiceResultTest.java index 33d3b3c93cc..62042d7fb77 100644 --- a/spi/common/aggregate-service-spi/src/test/java/org/eclipse/edc/service/spi/result/ServiceResultTest.java +++ b/spi/common/core-spi/src/test/java/org/eclipse/edc/spi/result/ServiceResultTest.java @@ -12,15 +12,14 @@ * */ -package org.eclipse.edc.service.spi.result; +package org.eclipse.edc.spi.result; -import org.eclipse.edc.spi.result.StoreResult; import org.junit.jupiter.api.Test; import static org.assertj.core.api.AssertionsForClassTypes.assertThat; import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy; -import static org.eclipse.edc.service.spi.result.ServiceFailure.Reason.CONFLICT; -import static org.eclipse.edc.service.spi.result.ServiceFailure.Reason.NOT_FOUND; +import static org.eclipse.edc.spi.result.ServiceFailure.Reason.CONFLICT; +import static org.eclipse.edc.spi.result.ServiceFailure.Reason.NOT_FOUND; class ServiceResultTest { @@ -41,4 +40,4 @@ void verifyFromStorageResult() { void fromFailure_withSuccessResult() { assertThatThrownBy(() -> ServiceResult.fromFailure(StoreResult.success())).isInstanceOf(IllegalArgumentException.class); } -} \ No newline at end of file +} diff --git a/spi/common/identity-trust-sts-spi/build.gradle.kts b/spi/common/identity-trust-sts-spi/build.gradle.kts index 63978eda6bf..9bae4b6e51c 100644 --- a/spi/common/identity-trust-sts-spi/build.gradle.kts +++ b/spi/common/identity-trust-sts-spi/build.gradle.kts @@ -20,7 +20,6 @@ plugins { dependencies { api(project(":spi:common:core-spi")) - api(project(":spi:common:aggregate-service-spi")) api(project(":spi:common:jwt-spi")) testFixturesImplementation(libs.bundles.jupiter) diff --git a/spi/common/identity-trust-sts-spi/src/main/java/org/eclipse/edc/iam/identitytrust/sts/service/StsClientService.java b/spi/common/identity-trust-sts-spi/src/main/java/org/eclipse/edc/iam/identitytrust/sts/service/StsClientService.java index 6a96eaac201..93bfc347dc3 100644 --- a/spi/common/identity-trust-sts-spi/src/main/java/org/eclipse/edc/iam/identitytrust/sts/service/StsClientService.java +++ b/spi/common/identity-trust-sts-spi/src/main/java/org/eclipse/edc/iam/identitytrust/sts/service/StsClientService.java @@ -16,7 +16,7 @@ import org.eclipse.edc.iam.identitytrust.sts.model.StsClient; import org.eclipse.edc.runtime.metamodel.annotation.ExtensionPoint; -import org.eclipse.edc.service.spi.result.ServiceResult; +import org.eclipse.edc.spi.result.ServiceResult; /** * Mediates access to, modification and authentication of {@link StsClient}s. diff --git a/spi/common/identity-trust-sts-spi/src/main/java/org/eclipse/edc/iam/identitytrust/sts/service/StsClientTokenGeneratorService.java b/spi/common/identity-trust-sts-spi/src/main/java/org/eclipse/edc/iam/identitytrust/sts/service/StsClientTokenGeneratorService.java index 72ad75a20b3..7f050a2991f 100644 --- a/spi/common/identity-trust-sts-spi/src/main/java/org/eclipse/edc/iam/identitytrust/sts/service/StsClientTokenGeneratorService.java +++ b/spi/common/identity-trust-sts-spi/src/main/java/org/eclipse/edc/iam/identitytrust/sts/service/StsClientTokenGeneratorService.java @@ -17,8 +17,8 @@ import org.eclipse.edc.iam.identitytrust.sts.model.StsClient; import org.eclipse.edc.iam.identitytrust.sts.model.StsClientTokenAdditionalParams; import org.eclipse.edc.runtime.metamodel.annotation.ExtensionPoint; -import org.eclipse.edc.service.spi.result.ServiceResult; import org.eclipse.edc.spi.iam.TokenRepresentation; +import org.eclipse.edc.spi.result.ServiceResult; /** * Self-Issued ID Token minting interface. diff --git a/spi/common/web-spi/build.gradle.kts b/spi/common/web-spi/build.gradle.kts index f3ce7bc38bb..66e8dce0775 100644 --- a/spi/common/web-spi/build.gradle.kts +++ b/spi/common/web-spi/build.gradle.kts @@ -19,7 +19,6 @@ plugins { dependencies { api(project(":spi:common:core-spi")) - api(project(":spi:common:aggregate-service-spi")) api(project(":spi:common:validator-spi")) api(libs.jakarta.rsApi) diff --git a/spi/common/web-spi/src/main/java/org/eclipse/edc/web/spi/exception/ServiceResultHandler.java b/spi/common/web-spi/src/main/java/org/eclipse/edc/web/spi/exception/ServiceResultHandler.java index e82ea965d08..94d072b2bac 100644 --- a/spi/common/web-spi/src/main/java/org/eclipse/edc/web/spi/exception/ServiceResultHandler.java +++ b/spi/common/web-spi/src/main/java/org/eclipse/edc/web/spi/exception/ServiceResultHandler.java @@ -14,9 +14,9 @@ package org.eclipse.edc.web.spi.exception; -import org.eclipse.edc.service.spi.result.ServiceFailure; -import org.eclipse.edc.service.spi.result.ServiceResult; import org.eclipse.edc.spi.EdcException; +import org.eclipse.edc.spi.result.ServiceFailure; +import org.eclipse.edc.spi.result.ServiceResult; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/spi/control-plane/control-plane-spi/build.gradle.kts b/spi/control-plane/control-plane-spi/build.gradle.kts index 4f271dd33ee..a5ec22f195e 100644 --- a/spi/control-plane/control-plane-spi/build.gradle.kts +++ b/spi/control-plane/control-plane-spi/build.gradle.kts @@ -19,7 +19,6 @@ plugins { dependencies { api(project(":spi:common:catalog-spi")) api(project(":spi:common:core-spi")) - api(project(":spi:common:aggregate-service-spi")) api(project(":spi:common:transaction-spi")) api(project(":spi:common:transform-spi")) api(project(":spi:common:web-spi")) diff --git a/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/asset/AssetService.java b/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/asset/AssetService.java index f094b644594..d6b4246b505 100644 --- a/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/asset/AssetService.java +++ b/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/asset/AssetService.java @@ -14,8 +14,8 @@ package org.eclipse.edc.connector.spi.asset; -import org.eclipse.edc.service.spi.result.ServiceResult; import org.eclipse.edc.spi.query.QuerySpec; +import org.eclipse.edc.spi.result.ServiceResult; import org.eclipse.edc.spi.types.domain.asset.Asset; import java.util.stream.Stream; diff --git a/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/catalog/CatalogProtocolService.java b/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/catalog/CatalogProtocolService.java index d031d3a5088..368accf99dd 100644 --- a/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/catalog/CatalogProtocolService.java +++ b/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/catalog/CatalogProtocolService.java @@ -17,8 +17,8 @@ import org.eclipse.edc.catalog.spi.Catalog; import org.eclipse.edc.catalog.spi.CatalogRequestMessage; import org.eclipse.edc.catalog.spi.Dataset; -import org.eclipse.edc.service.spi.result.ServiceResult; import org.eclipse.edc.spi.iam.ClaimToken; +import org.eclipse.edc.spi.result.ServiceResult; import org.jetbrains.annotations.NotNull; /** 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 735aa76f415..7c52e82a14b 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 @@ -16,8 +16,8 @@ import org.eclipse.edc.connector.contract.spi.types.agreement.ContractAgreement; import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiation; -import org.eclipse.edc.service.spi.result.ServiceResult; import org.eclipse.edc.spi.query.QuerySpec; +import org.eclipse.edc.spi.result.ServiceResult; import java.util.stream.Stream; diff --git a/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/contractdefinition/ContractDefinitionService.java b/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/contractdefinition/ContractDefinitionService.java index 2e4fd9da192..bc8027b4ff0 100644 --- a/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/contractdefinition/ContractDefinitionService.java +++ b/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/contractdefinition/ContractDefinitionService.java @@ -15,8 +15,8 @@ package org.eclipse.edc.connector.spi.contractdefinition; import org.eclipse.edc.connector.contract.spi.types.offer.ContractDefinition; -import org.eclipse.edc.service.spi.result.ServiceResult; import org.eclipse.edc.spi.query.QuerySpec; +import org.eclipse.edc.spi.result.ServiceResult; import java.util.stream.Stream; diff --git a/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/contractnegotiation/ContractNegotiationProtocolService.java b/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/contractnegotiation/ContractNegotiationProtocolService.java index 441ff2dceaa..4ed0c901333 100644 --- a/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/contractnegotiation/ContractNegotiationProtocolService.java +++ b/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/contractnegotiation/ContractNegotiationProtocolService.java @@ -21,8 +21,8 @@ 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.service.spi.result.ServiceResult; import org.eclipse.edc.spi.iam.ClaimToken; +import org.eclipse.edc.spi.result.ServiceResult; import org.jetbrains.annotations.NotNull; /** @@ -105,7 +105,7 @@ public interface ContractNegotiationProtocolService { */ @NotNull ServiceResult notifyTerminated(ContractNegotiationTerminationMessage message, ClaimToken claimToken); - + /** * Finds a contract negotiation that has been requested by the counter-part. An existing * negotiation, for which the counter-part is not authorized, is treated as non-existent. 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 0a304a11b2a..af8ee11d954 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 @@ -18,8 +18,8 @@ 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.service.spi.result.ServiceResult; import org.eclipse.edc.spi.query.QuerySpec; +import org.eclipse.edc.spi.result.ServiceResult; import java.util.stream.Stream; diff --git a/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/policydefinition/PolicyDefinitionService.java b/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/policydefinition/PolicyDefinitionService.java index 17670e1fc77..f38e90949e0 100644 --- a/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/policydefinition/PolicyDefinitionService.java +++ b/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/policydefinition/PolicyDefinitionService.java @@ -16,8 +16,8 @@ import org.eclipse.edc.connector.policy.spi.PolicyDefinition; import org.eclipse.edc.runtime.metamodel.annotation.ExtensionPoint; -import org.eclipse.edc.service.spi.result.ServiceResult; import org.eclipse.edc.spi.query.QuerySpec; +import org.eclipse.edc.spi.result.ServiceResult; import org.jetbrains.annotations.NotNull; import java.util.stream.Stream; diff --git a/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/transferprocess/TransferProcessProtocolService.java b/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/transferprocess/TransferProcessProtocolService.java index 34e557c07b5..5339f90c0b7 100644 --- a/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/transferprocess/TransferProcessProtocolService.java +++ b/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/transferprocess/TransferProcessProtocolService.java @@ -19,8 +19,8 @@ import org.eclipse.edc.connector.transfer.spi.types.protocol.TransferRequestMessage; import org.eclipse.edc.connector.transfer.spi.types.protocol.TransferStartMessage; import org.eclipse.edc.connector.transfer.spi.types.protocol.TransferTerminationMessage; -import org.eclipse.edc.service.spi.result.ServiceResult; import org.eclipse.edc.spi.iam.ClaimToken; +import org.eclipse.edc.spi.result.ServiceResult; import org.jetbrains.annotations.NotNull; /** @@ -67,7 +67,7 @@ public interface TransferProcessProtocolService { */ @NotNull ServiceResult notifyTerminated(TransferTerminationMessage message, ClaimToken claimToken); - + /** * Finds a transfer process that has been requested by the counter-part. An existing * process, for which the counter-part is not authorized, is treated as non-existent. diff --git a/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/transferprocess/TransferProcessService.java b/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/transferprocess/TransferProcessService.java index 007a5bfc832..b7205af33bc 100644 --- a/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/transferprocess/TransferProcessService.java +++ b/spi/control-plane/control-plane-spi/src/main/java/org/eclipse/edc/connector/spi/transferprocess/TransferProcessService.java @@ -20,8 +20,8 @@ import org.eclipse.edc.connector.transfer.spi.types.TransferProcess; import org.eclipse.edc.connector.transfer.spi.types.TransferRequest; import org.eclipse.edc.connector.transfer.spi.types.command.TerminateTransferCommand; -import org.eclipse.edc.service.spi.result.ServiceResult; import org.eclipse.edc.spi.query.QuerySpec; +import org.eclipse.edc.spi.result.ServiceResult; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/spi/data-plane-selector/data-plane-selector-spi/build.gradle.kts b/spi/data-plane-selector/data-plane-selector-spi/build.gradle.kts index 76c734baa5a..298a763c1cd 100644 --- a/spi/data-plane-selector/data-plane-selector-spi/build.gradle.kts +++ b/spi/data-plane-selector/data-plane-selector-spi/build.gradle.kts @@ -19,7 +19,6 @@ plugins { dependencies { api(project(":spi:common:core-spi")) - api(project(":spi:common:aggregate-service-spi")) implementation(project(":core:common:util")) diff --git a/spi/data-plane-selector/data-plane-selector-spi/src/main/java/org/eclipse/edc/connector/dataplane/selector/spi/DataPlaneSelectorService.java b/spi/data-plane-selector/data-plane-selector-spi/src/main/java/org/eclipse/edc/connector/dataplane/selector/spi/DataPlaneSelectorService.java index 329fd72e7a0..48f3c155d0a 100644 --- a/spi/data-plane-selector/data-plane-selector-spi/src/main/java/org/eclipse/edc/connector/dataplane/selector/spi/DataPlaneSelectorService.java +++ b/spi/data-plane-selector/data-plane-selector-spi/src/main/java/org/eclipse/edc/connector/dataplane/selector/spi/DataPlaneSelectorService.java @@ -16,7 +16,7 @@ import org.eclipse.edc.connector.dataplane.selector.spi.instance.DataPlaneInstance; import org.eclipse.edc.runtime.metamodel.annotation.ExtensionPoint; -import org.eclipse.edc.service.spi.result.ServiceResult; +import org.eclipse.edc.spi.result.ServiceResult; import org.eclipse.edc.spi.types.domain.DataAddress; import java.util.Collection;