Package com.oceanprotocol.squid.api
Interface AgreementsAPI
-
- All Known Implementing Classes:
AgreementsImpl
public interface AgreementsAPI
Exposes the Public API related with the management of Agreements
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
create(DID did, String agreementId, String serviceDefinitionId, String signature, String consumerAddress)
Create a service agreement.org.web3j.tuples.generated.Tuple2<String,String>
prepare(DID did, String serviceDefinitionId, Account consumerAccount)
Prepare the service agreement.void
send(DID did, String agreementId, String serviceDefinitionId, String signature, Account consumerAccount)
Send a signed service agreement to the publisher Brizo instance to consume/access the service.AgreementStatus
status(String agreementId)
Get the status of a service agreement.
-
-
-
Method Detail
-
prepare
org.web3j.tuples.generated.Tuple2<String,String> prepare(DID did, String serviceDefinitionId, Account consumerAccount) throws Exception
Prepare the service agreement.- Parameters:
did
- the didserviceDefinitionId
- the service definition id of the agreementconsumerAccount
- the address of the consumer- Returns:
- Tuple with agreement id and signature.
- Throws:
Exception
- Exception
-
send
void send(DID did, String agreementId, String serviceDefinitionId, String signature, Account consumerAccount) throws Exception
Send a signed service agreement to the publisher Brizo instance to consume/access the service.- Parameters:
did
- the didagreementId
- the agreement idserviceDefinitionId
- the service definition id of the agreementsignature
- the signatureconsumerAccount
- the account of the consumer- Throws:
Exception
- Exception
-
create
boolean create(DID did, String agreementId, String serviceDefinitionId, String signature, String consumerAddress) throws Exception
Create a service agreement.- Parameters:
did
- the didagreementId
- the agreement idserviceDefinitionId
- the service definition id of the agreementsignature
- the signatureconsumerAddress
- the address of the consumer- Returns:
- a flag a true if the creation of the agreement was successful.
- Throws:
Exception
- Exception
-
status
AgreementStatus status(String agreementId) throws Exception
Get the status of a service agreement.- Parameters:
agreementId
- id of the agreement- Returns:
- AgreementStatus with condition status of each of the agreement's conditions.
- Throws:
Exception
- Exception
-
-