|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
org.ogf.graap.wsag.api.types.WSAGXmlType
org.ogf.graap.wsag.api.types.AbstractAgreementType
public abstract class AbstractAgreementType
Abstract implementation of an agreement. This class implements the required methods to access and store the properties of an agreement. Additionally, when an agreement is created based on an offer, the corresponding states are created for each service term and each guarantee term specified in the offer.
AbstractAgreementType
will not be required anymore. This will make the framework more robust
for user implementations., Implement Observer pattern to allow registered objects to get notified if the abstract agreement is
updated.Field Summary | |
---|---|
protected AgreementPropertiesType |
agreementProperties
The internal XML representation of the agreement instance. |
protected static String |
DEFAULT_GUARANTEE_TERM_XPATH
Default XPath expression for selecting all guarantee terms in an agreement. |
protected static String |
DEFAULT_SDT_XPATH
Default XPath expression for selecting all service description terms in an agreement. |
Constructor Summary | |
---|---|
AbstractAgreementType()
Default constructor. |
|
AbstractAgreementType(AgreementOffer offer)
Creates an agreement based on an offer. |
|
AbstractAgreementType(AgreementPropertiesType agreementPropertiesType)
Creates a new agreement instance. |
Method Summary | |
---|---|
String |
getAgreementId()
Returns the agreement id. |
AbstractAgreementType |
getAgreementInstance()
Returns a domain-specific agreement implementation. |
AgreementContextType |
getContext()
|
Map<String,org.apache.xmlbeans.XmlObject> |
getExecutionContext()
Returns the persisted execution context for this agreement. |
GuaranteeTermStateType[] |
getGuaranteeTermStates()
|
String |
getName()
Returns the agreement name. |
ServiceTermStateType[] |
getServiceTermStates()
|
AgreementStateType |
getState()
|
TermTreeType |
getTerms()
|
Map<String,Object> |
getTransientExecutionContext()
Returns the transient execution context for this agreement. |
org.apache.xmlbeans.XmlObject |
getXMLObject()
Returns the agreement properties as XmlObject . |
protected void |
initialize(AgreementOffer offer)
Initializes an agreement type with the standard selection strategy for service description term states and guarantee term states. |
protected void |
initialize(AgreementOffer offer,
String sdtXPath,
String guaranteeTermXPath)
Initializes an agreement type with the custom selection strategy for service description term states and guarantee term states. |
protected void |
notifyReinitialized(Map<String,org.apache.xmlbeans.XmlObject> persistedExecutionCtx)
Reload hook. |
void |
notifyReload(Map<String,org.apache.xmlbeans.XmlObject> executionCtx)
This method allows an agreement instance to get notified after reload. |
void |
setAgreementId(String agreementId)
Sets the ID of the agreement. |
void |
setContext(AgreementContextType context)
Sets the context of the agreement. |
void |
setGuaranteeTermStates(GuaranteeTermStateType[] guaranteeTermStateList)
Sets the guarantee term states of the agreement. |
void |
setName(String name)
Sets the name of the agreement. |
void |
setServiceTermStates(ServiceTermStateType[] serviceTermStateList)
Sets the service term states of the agreement. |
void |
setState(AgreementStateType agreementState)
Sets the state of the agreement. |
void |
setTerms(TermTreeType terms)
Sets the terms of the agreement. |
void |
setXmlObject(AgreementPropertiesType properties)
Sets the properties for this agreement explicitly. |
boolean |
validate()
Validates the resource properties document of this instance. |
Methods inherited from class org.ogf.graap.wsag.api.types.WSAGXmlType |
---|
processTemplate, validate |
Methods inherited from class java.util.Observable |
---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.ogf.graap.wsag.api.Agreement |
---|
terminate |
Field Detail |
---|
protected AgreementPropertiesType agreementProperties
protected static final String DEFAULT_SDT_XPATH
protected static final String DEFAULT_GUARANTEE_TERM_XPATH
Constructor Detail |
---|
public AbstractAgreementType(AgreementOffer offer)
DEFAULT_SDT_XPATH
and
DEFAULT_GUARANTEE_TERM_XPATH
XPath expression are used.
offer
- the offer to create the agreement forpublic AbstractAgreementType(AgreementPropertiesType agreementPropertiesType)
agreementPropertiesType
- the agreement properties documentpublic AbstractAgreementType()
Method Detail |
---|
public boolean validate()
validate
in class WSAGXmlType
protected void initialize(AgreementOffer offer)
offer
- The agreement offer that is used for the agreement initialization process.protected void initialize(AgreementOffer offer, String sdtXPath, String guaranteeTermXPath)
offer
- The agreement offer that is used for the agreement initialization process.sdtXPath
- Custom expression for selecting service terms from the agreement offer.guaranteeTermXPath
- Custom expression for selecting guarantee terms from the agreement offer.public final void notifyReload(Map<String,org.apache.xmlbeans.XmlObject> executionCtx)
notifyReload(Map)
method sets the execution context (see getExecutionContext()
) of
the agreement and invokes the notifyReinitialized(Map)
method of this agreement instance.
executionCtx
- the current execution contextprotected void notifyReinitialized(Map<String,org.apache.xmlbeans.XmlObject> persistedExecutionCtx)
persistedExecutionCtx
- persisted execution properties of the agreement instance
Since 1.0.0-m4
public String getAgreementId()
getAgreementId
in interface Agreement
public AgreementContextType getContext()
getContext
in interface Agreement
public String getName()
getName
in interface Agreement
public TermTreeType getTerms()
getTerms
in interface Agreement
public void setAgreementId(String agreementId)
agreementId
- the agreement id to setpublic void setContext(AgreementContextType context)
context
- the agreement context to setpublic void setName(String name)
name
- the agreement name to setpublic void setTerms(TermTreeType terms)
terms
- the agreement terms to setpublic AgreementStateType getState()
getState
in interface Agreement
public GuaranteeTermStateType[] getGuaranteeTermStates()
getGuaranteeTermStates
in interface Agreement
public ServiceTermStateType[] getServiceTermStates()
getServiceTermStates
in interface Agreement
public void setState(AgreementStateType agreementState)
agreementState
- the agreement state to setpublic void setGuaranteeTermStates(GuaranteeTermStateType[] guaranteeTermStateList)
guaranteeTermStateList
- the guarantee term states to setpublic void setServiceTermStates(ServiceTermStateType[] serviceTermStateList)
serviceTermStateList
- the service term states to setpublic org.apache.xmlbeans.XmlObject getXMLObject()
XmlObject
.
public void setXmlObject(AgreementPropertiesType properties)
properties
- the agreement properties to setpublic AbstractAgreementType getAgreementInstance()
AbstractAgreementType
implements the
domain-specific termination method and stored the agreement properties. The
getXMLObject()
returns the actual properties of an agreement
implementation. These properties must be valid at all time, i.e. if an agreement implementation
overrides the Agreement.getState()
method the implementation must make sure that the agreement
properties are updated with the returned state.
getAgreementInstance
in interface Agreement
public Map<String,org.apache.xmlbeans.XmlObject> getExecutionContext()
public Map<String,Object> getTransientExecutionContext()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |