Class ServiceAgreementHandler


  • public class ServiceAgreementHandler
    extends Object
    Handles functionality related with the execution of a Service Agreement
    • Constructor Detail

      • ServiceAgreementHandler

        public ServiceAgreementHandler()
    • Method Detail

      • generateSlaId

        public static String generateSlaId()
        Generates a new and random Service Agreement Id
        Returns:
        a String with the new Service Agreement Id
      • listenExecuteAgreement

        public static io.reactivex.Flowable<com.oceanprotocol.keeper.contracts.EscrowAccessSecretStoreTemplate.AgreementCreatedEventResponse> listenExecuteAgreement​(com.oceanprotocol.keeper.contracts.EscrowAccessSecretStoreTemplate slaContract,
                                                                                                                                                                     String serviceAgreementId)
        Define and execute a Filter over the Service Agreement Contract to listen for an AgreementInitialized event
        Parameters:
        slaContract - the address of the service agreement contract
        serviceAgreementId - the service agreement Id
        Returns:
        a Flowable over the Event to handle it in an asynchronous fashion
      • listenForFulfilledEvent

        public static io.reactivex.Flowable<com.oceanprotocol.keeper.contracts.AccessSecretStoreCondition.FulfilledEventResponse> listenForFulfilledEvent​(com.oceanprotocol.keeper.contracts.AccessSecretStoreCondition accessCondition,
                                                                                                                                                          String serviceAgreementId)
        Define and execute a Filter over the AccessSecretStoreCondition Contract to listen for an Fulfilled event
        Parameters:
        accessCondition - the address of the AccessSecretStoreCondition contract
        serviceAgreementId - the serviceAgreement Id
        Returns:
        a Flowable over the Event to handle it in an asynchronous fashion
      • getAgreementData

        private static org.web3j.tuples.generated.Tuple2<String,​String> getAgreementData​(String agreementId,
                                                                                               com.oceanprotocol.keeper.contracts.EscrowAccessSecretStoreTemplate escrowAccessSecretStoreTemplate)
                                                                                        throws Exception
        Throws:
        Exception
      • checkAgreementStatus

        public static Boolean checkAgreementStatus​(String agreementId,
                                                   String consumerAddress,
                                                   com.oceanprotocol.keeper.contracts.EscrowAccessSecretStoreTemplate escrowAccessSecretStoreTemplate,
                                                   Integer retries,
                                                   Integer waitInMill)
                                            throws Exception
        Throws:
        Exception