|
||||||||||
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.AbstractWSAG4JPersistence
public abstract class AbstractWSAG4JPersistence
Abstract implementation of an agreement factory home. This implementation provides global configuration-related functions as well as it is responsible to find and load the agreement factory prototype (based on the configuration).
All implementations of the IAgreementFactoryHome
interface should extend this abstract
implementation.
Field Summary | |
---|---|
protected WSAG4JEngineConfigurationType |
wsag4jConfiguration
the wsag4j engine configuration |
Constructor Summary | |
---|---|
AbstractWSAG4JPersistence()
|
Method Summary | |
---|---|
protected abstract PersistentAgreementFactory[] |
doLoad()
Loads the agreement factories for this persistence layer. |
protected abstract boolean |
doRemove(PersistentAgreementFactory factory)
Removes a persistent factory from the persistence layer. |
PersistentAgreementFactory |
find(String agreementFactoryId)
Lists the agreement for the factory with the given id. |
protected IAgreementFactory |
getAgreementFactoryPrototype(WSAG4JEngineConfigurationType configuration)
|
WSAG4JEngineConfigurationType |
getEngineConfiguration()
returns the configuration of the wsag4j engine |
boolean |
hasChanged()
Indicates that the persistence layer has changed and needs to be re-initialized (see initialize() ). |
void |
initialize()
|
PersistentAgreementFactory[] |
list()
Lists all agreement factories. |
void |
remove(String factoryId)
Removes the factory with the given ID. |
void |
setChanged(boolean changed)
Sets the flag to indicate that the persistence layer has changed and needs to be re-initialized (see initialize() ). |
void |
setEngineConfiguration(WSAG4JEngineConfigurationType configuration)
sets the configuration of the wsag4j engine |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.ogf.graap.wsag.server.persistence.IAgreementFactoryHome |
---|
saveAgreementFactories |
Field Detail |
---|
protected WSAG4JEngineConfigurationType wsag4jConfiguration
Constructor Detail |
---|
public AbstractWSAG4JPersistence()
Method Detail |
---|
protected abstract PersistentAgreementFactory[] doLoad() throws PersistedResourceException
initialize()
) or during a
find(String)
, list()
or remove(String)
operation
PersistedResourceException
- indicates an error while loading the persistent factoriesprotected abstract boolean doRemove(PersistentAgreementFactory factory) throws PersistedResourceException
factory
- the factory to remove
true
if the factory was removed, otherwise false
PersistedResourceException
- indicates an error while removing the factorypublic WSAG4JEngineConfigurationType getEngineConfiguration()
IEngineComponent
getEngineConfiguration
in interface IEngineComponent
public void setEngineConfiguration(WSAG4JEngineConfigurationType configuration)
IEngineComponent
setEngineConfiguration
in interface IEngineComponent
configuration
- The configuration used to initialize this agreement factory home instance.public boolean hasChanged()
initialize()
).
true
if the persistence layer needs to be reloaded, otherwise false
.public void setChanged(boolean changed)
initialize()
).
changed
- true
if the persistence layer needs to be reloaded, otherwise
false
protected IAgreementFactory getAgreementFactoryPrototype(WSAG4JEngineConfigurationType configuration) throws Exception
configuration
- Configuration of the wsag4j engine.
Exception
- failed to initialize the configured factorypublic void initialize() throws Exception
initialize
in interface IEngineComponent
Exception
- Indicates an error while initializing the engine component.public PersistentAgreementFactory find(String agreementFactoryId) throws Exception
find
in interface IAgreementFactoryHome
agreementFactoryId
- the id of the factory for which the agreements are listed
Exception
- indicates an error while looking up the factory at the persistence layerpublic PersistentAgreementFactory[] list() throws Exception
list
in interface IAgreementFactoryHome
Exception
- indicates an exception while loading the factories from the databasepublic void remove(String factoryId) throws Exception
remove
in interface IAgreementFactoryHome
factoryId
- ID of the factory to remove.
Exception
- indicates an exception while removing the factory from the database
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |