Skip to content

Commit

Permalink
Merge pull request #508 from FraunhoferISST/chore/tx-edc-073
Browse files Browse the repository at this point in the history
chore: update tx-edc 0.7.3
  • Loading branch information
tom-rm-meyer-ISST authored Jul 18, 2024
2 parents 37269e9 + c2194d6 commit 5ebdd4a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Beside the dependencies provided in the Helm Chart, the following dependencies h

| Application | App Version | Chart Version |
|-------------------------------------------------------------------------------------------------------------------|-------------|---------------|
| [Tractus-X Connector](https://github.com/eclipse-tractusx/tractusx-edc/tree/main/charts/tractusx-connector) | 0.7.2 | 0.7.2 |
| [Tractus-X Connector](https://github.com/eclipse-tractusx/tractusx-edc/tree/main/charts/tractusx-connector) | 0.7.3 | 0.7.3 |
| [Digital Twin Registry](https://github.com/eclipse-tractusx/sldt-digital-twin-registry/tree/main/charts/registry) | 0.5.0 | 0.5.0 |

## Known Knows
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
import org.eclipse.tractusx.puris.backend.stock.logic.dto.itemstocksamm.DirectionCharacteristic;
import org.jetbrains.annotations.Nullable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.RequestEntity;
import org.springframework.http.RequestEntity.BodyBuilder;
import org.springframework.stereotype.Service;

import java.io.IOException;
Expand Down Expand Up @@ -202,7 +200,7 @@ public boolean createPolicyAndContractDefForPartner(Partner partner) {

private boolean createSubmodelContractDefinitionForPartner(String semanticId, String assetId, Partner partner) {
var body = edcRequestBodyBuilder.buildSubmodelContractDefinitionWithBpnRestrictedPolicy(assetId, partner);
try (var response = sendPostRequest(body, List.of("v2", "contractdefinitions"))) {
try (var response = sendPostRequest(body, List.of("v3", "contractdefinitions"))) {
if (!response.isSuccessful()) {
log.warn("Contract definition registration failed for partner " + partner.getBpnl() + " and {} Submodel", semanticId);
if (response.body() != null) {
Expand All @@ -219,7 +217,7 @@ private boolean createSubmodelContractDefinitionForPartner(String semanticId, St

private boolean createDtrContractDefinitionForPartner(Partner partner) {
var body = edcRequestBodyBuilder.buildDtrContractDefinitionForPartner(partner);
try (var response = sendPostRequest(body, List.of("v2", "contractdefinitions"))) {
try (var response = sendPostRequest(body, List.of("v3", "contractdefinitions"))) {
if (!response.isSuccessful()) {
log.warn("Contract definition registration failed for partner " + partner.getBpnl() + " and DTR");
return false;
Expand All @@ -241,7 +239,7 @@ private boolean createDtrContractDefinitionForPartner(Partner partner) {
*/
private boolean createBpnlAndMembershipPolicyDefinitionForPartner(Partner partner) {
var body = edcRequestBodyBuilder.buildBpnAndMembershipRestrictedPolicy(partner);
try (var response = sendPostRequest(body, List.of("v2", "policydefinitions"))) {
try (var response = sendPostRequest(body, List.of("v3", "policydefinitions"))) {
if (!response.isSuccessful()) {
log.warn("Policy Registration failed");
if (response.body() != null) {
Expand All @@ -263,7 +261,7 @@ private boolean createBpnlAndMembershipPolicyDefinitionForPartner(Partner partne
*/
private boolean createContractPolicy() {
var body = edcRequestBodyBuilder.buildFrameworkPolicy();
try (var response = sendPostRequest(body, List.of("v2", "policydefinitions"))) {
try (var response = sendPostRequest(body, List.of("v3", "policydefinitions"))) {
if (!response.isSuccessful()) {
log.warn("Framework Policy Registration failed");
if (response.body() != null) {
Expand Down Expand Up @@ -325,7 +323,7 @@ private boolean sendAssetRegistrationRequest(JsonNode body, String assetId) {
* @return The response containing the full catalog, if successful
*/
public Response getCatalogResponse(String dspUrl, String partnerBpnl, Map<String, String> filter) throws IOException {
return sendPostRequest(edcRequestBodyBuilder.buildBasicCatalogRequestBody(dspUrl, partnerBpnl, filter), List.of("v2", "catalog", "request"));
return sendPostRequest(edcRequestBodyBuilder.buildBasicCatalogRequestBody(dspUrl, partnerBpnl, filter), List.of("v3", "catalog", "request"));
}

/**
Expand Down Expand Up @@ -376,7 +374,7 @@ private JsonNode initiateNegotiation(Partner partner, JsonNode catalogItem, Stri
// use dspUrl as provided, if set - else use partner
dspUrl = dspUrl != null && !dspUrl.isEmpty() ? dspUrl : partner.getEdcUrl();
var requestBody = edcRequestBodyBuilder.buildAssetNegotiationBody(partner, catalogItem, dspUrl);
try (Response response = sendPostRequest(requestBody, List.of("v2", "contractnegotiations"))) {
try (Response response = sendPostRequest(requestBody, List.of("v3", "contractnegotiations"))) {
JsonNode responseNode = objectMapper.readTree(response.body().string());
log.debug("Result from negotiation {}", responseNode.toPrettyString());
return responseNode;
Expand All @@ -393,7 +391,7 @@ private JsonNode initiateNegotiation(Partner partner, JsonNode catalogItem, Stri
* @throws IOException If the connection to your control plane fails
*/
public JsonNode getNegotiationState(String negotiationId) throws IOException {
try (var response = sendGetRequest(List.of("v2", "contractnegotiations", negotiationId))) {
try (var response = sendGetRequest(List.of("v3", "contractnegotiations", negotiationId))) {
String stringData = response.body().string();
return objectMapper.readTree(stringData);
}
Expand All @@ -408,7 +406,7 @@ public JsonNode getNegotiationState(String negotiationId) throws IOException {
*/
public Response getAllNegotiations() throws IOException {
var requestBody = edcRequestBodyBuilder.buildNegotiationsRequestBody();
return sendPostRequest(requestBody, List.of("v2", "contractnegotiations", "request"));
return sendPostRequest(requestBody, List.of("v3", "contractnegotiations", "request"));
}

/**
Expand All @@ -423,7 +421,7 @@ public Response getAllNegotiations() throws IOException {
*/
public JsonNode initiateProxyPullTransfer(Partner partner, String contractId, String assetId, String partnerEdcUrl) throws IOException {
var body = edcRequestBodyBuilder.buildProxyPullRequestBody(partner, contractId, assetId, partnerEdcUrl);
try (var response = sendPostRequest(body, List.of("v2", "transferprocesses"))) {
try (var response = sendPostRequest(body, List.of("v3", "transferprocesses"))) {
String data = response.body().string();
JsonNode result = objectMapper.readTree(data);
log.debug("Got response from Proxy pull transfer init: {}", result.toPrettyString());
Expand All @@ -445,7 +443,7 @@ public JsonNode initiateProxyPullTransfer(Partner partner, String contractId, St
* @throws IOException If the connection to your control plane fails
*/
public JsonNode getTransferState(String transferId) throws IOException {
try (var response = sendGetRequest(List.of("v2", "transferprocesses", transferId))) {
try (var response = sendGetRequest(List.of("v3", "transferprocesses", transferId))) {
String data = response.body().string();
return objectMapper.readTree(data);
}
Expand All @@ -461,7 +459,7 @@ public JsonNode getTransferState(String transferId) throws IOException {
public Response getAllTransfers() throws IOException {
var requestBody = edcRequestBodyBuilder.buildTransfersRequestBody();
log.debug("GetAllTransfers Request: {}", requestBody.toPrettyString());
return sendPostRequest(requestBody, List.of("v2", "transferprocesses", "request"));
return sendPostRequest(requestBody, List.of("v3", "transferprocesses", "request"));
}

/**
Expand All @@ -473,7 +471,7 @@ public Response getAllTransfers() throws IOException {
* @throws IOException If the connection to your control plane fails
*/
public String getContractAgreement(String contractAgreementId) throws IOException {
try (var response = sendGetRequest(List.of("v2", "contractagreements", contractAgreementId))) {
try (var response = sendGetRequest(List.of("v3", "contractagreements", contractAgreementId))) {
return response.body().string();
}
}
Expand Down Expand Up @@ -987,7 +985,7 @@ private void terminateTransfer(String transferProcessId) {

JsonNode body = edcRequestBodyBuilder.buildTransferProcessTerminationBody("Transfer done.");

try (Response response = sendPostRequest(body, List.of("v2", "transferprocesses", transferProcessId, "terminate"))) {
try (Response response = sendPostRequest(body, List.of("v3", "transferprocesses", transferProcessId, "terminate"))) {

JsonNode resultNode = objectMapper.readTree(response.body().string());
if (!response.isSuccessful()) {
Expand Down
2 changes: 2 additions & 0 deletions local/tractus-x-edc/config/customer/data-plane.properties
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ edc.iam.trusted-issuer.portal.id=did:web:mock-util-service/trusted-issuer
tx.iam.credentialservice.url=http://mock-util-service:80
# don't use https during did resolving in catalog request
edc.iam.did.web.use.https=false

edc.dpf.selector.url=http://customer-control-plane:8183/api/controlplane/control/v1/dataplanes
2 changes: 2 additions & 0 deletions local/tractus-x-edc/config/supplier/data-plane.properties
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ edc.iam.trusted-issuer.portal.id=did:web:mock-util-service/trusted-issuer
tx.iam.credentialservice.url=http://mock-util-service:80
# don't use https during did resolving in catalog request
edc.iam.did.web.use.https=false

edc.dpf.selector.url=http://supplier-control-plane:9183/api/controlplane/control/v1/dataplanes
4 changes: 2 additions & 2 deletions local/tractus-x-edc/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
version: "3"
services:
control-plane:
image: tractusx/edc-controlplane-postgresql-hashicorp-vault:0.7.2
image: tractusx/edc-controlplane-postgresql-hashicorp-vault:0.7.3
volumes:
- ./config/default/opentelemetry.properties:/app/opentelemetry.properties
- ./config/default/logging.properties:/app/logging.properties

data-plane:
image: tractusx/edc-dataplane-hashicorp-vault:0.7.2
image: tractusx/edc-dataplane-hashicorp-vault:0.7.3
volumes:
- ./config/default/opentelemetry.properties:/app/opentelemetry.properties
- ./config/default/logging.properties:/app/logging.properties

0 comments on commit 5ebdd4a

Please sign in to comment.