Skip to content

Commit

Permalink
Fix some compilation problems
Browse files Browse the repository at this point in the history
  • Loading branch information
ununhexium committed Oct 10, 2024
1 parent 8fe9ca5 commit 7b9a2ea
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 31 deletions.
4 changes: 2 additions & 2 deletions docs/api/sovity-edc-api-wrapper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -623,11 +623,11 @@ components:
DataSourceType:
type: string
description: Supported Data Source Types by UiDataSource
default: CUSTOM
enum:
- HTTP_DATA
- ON_REQUEST
- CUSTOM
default: CUSTOM
SecretValue:
type: object
properties:
Expand Down Expand Up @@ -835,14 +835,14 @@ components:
UiDataSourceHttpDataMethod:
type: string
description: Supported HTTP Methods by UiDataSource
default: GET
enum:
- GET
- POST
- PUT
- PATCH
- DELETE
- OPTIONS
default: GET
UiDataSourceOnRequest:
required:
- contactEmail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import de.sovity.edc.extension.messenger.SovityMessengerRegistry;
import de.sovity.edc.utils.config.ConfigProps;
import lombok.val;
import org.eclipse.edc.connector.transfer.spi.observe.TransferProcessObservable;
import org.eclipse.edc.connector.controlplane.transfer.spi.observe.TransferProcessObservable;
import org.eclipse.edc.runtime.metamodel.annotation.Inject;
import org.eclipse.edc.runtime.metamodel.annotation.Provides;
import org.eclipse.edc.spi.agent.ParticipantAgentService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ interface UiResource {
@Path("pages/catalog-page/data-offers")
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Fetch a connector's data offers")
List<UiDataOffer> getCatalogPageDataOffers(@QueryParam("connectorEndpoint") String connectorEndpoint);
// TODO: request it from the UI or add a workaround here?
List<UiDataOffer> getCatalogPageDataOffers(@QueryParam("participantId") String participantId, @QueryParam("connectorEndpoint") String connectorEndpoint);

@POST
@Path("pages/catalog-page/contract-negotiations")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import de.sovity.edc.extension.contacttermination.ContractAgreementTerminationService;
import de.sovity.edc.extension.db.directaccess.DslContextFactory;
import org.eclipse.edc.connector.api.management.configuration.ManagementApiConfiguration;
import org.eclipse.edc.connector.api.management.configuration.transform.ManagementApiTypeTransformerRegistry;
import org.eclipse.edc.connector.controlplane.contract.spi.negotiation.store.ContractNegotiationStore;
import org.eclipse.edc.connector.controlplane.contract.spi.offer.store.ContractDefinitionStore;
import org.eclipse.edc.connector.controlplane.policy.spi.store.PolicyDefinitionStore;
Expand All @@ -34,14 +32,14 @@
import org.eclipse.edc.connector.controlplane.transfer.spi.store.TransferProcessStore;
import org.eclipse.edc.jsonld.spi.JsonLd;
import org.eclipse.edc.policy.engine.spi.PolicyEngine;
import org.eclipse.edc.protocol.dsp.api.configuration.DspApiConfiguration;
import org.eclipse.edc.runtime.metamodel.annotation.Inject;
import org.eclipse.edc.spi.CoreConstants;
import org.eclipse.edc.spi.constants.CoreConstants;
import org.eclipse.edc.connector.controlplane.asset.spi.index.AssetIndex;
import org.eclipse.edc.spi.system.ServiceExtension;
import org.eclipse.edc.spi.system.ServiceExtensionContext;
import org.eclipse.edc.spi.types.TypeManager;
import org.eclipse.edc.web.spi.WebService;
import org.eclipse.edc.web.spi.configuration.ApiContext;

public class WrapperExtension implements ServiceExtension {

Expand All @@ -66,10 +64,6 @@ public class WrapperExtension implements ServiceExtension {
@Inject
private DslContextFactory dslContextFactory;
@Inject
private DspApiConfiguration dspApiConfiguration;
@Inject
private ManagementApiConfiguration dataManagementApiConfiguration;
@Inject
private PolicyDefinitionStore policyDefinitionStore;
@Inject
private PolicyEngine policyEngine;
Expand All @@ -79,8 +73,9 @@ public class WrapperExtension implements ServiceExtension {
private TransferProcessStore transferProcessStore;
@Inject
private TypeManager typeManager;
@Inject
private ManagementApiTypeTransformerRegistry typeTransformerRegistry;
// TODO: was revomed, maybe replaced with ManagementApiTypeTransformerRegistryImpl between v0.5.1..v0.6.0
// @Inject
// private ManagementApiTypeTransformerRegistry typeTransformerRegistry;
@Inject
private WebService webService;
@Inject
Expand Down Expand Up @@ -120,14 +115,15 @@ public void initialize(ServiceExtensionContext context) {
policyEngine,
transferProcessService,
transferProcessStore,
typeTransformerRegistry
// TODO: what is the new value? is it necessary?
null
);

wrapperExtensionContext.managementApiResources().forEach(resource ->
webService.registerResource(dataManagementApiConfiguration.getContextAlias(), resource));
webService.registerResource(ApiContext.MANAGEMENT, resource));

wrapperExtensionContext.dspApiResources().forEach(resource ->
webService.registerResource(dspApiConfiguration.getContextAlias(), resource));
webService.registerResource(ApiContext.PROTOCOL, resource));
}

private void fixObjectMapperDateSerialization(ObjectMapper objectMapper) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,8 @@
package de.sovity.edc.ext.wrapper.api;

import jakarta.ws.rs.WebApplicationException;
import org.eclipse.edc.service.spi.result.ServiceResult;
import org.eclipse.edc.spi.result.Failure;

import java.util.function.Function;

/**
* Exception for handling {@link ServiceResult} {@link Failure}s.
*
* @see ServiceResult#orElseThrow(Function)
*/
public class ServiceException extends WebApplicationException {
public ServiceException(Failure failure) {
super(failure.getFailureDetail(), 500);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ public IdResponseDto createDataOffer(DataOfferCreationRequest dataOfferCreationR
}

@Override
public List<UiDataOffer> getCatalogPageDataOffers(String connectorEndpoint) {
return catalogApiService.fetchDataOffers(connectorEndpoint);
public List<UiDataOffer> getCatalogPageDataOffers(String participantId, String connectorEndpoint) {
return catalogApiService.fetchDataOffers(participantId, connectorEndpoint);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public class CatalogApiService {
private final UiDataOfferBuilder uiDataOfferBuilder;
private final DspCatalogService dspCatalogService;

public List<UiDataOffer> fetchDataOffers(String connectorEndpoint) {
var dspCatalog = dspCatalogService.fetchDataOffers(connectorEndpoint);
public List<UiDataOffer> fetchDataOffers(String participantId, String connectorEndpoint) {
var dspCatalog = dspCatalogService.fetchDataOffers(participantId, connectorEndpoint);
return uiDataOfferBuilder.buildUiDataOffers(dspCatalog);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import java.util.HashMap;
import java.util.Map;

import static org.eclipse.edc.spi.CoreConstants.EDC_NAMESPACE;
import static org.eclipse.edc.spi.constants.CoreConstants.EDC_NAMESPACE;

public class ParameterizationCompatibilityUtils {
private static final String WORKAROUND = "https://sovity.de/workaround/proxy/param/";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import java.util.List;

@NoArgsConstructor
@AllArgsConstructor
public class ParameterResolverList implements ParameterResolver {
private final List<ParameterResolver> resolvers = new ArrayList<>();

Expand Down

0 comments on commit 7b9a2ea

Please sign in to comment.