Class ServiceAgreementHandler
- java.lang.Object
-
- io.keyko.nevermined.core.sla.handlers.ServiceAgreementHandler
-
- Direct Known Subclasses:
ServiceAccessAgreementHandler
,ServiceComputingAgreementHandler
public abstract class ServiceAgreementHandler extends Object
Handles functionality related with the execution of a Service Agreement
-
-
Field Summary
Fields Modifier and Type Field Description private String
conditionsTemplate
private static org.apache.logging.log4j.Logger
log
-
Constructor Summary
Constructors Constructor Description ServiceAgreementHandler()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static String
generateSlaId()
Generates a new and random Service Agreement Idabstract String
getConditionFileTemplate()
gets the name of the file that contains a template for the conditionsList<Condition>
initializeConditions(Map<String,Object> params)
Gets and Initializes all the conditions associated with a templatestatic 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 eventstatic 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 eventstatic 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 eventstatic 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
-
-
-
Field Detail
-
log
private static final org.apache.logging.log4j.Logger log
-
conditionsTemplate
private String conditionsTemplate
-
-
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 contractserviceAgreementId
- 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 contractserviceAgreementId
- 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 contractserviceAgreementId
- 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 contractserviceAgreementId
- 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
-
initializeConditions
public List<Condition> initializeConditions(Map<String,Object> params) throws InitializeConditionsException
Gets and Initializes all the conditions associated with a template- Parameters:
params
- params to fill the conditions- Returns:
- a List with all the conditions of the template
- Throws:
InitializeConditionsException
- InitializeConditionsException
-
-