Class ServiceAgreementHandler

    • Field Detail

      • log

        private static final org.apache.logging.log4j.Logger log
      • conditionsTemplate

        private String conditionsTemplate
    • 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<String> listenExecuteAgreement​(io.keyko.nevermined.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 to handle the in an asynchronous fashion
      • listenExecuteAgreement

        public static io.reactivex.Flowable<String> listenExecuteAgreement​(io.keyko.nevermined.contracts.EscrowComputeExecutionTemplate 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 to handle the event in an asynchronous fashion
      • listenForFulfilledEvent

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

        public static io.reactivex.Flowable<String> listenForFulfilledEvent​(io.keyko.nevermined.contracts.ComputeExecutionCondition computeCondition,
                                                                            String serviceAgreementId)
        Define and execute a Filter over the ComputeExecutionCondition Contract to listen for an Fulfilled event
        Parameters:
        computeCondition - the ComputeExecutionCondition contract
        serviceAgreementId - the serviceAgreement Id
        Returns:
        a Flowable to handle the event in an asynchronous fashion
      • getConditionFileTemplate

        public abstract String getConditionFileTemplate()
        gets the name of the file that contains a template for the conditions
        Returns:
        the name of the template file