|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ogf.graap.wsag.server.actions.impl.AgreementFactoryAction
public class AgreementFactoryAction
This class implements a WSAG4J agreement factory action. A factory action contains a set of strategies to generate an agreement template, to negotiate offers based on this template and to create agreements based on the template. The strategies are configured in the WSAG4J engine configuration file.
IGetTemplateAction
,
INegotiationAction
,
ICreateAgreementAction
Constructor Summary | |
---|---|
AgreementFactoryAction(IGetTemplateAction templateAction,
ICreateAgreementAction createAgreementAction,
INegotiationAction negotiationAction)
Creates a new AgreementFactoryAction . |
Method Summary | |
---|---|
Agreement |
createAgreement(AgreementOffer offer,
Map<String,Object> context)
Invokes the create agreement strategy implemented by the ICreateAgreementAction which is set
for this action |
ImplementationConfigurationType |
getActionConfiguration()
Returns the configuration of this particular AgreementFactoryAction
instance.
|
WsagEngine |
getEngine()
Returns the WSAG4J engine instance for this handler. |
AgreementFactoryContext |
getFactoryContext()
Allows implementations to access the context of the agreement factory in which this action was deployed. |
String |
getName()
|
INegotiationAction |
getNegotiationAction()
|
AgreementTemplateType |
getTemplate()
Returns the agreement template associated with this factory action. |
void |
initialize()
Initializes the action. |
boolean |
isNegotiationSupported()
Indicates whether this action supports agreement negotiation or not. |
boolean |
isUsingSession()
|
NegotiationOfferType[] |
negotiate(NegotiationOfferType quote,
Map<String,Object> context)
Implements the negotiation strategy for offers that are based on the template associated with this action. |
void |
setActionConfiguration(ImplementationConfigurationType configuration)
Sets the configuration for this object. |
void |
setCreateAgreementAction(ICreateAgreementAction createAgreement)
Sets the SLA creation strategy for this factory action. |
void |
setEngine(WsagEngine engine)
Sets the WSAG4J engine instance for this handler. |
void |
setFactoryContext(AgreementFactoryContext factoryContext)
|
void |
setGetTemplateAction(IGetTemplateAction templateAction)
Sets the template creation strategy for this factory action. |
void |
setName(String name)
|
void |
setNegotiationAction(INegotiationAction negotiationAction)
Sets the negotiation strategy for this factory action. |
void |
setUseSession(boolean useSession)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AgreementFactoryAction(IGetTemplateAction templateAction, ICreateAgreementAction createAgreementAction, INegotiationAction negotiationAction)
AgreementFactoryAction
.
templateAction
- The IGetTemplateAction
that is called to generate the agreement template for this
AgreementFactoryAction
.createAgreementAction
- The ICreateAgreementAction
that is called when an agreement is created based on the
template generated by this AgreementFactoryAction
.negotiationAction
- The negotiation action that is called when a negotiation offer based on the agreement
template provided by this action was received.Method Detail |
---|
public boolean isNegotiationSupported()
NegotiationUnsupportedAction
setNegotiationAction(INegotiationAction)
public void setGetTemplateAction(IGetTemplateAction templateAction)
templateAction
- the template creation strategy to setpublic void setCreateAgreementAction(ICreateAgreementAction createAgreement)
createAgreement
- the agreement creation strategy to setpublic void setNegotiationAction(INegotiationAction negotiationAction)
negotiationAction
- the negotiation action to setpublic void initialize() throws ActionInitializationException
initialize
in interface IAction
ActionInitializationException
IAction.initialize()
public AgreementTemplateType getTemplate()
AgreementTemplateType
public Agreement createAgreement(AgreementOffer offer, Map<String,Object> context) throws AgreementFactoryException
ICreateAgreementAction
which is set
for this action
offer
- the offer for which an agreement should be createdcontext
- factory invocation context
ICreateAgreementAction
AgreementFactoryException
- the exception thrown by the ICreateAgreementAction
setCreateAgreementAction(ICreateAgreementAction)
public NegotiationOfferType[] negotiate(NegotiationOfferType quote, Map<String,Object> context) throws NegotiationException
quote
- the quote to negotiatecontext
- implementation specific context
NegotiationException
- An exception thrown by the negotiation strategy. See
setNegotiationAction(INegotiationAction)
.INegotiationAction
public boolean isUsingSession()
AgreementFactoryAction
is session aware. false - otherwisepublic void setUseSession(boolean useSession)
useSession
- Specifies whether an AgreementFactoryAction
is session aware or not.public String getName()
public void setName(String name)
name
- Sets the name for this AgreementFactoryAction
.public ImplementationConfigurationType getActionConfiguration()
AgreementFactoryAction
instance.
getActionConfiguration
in interface IAction
AgreementFactoryAction
instance.public void setActionConfiguration(ImplementationConfigurationType configuration)
setActionConfiguration
in interface IAction
configuration
- The AgreementFactoryAction
configuration to set.public AgreementFactoryContext getFactoryContext()
getFactoryContext
in interface IAction
public void setFactoryContext(AgreementFactoryContext factoryContext)
setFactoryContext
in interface IAction
factoryContext
- the factoryContext to setpublic INegotiationAction getNegotiationAction()
public WsagEngine getEngine()
IAction
getEngine
in interface IAction
public void setEngine(WsagEngine engine)
IAction
setEngine
in interface IAction
engine
- the engine instance
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |