org.ogf.graap.wsag.wsrf.impl
Class PendingAgreementFacade

java.lang.Object
  extended by org.ogf.graap.wsag.wsrf.impl.PendingAgreementFacade
All Implemented Interfaces:
Runnable, Agreement

public class PendingAgreementFacade
extends Object
implements Agreement, Runnable

PendingAgreementFacade

Author:
Oliver Waeldrich

Constructor Summary
PendingAgreementFacade(AgreementOffer offer, AgreementFactory factory, AgreementAcceptanceClient client)
          Implementation of a pending agreement facade.
 
Method Summary
 String getAgreementId()
          Returns the agreement id.
 AbstractAgreementType getAgreementInstance()
          Returns a domain-specific agreement implementation.
 AgreementContextType getContext()
          
 GuaranteeTermStateType[] getGuaranteeTermStates()
          
 String getName()
          Returns the agreement name.
 ServiceTermStateType[] getServiceTermStates()
          
 AgreementStateType getState()
          
 TermTreeType getTerms()
          
 void run()
          
 void terminate(TerminateInputType terminateReason)
          Terminates an agreement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PendingAgreementFacade

public PendingAgreementFacade(AgreementOffer offer,
                              AgreementFactory factory,
                              AgreementAcceptanceClient client)
Implementation of a pending agreement facade. The agreement creation is started in a separate process. As long as the agreement creation is in progress, the facades represents the pending agreement. If the agreement creation is successful, the pending agreement is replaced with the real one created by the WSAG4J engine. This is an implementation of the state pattern (GOF).

Parameters:
offer - the agreement offer
factory - the agreement factory
client - the agreement acceptance client
Method Detail

run

public void run()

Specified by:
run in interface Runnable
See Also:
Runnable.run()

getAgreementId

public String getAgreementId()
Returns the agreement id.

Specified by:
getAgreementId in interface Agreement
Returns:
the agreement id

getContext

public AgreementContextType getContext()

Specified by:
getContext in interface Agreement
Returns:
the agreement context

getGuaranteeTermStates

public GuaranteeTermStateType[] getGuaranteeTermStates()

Specified by:
getGuaranteeTermStates in interface Agreement
Returns:
the agreement guarantee term states

getName

public String getName()
Returns the agreement name.

Specified by:
getName in interface Agreement
Returns:
the agreement name

getServiceTermStates

public ServiceTermStateType[] getServiceTermStates()

Specified by:
getServiceTermStates in interface Agreement
Returns:
the agreement service term states

getState

public AgreementStateType getState()

Specified by:
getState in interface Agreement
Returns:
the agreement state

getTerms

public TermTreeType getTerms()

Specified by:
getTerms in interface Agreement
Returns:
the agreement terms

terminate

public void terminate(TerminateInputType terminateReason)
Terminates an agreement.

Specified by:
terminate in interface Agreement
Parameters:
terminateReason - termination reason

getAgreementInstance

public AbstractAgreementType getAgreementInstance()
Returns a domain-specific agreement implementation. The AbstractAgreementType implements the domain-specific termination method and stored the agreement properties. The AbstractAgreementType.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.

Specified by:
getAgreementInstance in interface Agreement
Returns:
the agreement implementation


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