Skip to content

Commit

Permalink
fix compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
ndr-brt committed Sep 25, 2023
1 parent a503de5 commit 1fe5d2f
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import jakarta.json.Json;
import jakarta.json.JsonArray;
import jakarta.json.JsonObject;
import org.eclipse.edc.connector.contract.spi.ContractId;
import org.eclipse.edc.connector.contract.spi.ContractOfferId;
import org.eclipse.edc.jsonld.TitaniumJsonLd;
import org.eclipse.edc.jsonld.spi.JsonLd;
import org.eclipse.edc.jsonld.util.JacksonJsonLd;
Expand Down Expand Up @@ -293,7 +293,7 @@ public String initiateTransfer(Participant provider, String contractAgreementId,
public String requestAsset(Participant provider, String assetId, JsonObject privateProperties, JsonObject destination) {
var dataset = getDatasetForAsset(provider, assetId);
var policy = dataset.getJsonArray(ODRL_POLICY_ATTRIBUTE).get(0).asJsonObject();
var contractDefinitionId = ContractId.parseId(policy.getString(ID))
var contractDefinitionId = ContractOfferId.parseId(policy.getString(ID))
.orElseThrow(failure -> new RuntimeException(failure.getFailureDetail()));
var contractAgreementId = negotiateContract(provider, contractDefinitionId.toString(), assetId, policy);
var transferProcessId = initiateTransfer(provider, contractAgreementId, assetId, privateProperties, destination);
Expand All @@ -317,11 +317,6 @@ public String getTransferProcessState(String id) {
.extract().body().jsonPath().getString("'edc:state'");
}

private ContractId extractContractDefinitionId(JsonObject dataset) {
var contractId = dataset.getJsonArray(ODRL_POLICY_ATTRIBUTE).get(0).asJsonObject().getString(ID);
return ContractId.parseId(contractId).orElseThrow(f -> new RuntimeException(f.getFailureDetail()));
}

private String getContractNegotiationState(String id) {
return managementEndpoint.baseRequest()
.contentType(JSON)
Expand Down

0 comments on commit 1fe5d2f

Please sign in to comment.