Skip to content

Commit

Permalink
chore: fix compile issue after api context refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
wolf4ood committed Jun 4, 2024
1 parent 0ecd5d9 commit 876b61d
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 10 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ jobs:
run: |
./gradlew checkstyleMain checkstyleTest
verify-javadoc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-java

- name: Run Javadoc
run: ./gradlew javadoc

unit-tests:
runs-on: ubuntu-latest
steps:
Expand Down
1 change: 1 addition & 0 deletions edc-controlplane/edc-controlplane-base/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ dependencies {
runtimeOnly(libs.edc.api.management)
runtimeOnly(libs.edc.api.controlplane)
runtimeOnly(libs.edc.api.management.config)
runtimeOnly(libs.edc.api.control.config)
runtimeOnly(libs.edc.api.core)
runtimeOnly(libs.edc.api.observability)
runtimeOnly(libs.edc.dsp)
Expand Down
2 changes: 2 additions & 0 deletions edc-dataplane/edc-dataplane-base/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ dependencies {
runtimeOnly(libs.edc.dpf.api.control)
runtimeOnly(libs.edc.dpf.api.signaling)

runtimeOnly(libs.edc.api.control.config)
runtimeOnly(libs.edc.dpf.api.public.v2)
runtimeOnly(libs.edc.core.connector)
runtimeOnly(libs.edc.boot)
Expand All @@ -55,4 +56,5 @@ dependencies {
runtimeOnly(libs.bundles.edc.monitoring)
runtimeOnly(libs.edc.ext.http)
runtimeOnly(libs.edc.api.observability)
runtimeOnly(libs.edc.api.core)
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@

package org.eclipse.tractusx.edc.api.bpn;

import org.eclipse.edc.connector.api.management.configuration.ManagementApiConfiguration;
import org.eclipse.edc.jsonld.spi.JsonLd;
import org.eclipse.edc.runtime.metamodel.annotation.Extension;
import org.eclipse.edc.runtime.metamodel.annotation.Inject;
import org.eclipse.edc.spi.system.ServiceExtension;
import org.eclipse.edc.spi.system.ServiceExtensionContext;
import org.eclipse.edc.web.spi.WebService;
import org.eclipse.edc.web.spi.configuration.ApiContext;
import org.eclipse.tractusx.edc.validation.businesspartner.spi.BusinessPartnerStore;

import static org.eclipse.tractusx.edc.edr.spi.CoreConstants.TX_NAMESPACE;
Expand All @@ -37,8 +37,6 @@ public class BusinessPartnerGroupApiExtension implements ServiceExtension {
@Inject
private WebService webService;
@Inject
private ManagementApiConfiguration apiConfiguration;
@Inject
private JsonLd jsonLdService;
@Inject
private BusinessPartnerStore businessPartnerStore;
Expand All @@ -47,7 +45,7 @@ public class BusinessPartnerGroupApiExtension implements ServiceExtension {
public void initialize(ServiceExtensionContext context) {
jsonLdService.registerNamespace(TX_PREFIX, TX_NAMESPACE);

webService.registerResource(apiConfiguration.getContextAlias(), new BusinessPartnerGroupApiController(businessPartnerStore));
webService.registerResource(ApiContext.MANAGEMENT, new BusinessPartnerGroupApiController(businessPartnerStore));

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@ public String name() {
@Override
public void initialize(ServiceExtensionContext context) {
var port = propertyCompatibility(context, CONSUMER_PORT, CONSUMER_PORT_DEPRECATED, DEFAULT_PROXY_PORT);
var config = context.getConfig(CONSUMER_CONFIG_KEY);

configurer.configure(context, webServer, createApiContext(port));
configurer.configure(config, webServer, createApiContext(port));

var poolSize = propertyCompatibility(context, THREAD_POOL_SIZE, THREAD_POOL_SIZE_DEPRECATED, DEFAULT_THREAD_POOL);
executorService = newFixedThreadPool(poolSize);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import java.util.Objects;

/**
* This is a carbon-copy of the {@link org.eclipse.edc.api.auth.token.TokenBasedAuthenticationService}.
* This is a carbon-copy of the upstream EDC org.eclipse.edc.api.auth.token.TokenBasedAuthenticationService.
*
* @deprecated this is a shim that we need to use until upstream EDC has made the TokenBasedAuthenticationService available for standalone use.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package org.eclipse.tractusx.edc.api.edr.v2;

import jakarta.json.Json;
import org.eclipse.edc.connector.api.management.configuration.ManagementApiConfiguration;
import org.eclipse.edc.connector.controlplane.services.spi.contractnegotiation.ContractNegotiationService;
import org.eclipse.edc.edr.spi.store.EndpointDataReferenceStore;
import org.eclipse.edc.jsonld.spi.JsonLd;
Expand All @@ -31,6 +30,7 @@
import org.eclipse.edc.transform.spi.TypeTransformerRegistry;
import org.eclipse.edc.validator.spi.JsonObjectValidatorRegistry;
import org.eclipse.edc.web.spi.WebService;
import org.eclipse.edc.web.spi.configuration.ApiContext;
import org.eclipse.tractusx.edc.api.edr.v2.transform.JsonObjectFromEndpointDataReferenceEntryTransformer;
import org.eclipse.tractusx.edc.edr.spi.service.EdrService;

Expand All @@ -43,8 +43,6 @@ public class EdrCacheApiExtension implements ServiceExtension {

@Inject
private WebService webService;
@Inject
private ManagementApiConfiguration apiConfig;

@Inject
private EdrService edrService;
Expand All @@ -71,6 +69,6 @@ public void initialize(ServiceExtensionContext context) {
jsonLdService.registerNamespace(TX_PREFIX, TX_NAMESPACE);
var mgmtApiTransformerRegistry = transformerRegistry.forContext("management-api");
mgmtApiTransformerRegistry.register(new JsonObjectFromEndpointDataReferenceEntryTransformer(Json.createBuilderFactory(Map.of())));
webService.registerResource(apiConfig.getContextAlias(), new EdrCacheApiController(edrStore, mgmtApiTransformerRegistry, validatorRegistry, monitor, edrService, contractNegotiationService));
webService.registerResource(ApiContext.MANAGEMENT, new EdrCacheApiController(edrStore, mgmtApiTransformerRegistry, validatorRegistry, monitor, edrService, contractNegotiationService));
}
}
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ edc-core-edrstore = { module = "org.eclipse.edc:edr-store-core", version.ref = "
edc-controlplane-callback-staticendpoint = { module = "org.eclipse.edc:callback-static-endpoint", version.ref = "edc" }
edc-junit = { module = "org.eclipse.edc:junit", version.ref = "edc" }
edc-api-management-config = { module = "org.eclipse.edc:management-api-configuration", version.ref = "edc" }
edc-api-control-config = { module = "org.eclipse.edc:control-api-configuration", version.ref = "edc" }
edc-api-management = { module = "org.eclipse.edc:management-api", version.ref = "edc" }
edc-api-core = { module = "org.eclipse.edc:api-core", version.ref = "edc" }
edc-api-management-test-fixtures = { module = "org.eclipse.edc:management-api-test-fixtures", version.ref = "edc" }
Expand Down

0 comments on commit 876b61d

Please sign in to comment.