org.ogf.graap.wsag.wsrf
Class WSAG4JPersistenceFacade

java.lang.Object
  extended by org.ogf.graap.wsag.wsrf.WSAG4JPersistenceFacade
All Implemented Interfaces:
IAgreementFactoryHome

public class WSAG4JPersistenceFacade
extends Object
implements IAgreementFactoryHome

Author:
owaeld

Field Summary
protected  List<PersistentAgreementFactory> factoriesOL
          An ordered list with the available agreement factories.
protected  Map<String,PersistentAgreementFactory> persistentFactories
          A map that contains the available persistent agreement factory which are identified by their factory id.
 
Constructor Summary
WSAG4JPersistenceFacade(WsagEngine[] engines)
          Creates a new facade for the given WSAG4J engines.
 
Method Summary
 PersistentAgreementFactory find(String factoryId)
          looks up a factory with the given id.
 WsagEngine[] getEngines()
          Returns the WSAG4J engine instances used by this facade.
 void initialize()
           
 PersistentAgreementFactory[] list()
          Lists all agreement factories.
 void remove(String factoryId)
          Removes the factory with the given ID.
 void save()
          Saves all factories.
 void saveAgreementFactories(PersistentAgreementFactory[] factories)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

persistentFactories

protected Map<String,PersistentAgreementFactory> persistentFactories
A map that contains the available persistent agreement factory which are identified by their factory id.


factoriesOL

protected List<PersistentAgreementFactory> factoriesOL
An ordered list with the available agreement factories. The factories are stored in the order they were retrieved from the persistence layer.

Constructor Detail

WSAG4JPersistenceFacade

public WSAG4JPersistenceFacade(WsagEngine[] engines)
Creates a new facade for the given WSAG4J engines.

Parameters:
engines - the available WSAG4J engines
Method Detail

initialize

public void initialize()
See Also:
IAgreementFactoryHome#initialize()

find

public PersistentAgreementFactory find(String factoryId)
                                throws Exception
looks up a factory with the given id.

Specified by:
find in interface IAgreementFactoryHome
Parameters:
factoryId - the id of the factory to find
Returns:
the factory
Throws:
Exception - an error occurred while looking up the factory.
See Also:
IAgreementFactoryHome.find(String)

list

public PersistentAgreementFactory[] list()
                                  throws Exception
Description copied from interface: IAgreementFactoryHome
Lists all agreement factories.

Specified by:
list in interface IAgreementFactoryHome
Returns:
all available persistent factories
Throws:
Exception - indicates an error while generating the factory list
See Also:
IAgreementFactoryHome.list()

remove

public void remove(String factoryId)
            throws Exception
Description copied from interface: IAgreementFactoryHome
Removes the factory with the given ID.

Specified by:
remove in interface IAgreementFactoryHome
Parameters:
factoryId - removes the factory with the given id from the persistence layer
Throws:
Exception - an error occurred while removing the factory
See Also:
IAgreementFactoryHome.remove(java.lang.String)

save

public void save()
          throws Exception
Saves all factories.

Throws:
Exception - indicates an error while saving the factories

saveAgreementFactories

public void saveAgreementFactories(PersistentAgreementFactory[] factories)
                            throws Exception
Specified by:
saveAgreementFactories in interface IAgreementFactoryHome
Parameters:
factories - the factories to save
Throws:
Exception - indicates an error while saving the factories
See Also:
IAgreementFactoryHome.saveAgreementFactories(org.ogf.graap.wsag.server.persistence.PersistentAgreementFactory[])

getEngines

public WsagEngine[] getEngines()
Returns the WSAG4J engine instances used by this facade.

Returns:
the engine instances


Copyright © 2008-2012. All Rights Reserved.