org.ogf.graap.wsag.api
Interface Agreement

All Known Subinterfaces:
PersistentAgreement
All Known Implementing Classes:
AbstractAgreementType, AgreementDelegator, DatabasePersistentAgreement, ExampleAgreement, MonitorableAgreement, PendingAgreement, PendingAgreementFacade, PendingAgreementImpl, SampleAgreement, SampleAgreement, SampleMonitoredAgreement, SimpleMonitoredAgreement, SimplePersistentAgreement, WsDatabasePersistentAgreement

public interface Agreement

Agreement interface used by the server module. It provides the required methods to access the properties of the agreement and to terminate the agreement instance. Moreover, it provides access to the domains-specific agreement implementation via the #getAgreementInstance() method.

Author:
Oliver Waeldrich
See Also:
AgreementFactory

Method Summary
 void addObserver(Observer o)
          Adds a new observer to an agreement that gets notified of agreement state changes.
 String getAgreementId()
          Returns the agreement id.
 AgreementContextType getContext()
           
 Map<String,org.apache.xmlbeans.XmlObject> getExecutionContext()
          Returns the persisted execution context for this agreement.
 GuaranteeTermStateType[] getGuaranteeTermStates()
           
 Class<?> getImplementationClass()
          Returns the class of the agreement implementation.
 String getName()
          Returns the agreement name.
 ServiceTermStateType[] getServiceTermStates()
           
 AgreementStateType getState()
           
 TermTreeType getTerms()
           
 Map<String,Object> getTransientExecutionContext()
          Returns the transient execution context for this agreement.
 AgreementPropertiesType getXMLObject()
          Returns the agreement properties as XmlObject.
 boolean hasChanged()
          Returns true if the content of the agreement has changed, otherwise false.
 void notifyObservers()
           
 void notifyObservers(Object arg)
          Notifies all registered observer of an agreement's state change.
 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.
 void terminate(TerminateInputType reason)
          Terminates an agreement.
 boolean validate()
          Validates the resource properties document of this instance.
 

Method Detail

getName

String getName()
Returns the agreement name.

Returns:
the agreement name

getAgreementId

String getAgreementId()
Returns the agreement id.

Returns:
the agreement id

getContext

AgreementContextType getContext()
Returns:
the agreement context

getTerms

TermTreeType getTerms()
Returns:
the agreement terms

terminate

void terminate(TerminateInputType reason)
Terminates an agreement.

Parameters:
reason - termination reason

getState

AgreementStateType getState()
Returns:
the agreement state

getGuaranteeTermStates

GuaranteeTermStateType[] getGuaranteeTermStates()
Returns:
the agreement guarantee term states

getServiceTermStates

ServiceTermStateType[] getServiceTermStates()
Returns:
the agreement service term states

validate

boolean validate()
Validates the resource properties document of this instance.

Returns:
true if the resource properties document is valid, otherwise false.

notifyReload

void notifyReload(Map<String,org.apache.xmlbeans.XmlObject> executionCtx)
This method allows an agreement instance to get notified after reload. An invocation of the notifyReload(Map) method sets the execution context (see getExecutionContext()) of the agreement and invokes the #notifyReinitialized(Map) method of this agreement instance.

Parameters:
executionCtx - the current execution context

setAgreementId

void setAgreementId(String agreementId)
Sets the ID of the agreement.

Parameters:
agreementId - the agreement id to set

setContext

void setContext(AgreementContextType context)
Sets the context of the agreement.

Parameters:
context - the agreement context to set

setName

void setName(String name)
Sets the name of the agreement.

Parameters:
name - the agreement name to set

setTerms

void setTerms(TermTreeType terms)
Sets the terms of the agreement.

Parameters:
terms - the agreement terms to set

setState

void setState(AgreementStateType agreementState)
Sets the state of the agreement.

Parameters:
agreementState - the agreement state to set

setGuaranteeTermStates

void setGuaranteeTermStates(GuaranteeTermStateType[] guaranteeTermStateList)
Sets the guarantee term states of the agreement.

Parameters:
guaranteeTermStateList - the guarantee term states to set

setServiceTermStates

void setServiceTermStates(ServiceTermStateType[] serviceTermStateList)
Sets the service term states of the agreement.

Parameters:
serviceTermStateList - the service term states to set

getXMLObject

AgreementPropertiesType getXMLObject()
Returns the agreement properties as XmlObject.

Returns:
an XML representation of the agreement properties document

setXmlObject

void setXmlObject(AgreementPropertiesType properties)
Sets the properties for this agreement explicitly.

Parameters:
properties - the agreement properties to set

getExecutionContext

Map<String,org.apache.xmlbeans.XmlObject> getExecutionContext()
Returns the persisted execution context for this agreement.

Returns:
the agreement persisted execution context

getTransientExecutionContext

Map<String,Object> getTransientExecutionContext()
Returns the transient execution context for this agreement.

Returns:
the agreement transient execution context

getImplementationClass

Class<?> getImplementationClass()
Returns the class of the agreement implementation.

Returns:
the implementation class

addObserver

void addObserver(Observer o)
Adds a new observer to an agreement that gets notified of agreement state changes.

Parameters:
o - the observer
See Also:
Observable.addObserver(java.util.Observer)

notifyObservers

void notifyObservers()
See Also:
Observable.notifyObservers()

notifyObservers

void notifyObservers(Object arg)
Notifies all registered observer of an agreement's state change.

Parameters:
arg - notification message
See Also:
Observable.notifyObservers(java.lang.Object)

hasChanged

boolean hasChanged()
Returns true if the content of the agreement has changed, otherwise false.

Returns:
true if the agreement has changed, i.e. runtime state was updated
See Also:
Observable.hasChanged()


Copyright © 2008-2012. All Rights Reserved.