Skip to content

Commit

Permalink
fix: fixed transfer request and transfer models
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathias Brunkow Moser committed Oct 13, 2023
1 parent 8cf72c5 commit 0b2911f
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 29 deletions.
2 changes: 1 addition & 1 deletion consumer-backend/productpass/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</parent>
<groupId>org.eclipse.tractusx</groupId>
<artifactId>productpass</artifactId>
<version>1.0.0</version>
<version>1.2.0</version>
<packaging>jar</packaging>
<name>Catena-X Digital Product Passport Backend</name>
<description>Product Passport Consumer Backend System for Product Passport Consumer Frontend Application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ public Response getDigitalTwin(@RequestBody Object body, @PathVariable String pr
digitalTwin = digitalTwinRegistry.getDigitalTwin();
subModel = digitalTwinRegistry.getSubModel();
semanticId = Objects.requireNonNull(subModel.getSemanticId().getKeys().stream().filter(k -> k.getType().equalsIgnoreCase("Submodel") || k.getType().equalsIgnoreCase("GlobalReference")).findFirst().orElse(null)).getValue();
LogUtil.printMessage("SemanticId "+ semanticId);
connectorId = subModel.getIdShort();
EndPoint3 endpoint = subModel.getEndpoints().stream().filter(obj -> obj.getInterfaceName().equals(dtrConfig.getEndpointInterface())).findFirst().orElse(null);
if (endpoint == null) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,18 @@ public void setConnectorId(String connectorId) {
this.connectorId = connectorId;
}
}
@JsonInclude(JsonInclude.Include.NON_NULL)
static class DataDestination {
@JsonProperty("edc:type")
String type;

public String getType() {
return type;
}

public void setType(String type) {
this.type = type;
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,18 @@ public void setReceiverHttpEndpoint(String receiverHttpEndpoint) {
this.receiverHttpEndpoint = receiverHttpEndpoint;
}
}
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class DataDestination {
@JsonProperty("type")
String type;


public String getType() {
return type;
}

public void setType(String type) {
this.type = type;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -995,10 +995,10 @@ public DecentralDigitalTwinRegistryQueryById(Search search, DataPlaneEndpoint ed
@Override
public void run() {
this.setDigitalTwin(searchDigitalTwin3(this.getIdType(), this.getAssetId(), this.getDtIndex(), this.getEdr().getEndpoint(), this.getEdr()));
if(semanticId.isEmpty()){
if(this.semanticId == null || this.semanticId.isEmpty()){
this.setSubModel(searchSubModel3BySemanticId(this.getDigitalTwin()));
}else {
this.setSubModel(searchSubModel3BySemanticId(this.getDigitalTwin(), semanticId));
this.setSubModel(searchSubModel3BySemanticId(this.getDigitalTwin(), this.semanticId));
}
}
/** GETTERS AND SETTERS **/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ public TransferRequest buildTransferRequest(Dataset dataset, Status status, Nego
transferType.setIsFinite(true);


DataDestination dataDestination = new DataDestination();
TransferRequest.DataDestination dataDestination = new TransferRequest.DataDestination();
dataDestination.setType("HttpProxy");

TransferRequest.PrivateProperties privateProperties = new TransferRequest.PrivateProperties();
Expand Down Expand Up @@ -1205,7 +1205,7 @@ public TransferRequest buildTransferRequest(String processId, Dtr dtr, String en

transferType.setContentType("application/octet-stream");
transferType.setIsFinite(true);
DataDestination dataDestination = new DataDestination();
TransferRequest.DataDestination dataDestination = new TransferRequest.DataDestination();
dataDestination.setType("HttpProxy");

TransferRequest.PrivateProperties privateProperties = new TransferRequest.PrivateProperties();
Expand Down

0 comments on commit 0b2911f

Please sign in to comment.