org.ogf.graap.wsag.server.persistence.impl
Class DatabaseAgreementHome

java.lang.Object
  extended by org.ogf.graap.wsag.server.persistence.impl.DatabaseAgreementHome
All Implemented Interfaces:
IAgreementHome

public class DatabaseAgreementHome
extends Object
implements IAgreementHome

Facade for all agreement factories known to the WSAG4J engine.

Database-based implementation of an agreement home. This implementation encapsulates the retrieval of persisted agreements, the re-building of persisted agreements and the deletion of persisted agreements in case of an agreement removal.

Persisted agreements are encapsulated and stored in PersistentAgreementContainer objects. These objects store all agreement-related information and are used to re-build the original agreement. To access the information stored in such a container, DatabasePersistentAgreement instances are used. This class is able to provide a transparent access and processing of the required information.

Author:
T.Weuffel

Constructor Summary
DatabaseAgreementHome(IAgreementFactoryHome factoryHome)
           
 
Method Summary
 PersistentAgreement find(String agreementId)
          Finds an agreement with a given ID.
 PersistentAgreement[] list()
          Lists all agreements.
 PersistentAgreement[] list(String agreementFactoryId)
          Lists all agreements for one specific agreement factory.
 void remove(String agreementId)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseAgreementHome

public DatabaseAgreementHome(IAgreementFactoryHome factoryHome)
Parameters:
factoryHome - the the factory home for resolving and removing the agreement instances.
Method Detail

find

public PersistentAgreement find(String agreementId)
                         throws PersistedResourceException
Finds an agreement with a given ID.

Specified by:
find in interface IAgreementHome
Parameters:
agreementId - the ID of the agreement
Returns:
the agreement
Throws:
PersistedResourceException - indicates an exception while loading the agreement from the database

list

public PersistentAgreement[] list()
                           throws Exception
Lists all agreements.

Specified by:
list in interface IAgreementHome
Returns:
List of all agreements.
Throws:
Exception - indicates an exception while loading the agreements from the database

list

public PersistentAgreement[] list(String agreementFactoryId)
                           throws Exception
Lists all agreements for one specific agreement factory.

Specified by:
list in interface IAgreementHome
Parameters:
agreementFactoryId - the id of the factory for which the agreements should be listed
Returns:
a list of all agreements for a specified agreement factory
Throws:
Exception - indicates an exception while loading the agreements from the database

remove

public void remove(String agreementId)
            throws PersistedResourceException
Deprecated. 

This method should not be used as this class is a facade. Removes the agreement with the given id.

Specified by:
remove in interface IAgreementHome
Parameters:
agreementId - the ID of the agreement, which should be removed
Throws:
PersistedResourceException - indicates an exception while removing the agreement from the database
See Also:
IAgreementHome.remove(String)


Copyright © 2008-2012. All Rights Reserved.