diff --git a/client/src/main/java/de/fraunhofer/iosb/client/dataTransfer/DataTransferController.java b/client/src/main/java/de/fraunhofer/iosb/client/dataTransfer/DataTransferController.java index 16dc896b..9592647d 100644 --- a/client/src/main/java/de/fraunhofer/iosb/client/dataTransfer/DataTransferController.java +++ b/client/src/main/java/de/fraunhofer/iosb/client/dataTransfer/DataTransferController.java @@ -43,7 +43,6 @@ public class DataTransferController { private final Config config; - private final DataTransferEndpoint dataTransferEndpoint; private final DataTransferObservable dataTransferObservable; private final TransferInitiator transferInitiator; @@ -56,7 +55,7 @@ public class DataTransferController { * @param config Read config value transfer timeout and * own URI * @param webService Register data transfer endpoint. - * @param dataEndpointAuthRequestFilter Creating and passing through custom api + * @param authenticationService Creating and passing through custom api * keys for each data transfer. * @param transferProcessManager Initiating a transfer process as a * consumer. @@ -69,7 +68,7 @@ public DataTransferController(Monitor monitor, Config config, WebService webServ authenticationService); this.dataTransferObservable = new DataTransferObservable(monitor); - this.dataTransferEndpoint = new DataTransferEndpoint(monitor, dataTransferObservable); + var dataTransferEndpoint = new DataTransferEndpoint(monitor, dataTransferObservable); webService.registerResource(dataTransferEndpoint); } diff --git a/client/src/main/java/de/fraunhofer/iosb/client/negotiation/Negotiator.java b/client/src/main/java/de/fraunhofer/iosb/client/negotiation/Negotiator.java index ae2018a2..fbf28e3c 100644 --- a/client/src/main/java/de/fraunhofer/iosb/client/negotiation/Negotiator.java +++ b/client/src/main/java/de/fraunhofer/iosb/client/negotiation/Negotiator.java @@ -56,8 +56,7 @@ public Negotiator(ConsumerContractNegotiationManager consumerNegotiationManager, * aborted by throwing an exception. This exception can be inspected using the * getCause() method. */ - StatusResult negotiate(ContractRequest contractRequest) - throws InterruptedException, ExecutionException { + StatusResult negotiate(ContractRequest contractRequest) { var previousAgreements = contractNegotiationStore.queryAgreements(QuerySpec.max()); var relevantAgreements = previousAgreements .filter(agreement -> agreement.getAssetId().equals(contractRequest.getContractOffer().getAssetId())) diff --git a/client/src/main/java/de/fraunhofer/iosb/client/policy/PolicyController.java b/client/src/main/java/de/fraunhofer/iosb/client/policy/PolicyController.java index 2d2bc448..dccf0cd1 100644 --- a/client/src/main/java/de/fraunhofer/iosb/client/policy/PolicyController.java +++ b/client/src/main/java/de/fraunhofer/iosb/client/policy/PolicyController.java @@ -36,17 +36,15 @@ public class PolicyController { - private final PolicyServiceConfig config; - private final PolicyDefinitionStore policyDefinitionStore; private final PolicyService policyService; public PolicyController(Monitor monitor, CatalogService catalogService, TypeTransformerRegistry typeTransformerRegistry, Config systemConfig) { - this.config = new PolicyServiceConfig(systemConfig); + var config = new PolicyServiceConfig(systemConfig); - this.policyDefinitionStore = new PolicyDefinitionStore(monitor, this.config.getAcceptedPolicyDefinitionsPath()); - this.policyService = new PolicyService(catalogService, typeTransformerRegistry, this.config, + this.policyDefinitionStore = new PolicyDefinitionStore(monitor, config.getAcceptedPolicyDefinitionsPath()); + this.policyService = new PolicyService(catalogService, typeTransformerRegistry, config, this.policyDefinitionStore, monitor); } diff --git a/client/src/test/java/de/fraunhofer/iosb/client/dataTransfer/TransferInitiatorTest.java b/client/src/test/java/de/fraunhofer/iosb/client/dataTransfer/TransferInitiatorTest.java index 488f1df6..75a65689 100644 --- a/client/src/test/java/de/fraunhofer/iosb/client/dataTransfer/TransferInitiatorTest.java +++ b/client/src/test/java/de/fraunhofer/iosb/client/dataTransfer/TransferInitiatorTest.java @@ -42,15 +42,14 @@ public class TransferInitiatorTest { private final TransferProcessManager mockTransferProcessManager = mock(TransferProcessManager.class); - private Config configMock; private TransferInitiator transferInitiator; private StatusResult mockStatusResult; @BeforeEach @SuppressWarnings("unchecked") - void initializeContractOfferService() throws URISyntaxException { - configMock = ConfigFactory.fromMap(Map.of("edc.dsp.callback.address", "http://localhost:4321/dsp", + void initializeContractOfferService() { + var configMock = ConfigFactory.fromMap(Map.of("edc.dsp.callback.address", "http://localhost:4321/dsp", "web.http.port", "8080", "web.http.path", "/api")); transferInitiator = new TransferInitiator(configMock, mock(Monitor.class), mockTransferProcessManager); diff --git a/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/AasExtension.java b/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/AasExtension.java index 49131819..33ae556b 100644 --- a/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/AasExtension.java +++ b/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/AasExtension.java @@ -62,16 +62,15 @@ public class AasExtension implements ServiceExtension { private static final Logger logger = Logger.getInstance(); private final ScheduledExecutorService syncExecutor = new ScheduledThreadPoolExecutor(1); private AasController aasController; - private ConfigurationController configurationController; @Override public void initialize(ServiceExtensionContext context) { - this.configurationController = new ConfigurationController(context.getConfig(SETTINGS_PREFIX)); + var configurationController = new ConfigurationController(context.getConfig(SETTINGS_PREFIX)); // Distribute controllers, repository var selfDescriptionRepository = new SelfDescriptionRepository(); this.aasController = new AasController(okHttpClient); - var endpoint = new Endpoint(selfDescriptionRepository, this.aasController, this.configurationController); + var endpoint = new Endpoint(selfDescriptionRepository, this.aasController, configurationController); // Initialize/Start synchronizer, start AAS services defined in configuration initializeSynchronizer(selfDescriptionRepository); diff --git a/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/model/aas/CustomSubmodel.java b/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/model/aas/CustomSubmodel.java index 4da277b8..89d7017d 100644 --- a/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/model/aas/CustomSubmodel.java +++ b/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/model/aas/CustomSubmodel.java @@ -83,11 +83,7 @@ public boolean equals(Object obj) { return false; } - if (!this.getIdShort().equals(other.getIdShort())) { - return false; - } - - return true; + return this.getIdShort().equals(other.getIdShort()); } } diff --git a/example/README.md b/example/README.md index 563e3837..77b93181 100644 --- a/example/README.md +++ b/example/README.md @@ -43,12 +43,12 @@ java "-Dedc.fs.config=./example/configurations/provider.properties" -jar ./examp After building the extension as seen above, a docker image can be built with -0. `cd ./example` -1. `docker build -t edc-aas-extension:latest .` -2. `mkdir workdir` -2. Create configuration under `./workdir/config.properties` -3. Add additional files under `./workdir` (Fitting to your paths in config.properties) -4. Run with `docker run -i -v $PWD/workdir:/workdir/ -e EDC_FS_CONFIG=/workdir/config.properties edc-extension4aas:latest` +1. `cd ./example` +2. `docker build -t edc-aas-extension:latest .` +3. `mkdir workdir` +4. Create configuration under `./workdir/config.properties` +5. Add additional files under `./workdir` (Fitting to your paths in config.properties) +6. Run with `docker run -i -v $PWD/workdir:/workdir/ -e EDC_FS_CONFIG=/workdir/config.properties edc-extension4aas:latest` This docker image can be run individually or **inside a docker-compose file**: