|
||||||||||
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.DatabasePersistentAgreement
public class DatabasePersistentAgreement
Database-related implementation of the PersistentAgreement
interface. This implementation uses
PersistentAgreementContainer
instances to rebuild the original agreement and provides a transparent
access to the stored informations.
During object instantiation an existing PersistentAgreementContainer
instance is used to rebuild
the agreement or an agreement itself is passed to the constructor. In the second case a
PersistentAgreementContainer
instance is created and stored, to initially persist the agreement.
Field Summary | |
---|---|
protected MonitorableAgreement |
agreement
The MonitorableAgreement wraps the domain specific agreement implementation that inherits from
AbstractAgreementType . |
static String |
AGREEMENT_CONTEXT_ENTRY
Data associated with an agreement instance is stored in the database under a unique identifier. |
static String |
AGREEMENT_PROPERTIES_ENTRY
Data associated with an agreement instance is stored in the database under a unique identifier. |
protected String |
agreementFactoryId
The factory resource id. |
protected PersistentAgreementContainer |
persistentAgreementContainer
This container stores the agreement resource properties document and the agreement execution properties in the database. |
Constructor Summary | |
---|---|
DatabasePersistentAgreement(PersistentAgreementContainer persistentAgreementContainer,
String agreementFactoryId)
Uses an existing PersistentAgreementContainer instance to instantiate the persisted agreement. |
Method Summary | |
---|---|
Agreement |
getAgreement()
|
EndpointReferenceType |
getAgreementEPR()
Deprecated. |
String |
getAgreementId()
Returns the agreement id. |
AbstractAgreementType |
getAgreementInstance()
Returns a domain-specific agreement implementation. |
AgreementContextType |
getContext()
|
GuaranteeTermStateType[] |
getGuaranteeTermStates()
|
String |
getName()
Returns the agreement name. |
PersistentAgreementContainer |
getPersistentAgreementContainer()
|
ServiceTermStateType[] |
getServiceTermStates()
|
AgreementStateType |
getState()
|
TermTreeType |
getTerms()
|
static DatabasePersistentAgreement |
insertAgreement(Agreement agreement,
String agreementFactoryId)
Inserts an agreement in the database. |
void |
load()
Load an agreement based on the persisted information, the PersistentAgreementContainer
instance. |
void |
save()
Handles the save-operation of an agreement. |
void |
terminate(TerminateInputType reason)
Terminates an agreement. |
void |
update(Observable o,
Object arg)
Retrieves state change notifications of the concrete agreement implementation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String AGREEMENT_CONTEXT_ENTRY
public static final String AGREEMENT_PROPERTIES_ENTRY
protected MonitorableAgreement agreement
MonitorableAgreement
wraps the domain specific agreement implementation that inherits from
AbstractAgreementType
. After reload all agreement instances are wrapped with a
MonitorableAgreement
. in case monitoring was active it will be restarted, otherwise the
MonitorableAgreement
acts as an isolation layer to the concrete implementation, i.e. all calls
are simply delegated to the concrete implementation.
protected PersistentAgreementContainer persistentAgreementContainer
AbstractAgreementType.getXMLObject()
AbstractAgreementType.getExecutionContext()
protected String agreementFactoryId
Constructor Detail |
---|
public DatabasePersistentAgreement(PersistentAgreementContainer persistentAgreementContainer, String agreementFactoryId)
PersistentAgreementContainer
instance to instantiate the persisted agreement.
The initialization itself is delegated to the load()
method. Use this constructor to load an
existing agreement instance.
persistentAgreementContainer
- Instance storing all the agreement-related information.agreementFactoryId
- ID of the agreement factory, used to build and deploy this agreement.Method Detail |
---|
public static DatabasePersistentAgreement insertAgreement(Agreement agreement, String agreementFactoryId) throws AgreementFactoryException
agreement
- the agreement to persistagreementFactoryId
- the id of the factory that created the agreement
AgreementFactoryException
- failed to insert agreement in the databasepublic GuaranteeTermStateType[] getGuaranteeTermStates()
getGuaranteeTermStates
in interface Agreement
MonitorableAgreement.getGuaranteeTermStates()
public String getAgreementId()
getAgreementId
in interface Agreement
MonitorableAgreement.getAgreementId()
public AgreementContextType getContext()
getContext
in interface Agreement
MonitorableAgreement.getContext()
public String getName()
getName
in interface Agreement
MonitorableAgreement.getName()
public ServiceTermStateType[] getServiceTermStates()
getServiceTermStates
in interface Agreement
MonitorableAgreement.getServiceTermStates()
public AgreementStateType getState()
getState
in interface Agreement
MonitorableAgreement.getState()
public TermTreeType getTerms()
getTerms
in interface Agreement
MonitorableAgreement.getTerms()
public AbstractAgreementType getAgreementInstance()
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.
getAgreementInstance
in interface Agreement
MonitorableAgreement.getAgreementInstance()
public void terminate(TerminateInputType reason)
terminate
in interface Agreement
reason
- termination reasonMonitorableAgreement.terminate(org.ogf.schemas.graap.wsAgreement.TerminateInputType)
public void load() throws Exception
Load an agreement based on the persisted information, the PersistentAgreementContainer
instance. All information packages in the PersistenceAgreementContextType
instance is loaded
and used to re-build the original XML documents.
The result of this load-operation is a MonitorableAgreement
instance stored in the
agreement
variable.
load
in interface PersistentAgreement
Exception
- indicates an exception while loading the agreement from the databasepublic void save() throws Exception
Handles the save-operation of an agreement. All required information (the current version/state of the
information) are capsuled in the agreement-related PersistentAgreementContainer
instance, which
then is stored in the database.
If the agreement was already persisted, the existing persisted agreement is replaced with the new version. If not, the agreement is initially persisted. The decision is based on the existence of a database-record with the same agreement id.
Saves/persistes an agreement.
save
in interface PersistentAgreement
Exception
- indicates an exception while saving the agreement to the databasepublic Agreement getAgreement()
getAgreement
in interface PersistentAgreement
@Deprecated public EndpointReferenceType getAgreementEPR()
getAgreementEPR
in interface PersistentAgreement
public PersistentAgreementContainer getPersistentAgreementContainer()
public void update(Observable o, Object arg)
update
in interface Observer
Observer.update(java.util.Observable, java.lang.Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |