Class AgreementsImpl

    • Constructor Detail

      • AgreementsImpl

        public AgreementsImpl​(AgreementsManager agreementsManager,
                              OceanManager oceanManager)
        Constructor
        Parameters:
        agreementsManager - the accountsManager
        oceanManager - an instance of oceanManager
    • Method Detail

      • prepare

        public org.web3j.tuples.generated.Tuple2<String,​String> prepare​(DID did,
                                                                              String serviceDefinitionId,
                                                                              Account consumerAccount)
                                                                       throws Exception
        Description copied from interface: AgreementsAPI
        Prepare the service agreement.
        Specified by:
        prepare in interface AgreementsAPI
        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

        public void send​(DID did,
                         String agreementId,
                         String serviceDefinitionId,
                         String signature,
                         Account consumerAccount)
                  throws Exception
        Description copied from interface: AgreementsAPI
        Send a signed service agreement to the publisher Brizo instance to consume/access the service.
        Specified by:
        send in interface AgreementsAPI
        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

        public boolean create​(DID did,
                              String agreementId,
                              String serviceDefinitionId,
                              String signature,
                              String consumerAddress)
                       throws Exception
        Description copied from interface: AgreementsAPI
        Create a service agreement.
        Specified by:
        create in interface AgreementsAPI
        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

        public AgreementStatus status​(String agreementId)
                               throws Exception
        Description copied from interface: AgreementsAPI
        Get the status of a service agreement.
        Specified by:
        status in interface AgreementsAPI
        Parameters:
        agreementId - id of the agreement
        Returns:
        AgreementStatus with condition status of each of the agreement's conditions.
        Throws:
        Exception - Exception