Interface AgreementsAPI

  • All Known Implementing Classes:
    AgreementsImpl

    public interface AgreementsAPI
    Exposes the Public API related with the management of Agreements
    • 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 did
        serviceDefinitionId - the service definition id of the agreement
        consumerAccount - 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 did
        agreementId - the agreement id
        serviceDefinitionId - the service definition id of the agreement
        signature - the signature
        consumerAccount - 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 did
        agreementId - the agreement id
        serviceDefinitionId - the service definition id of the agreement
        signature - the signature
        consumerAddress - 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