org.ogf.graap.wsag.api
Interface AgreementFactory

All Known Subinterfaces:
IAgreementFactory, PersistentAgreementFactory, WsPersistentAgreementFactory
All Known Implementing Classes:
AbstractAgreementFactory, AbstractPersistentAgreementFactory, AgreementFactoryFacade, DatabasePersistentAgreementFactory, GenericAgreementFactory, SampleAgreementFactory, SimplePersistentAgreementFactory, WsDatabaseAgreementFactory

public interface AgreementFactory

This interface defines the operations of an AgreementFactory. Components can query the supported templates of a factory, initiate negotiation processes and create new agreements using this interface.

Author:
Oliver Waeldrich
See Also:
Agreement

Method Summary
 Agreement createAgreement(AgreementOffer offer, Map<String,Object> context)
          Creates a new agreement based on an offer.
 Agreement createPendingAgreement(AgreementOffer offer, PendingAgreementListener listener, Map<String,Object> context)
          Creates a new pending agreement based on an offer.
 AgreementFactoryContext getFactoryContext()
          Returns the factory context.
 AgreementTemplateType[] getTemplates()
           
 Negotiation initiateNegotiation(NegotiationContextType context, org.apache.xmlbeans.XmlObject[] criticalExtensions, org.apache.xmlbeans.XmlObject[] nonCriticalExtensions, Map<String,Object> environment)
          Initializes a new negotiation instance.
 void setFactoryContext(AgreementFactoryContext context)
          Sets the factory context.
 

Method Detail

getTemplates

AgreementTemplateType[] getTemplates()
Returns:
the agreement templates exposed by this factory

createAgreement

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

Parameters:
offer - agreement offer
context - invocation context
Returns:
the created agreement instance
Throws:
AgreementFactoryException - Indicates that the agreement offer was rejected or another fault occurred.

createPendingAgreement

Agreement createPendingAgreement(AgreementOffer offer,
                                 PendingAgreementListener listener,
                                 Map<String,Object> context)
                                 throws AgreementFactoryException
Creates a new pending agreement based on an offer.

Parameters:
offer - agreement offer
context - invocation context
listener - the listener, when provided, receives the agreement acceptance events once the creation process is finished
Returns:
the created agreement instance
Throws:
AgreementFactoryException - Indicates that the agreement offer was rejected or another fault occurred.

initiateNegotiation

Negotiation initiateNegotiation(NegotiationContextType context,
                                org.apache.xmlbeans.XmlObject[] criticalExtensions,
                                org.apache.xmlbeans.XmlObject[] nonCriticalExtensions,
                                Map<String,Object> environment)
                                throws NegotiationFactoryException
Initializes a new negotiation instance. This method creates a new negotiation instance based on the provided negotiation context, taking into account the critical and non-critical extensions.

Parameters:
context - The negotiation context defines the roles and obligations of the negotiating parties. Furthermore, it defines the nature of the negotiation process (e.g. negotiation or re-negotiation).
criticalExtensions - Critical extensions must be supported during the negotiation process. If a critical extension is not understood or supported by the negotiation factory, it must throw an @see NegotiationFactoryException.
nonCriticalExtensions - Non-critical extensions should be supported during the negotiation process. If a non-critical extension is not understood or supported by the negotiation factory, it can be ignored. Alternatively, an @see NegotiationFactoryException could be thrown.
environment - Provides access to additional variables provided by the calling instance. These environment variables are domain specific.
Returns:
the new initiated negotiation instance
Throws:
NegotiationFactoryException - indicates that an error occurred while instantiating the negotiation process

getFactoryContext

AgreementFactoryContext getFactoryContext()
Returns the factory context.

Returns:
the context for this agreement factory

setFactoryContext

void setFactoryContext(AgreementFactoryContext context)
Sets the factory context.

Parameters:
context - sets the context for this agreement factory


Copyright © 2008-2012. All Rights Reserved.