Class AgreementsManager

    • Field Detail

      • log

        private static final org.apache.logging.log4j.Logger log
    • Method Detail

      • getInstance

        public static AgreementsManager getInstance​(KeeperService keeperService,
                                                    AquariusService aquariusService)
        Given the KeeperService and AquariusService, returns a new instance of AgreementsManager using them as attributes
        Parameters:
        keeperService - Keeper Dto
        aquariusService - Provider Dto
        Returns:
        AgreementsManager
      • createAgreement

        public Boolean createAgreement​(String agreementId,
                                       DDO ddo,
                                       List<byte[]> conditionIds,
                                       String accessConsumer,
                                       String signature,
                                       AccessService accessService)
                                throws Exception
        Create an agreement using the escrowAccessSecretStoreTemplate. This method should be more specific in the future when we have more than one template.
        Parameters:
        agreementId - the agreement id
        ddo - the ddo
        conditionIds - list with the conditions ids
        accessConsumer - eth address of the consumer of the agreement.
        signature - the signature
        accessService - an instance of accessService
        Returns:
        a flag that is true if the agreement was successfully created.
        Throws:
        Exception - exception
      • getAgreement

        public Agreement getAgreement​(String agreementId)
                               throws Exception
        Retrieve the agreement for a agreement_id.
        Parameters:
        agreementId - id of the agreement
        Returns:
        Agreement
        Throws:
        Exception - Exception
      • getStatus

        public AgreementStatus getStatus​(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
      • getConditionNameByAddress

        private String getConditionNameByAddress​(String address)
                                          throws Exception
        Auxiliar method to get the name of the different conditions address.
        Parameters:
        address - contract address
        Returns:
        string
        Throws:
        Exception - exception