org.ogf.graap.wsag.server.actions
Class AbstractCreateAgreementAction

java.lang.Object
  extended by org.ogf.graap.wsag.server.actions.AbstractCreateAgreementAction
All Implemented Interfaces:
IActionHandler, ICreateAgreementAction
Direct Known Subclasses:
CreatePendingAgreementAction, CreatePendingAgreementWithNotificationAction, ExampleCreateAgreementAction, Sample1CreateAgreementAction, Sample2CreateAgreementAction, SampleCreateAgreementAction, SampleMonitoredAgreementAction

public abstract class AbstractCreateAgreementAction
extends Object
implements ICreateAgreementAction

AbstractCreateAgreementAction Abstract base class for agreement creation actions.

Author:
Oliver Waeldrich , Oliver Waeldrich

Constructor Summary
AbstractCreateAgreementAction()
           
 
Method Summary
 Agreement createAgreement(AgreementOffer offer)
          Compatibility method to support old agreement actions.
 Agreement createAgreement(AgreementOffer offer, Map<String,Object> context)
          Creates a new agreement based on an offer.
 IActionHandlerContext getHandlerContext()
          Returns the context of this action handler.
 void initialize()
          Default implementation of action initialization.
 void setHandlerContext(IActionHandlerContext context)
          Sets the context for this action handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCreateAgreementAction

public AbstractCreateAgreementAction()
Method Detail

getHandlerContext

public IActionHandlerContext getHandlerContext()
Returns the context of this action handler.

Specified by:
getHandlerContext in interface IActionHandler
Returns:
the current handler context

setHandlerContext

public void setHandlerContext(IActionHandlerContext context)
Sets the context for this action handler. Sets the context for this action handler.

Specified by:
setHandlerContext in interface IActionHandler
Parameters:
context - Sets the context for this handler instance. A handler uses the context i.e. to look up the handler configuration during initialization.
See Also:
IActionHandlerContext

initialize

public void initialize()
                throws ActionInitializationException
Default implementation of action initialization. Subclasses may overwrite this method in order to provide a custom initialization of a handler. Initializes an action handler. This method is called when a agreement factory action initializes its action handlers. It is called once during the the engine initialization.

Specified by:
initialize in interface IActionHandler
Throws:
ActionInitializationException - Indicates an error during handler initialization.

createAgreement

public Agreement createAgreement(AgreementOffer offer,
                                 Map<String,Object> context)
                          throws AgreementFactoryException
Creates a new agreement based on an offer.

Specified by:
createAgreement in interface ICreateAgreementAction
Parameters:
offer - the offer to create an agreement for
context - factory invocation context
Returns:
the created agreement
Throws:
AgreementFactoryException - indicates that the agreement offer was rejected or a factory fault occurred.

createAgreement

public Agreement createAgreement(AgreementOffer offer)
                          throws AgreementFactoryException
Compatibility method to support old agreement actions. The invocation context is not passed to the action.

Parameters:
offer - the offer to create an agreement for
Returns:
the created agreement
Throws:
AgreementFactoryException - indicates that the agreement offer was rejected or a factory fault occurred.


Copyright © 2008-2012. All Rights Reserved.