|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ogf.graap.wsag.server.persistence.impl.AbstractPersistentAgreementFactory
public abstract class AbstractPersistentAgreementFactory
A persistent factory can list all agreements that it has created, even after system restart. Agreement creation itself is handles by a delegate, i.e. the factory class that is configured in the wsag4j config file.
Field Summary | |
---|---|
protected AgreementFactory |
factory
The factory implementation that handles agreement creation. |
protected String |
resourceId
The resource id of the factory. |
Constructor Summary | |
---|---|
AbstractPersistentAgreementFactory(AgreementFactory factory)
|
Method Summary | |
---|---|
void |
addAgreement(Agreement agreement,
EndpointReferenceType agreementEpr)
Persists a new created agreement instance |
Agreement |
createAgreement(AgreementOffer offer)
Creates a new agreement instance. |
protected abstract PersistentAgreement[] |
doLoad()
Loads all agreements that were created by this factory. |
protected abstract void |
doRemove(PersistentAgreement toRemove)
Removes an agreement from the persistence layer |
PersistentAgreement |
find(String agreementId)
Finds an agreement with a given ID. |
AgreementFactory |
getAgreementFactory()
|
String |
getResourceId()
|
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. |
PersistentAgreement[] |
list()
Lists all agreements. |
PersistentAgreement[] |
list(String agreementFactoryId)
Lists all agreements for one specific agreement factory. |
void |
load()
loads the factory instance |
protected abstract PersistentAgreement |
persistAgreement(Agreement agreement)
Persists the given agreement instance. |
void |
remove(String agreementId)
Removes the agreement with the given id. |
void |
save()
saves the factory instance |
void |
setResourceId(String resourceId)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected AgreementFactory factory
protected String resourceId
Constructor Detail |
---|
public AbstractPersistentAgreementFactory(AgreementFactory factory)
factory
- the delegation target for the AgreementFactory
calls. This is typically an instance
of GenericAgreementFactory
.Method Detail |
---|
public AgreementFactory getAgreementFactory()
getAgreementFactory
in interface PersistentAgreementFactory
protected abstract PersistentAgreement persistAgreement(Agreement agreement) throws PersistedResourceException
agreement
- the agreement to persist
PersistedResourceException
- indicates that an error occurred while persisting the agreementprotected abstract PersistentAgreement[] doLoad() throws PersistedResourceException
PersistedResourceException
- indicates an error while loading the agreements from the persistence layerprotected abstract void doRemove(PersistentAgreement toRemove) throws PersistedResourceException
toRemove
- the agreement to remove
PersistedResourceException
- indicates that the agreement could not be removed from the persistence layerpublic Agreement createAgreement(AgreementOffer offer) throws AgreementFactoryException
createAgreement
in interface AgreementFactory
offer
- the agreement offer
AgreementFactoryException
- indicates that the agreement offer was rejected or any other error while creating the
agreement.AgreementFactory.createAgreement(org.ogf.graap.wsag.api.AgreementOffer)
public void addAgreement(Agreement agreement, EndpointReferenceType agreementEpr)
addAgreement
in interface PersistentAgreementFactory
agreement
- the agreement instance to addagreementEpr
- the external reference for this agreementaddAgreement(org.ogf.graap.wsag.api.Agreement,
org.w3.x2005.x08.addressing.EndpointReferenceType)
public void load() throws Exception
load
in interface PersistentAgreementFactory
Exception
- indicates an exception while loading the agreement factory from the databasePersistentAgreementFactory.load()
public void save() throws Exception
save
in interface PersistentAgreementFactory
Exception
- indicates an exception while saving the agreement to the databasePersistentAgreementFactory.save()
public PersistentAgreement[] list()
list
in interface IAgreementHome
IAgreementHome.list()
public PersistentAgreement[] list(String agreementFactoryId) throws Exception
list
in interface IAgreementHome
agreementFactoryId
- the id of the factory for which the agreements should be listed
Exception
- indicates an exception while loading the agreements from the databaseIAgreementHome.list(java.lang.String)
public PersistentAgreement find(String agreementId) throws PersistedResourceException
find
in interface IAgreementHome
agreementId
- the ID of the agreement
PersistedResourceException
- indicates an exception while loading the agreement from the databaseIAgreementHome.find(java.lang.String)
public void remove(String agreementId) throws PersistedResourceException
remove
in interface IAgreementHome
agreementId
- the ID of the agreement, which should be removed
PersistedResourceException
- indicates an exception while removing the agreement from the databaseIAgreementHome.remove(java.lang.String)
public String getResourceId()
getResourceId
in interface PersistentAgreementFactory
public void setResourceId(String resourceId)
resourceId
- the resourceId to setpublic AgreementTemplateType[] getTemplates()
getTemplates
in interface AgreementFactory
AgreementFactory.getTemplates()
public Negotiation initiateNegotiation(NegotiationContextType context, org.apache.xmlbeans.XmlObject[] criticalExtensions, org.apache.xmlbeans.XmlObject[] nonCriticalExtensions, Map<String,Object> environment) throws NegotiationFactoryException
initiateNegotiation
in interface AgreementFactory
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.
NegotiationFactoryException
- indicates that an error occurred while instantiating the negotiation process
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |