org.ogf.graap.wsag.samples.site
Class ExampleAgreement

java.lang.Object
  extended by java.util.Observable
      extended by org.ogf.graap.wsag.api.types.WSAGXmlType
          extended by org.ogf.graap.wsag.api.types.AbstractAgreementType
              extended by org.ogf.graap.wsag.samples.site.ExampleAgreement
All Implemented Interfaces:
Agreement

public class ExampleAgreement
extends AbstractAgreementType

This agreement implementation is used as example for the project documentation.

Author:
Oliver Waeldrich

Field Summary
 
Fields inherited from class org.ogf.graap.wsag.api.types.AbstractAgreementType
agreementProperties, DEFAULT_GUARANTEE_TERM_XPATH, DEFAULT_SDT_XPATH
 
Constructor Summary
ExampleAgreement(AgreementOffer offer)
          Creates an new agreement instance based on an agreement offer.
 
Method Summary
 void setService(ExampleService service)
          Sets the service associated with this agreement instance.
 void terminate(TerminateInputType reason)
          This method is invoked when an agreement is terminated.
 
Methods inherited from class org.ogf.graap.wsag.api.types.AbstractAgreementType
getAgreementId, getAgreementInstance, getContext, getExecutionContext, getGuaranteeTermStates, getName, getServiceTermStates, getState, getTerms, getTransientExecutionContext, getXMLObject, initialize, initialize, notifyReinitialized, notifyReload, setAgreementId, setContext, setGuaranteeTermStates, setName, setServiceTermStates, setState, setTerms, setXmlObject, validate
 
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
 

Constructor Detail

ExampleAgreement

public ExampleAgreement(AgreementOffer offer)
Creates an new agreement instance based on an agreement offer. The agreement properties of the agreement are initialized based on the offer. Additionally, for each service description term (guarantee term) specified in the offer a corresponding service term state (guarantee term state) is initialized.

Parameters:
offer - the agreement offer for which the agreement is created
Method Detail

setService

public void setService(ExampleService service)
Sets the service associated with this agreement instance.

Parameters:
service - the service to set

terminate

public void terminate(TerminateInputType reason)
This method is invoked when an agreement is terminated. Implementations can add domain-specific functionality here in order to shutdown services or free resources. Terminates an agreement.

Parameters:
reason - termination reason


Copyright © 2008-2012 Fraunhofer Institute SCAI. All Rights Reserved.