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

java.lang.Object
  extended by org.ogf.graap.wsag.server.persistence.impl.PersistentAgreementContainer

@Entity
public class PersistentAgreementContainer
extends Object

Entity class for the agreement persistence. It defines the entity fields (the tables' columns), the named-queries used to access the stored data, and the corresponding getter/setter methods.

Author:
T.Weuffel

Constructor Summary
PersistentAgreementContainer()
          The default constructor is required by the JPA2 environment.
PersistentAgreementContainer(Agreement agreement, String factoryId)
          Creates a new PersistentAgreementContainer for the given agreement and agreement factory id.
 
Method Summary
static PersistentAgreementContainer createContainer(Agreement agreement, String factoryId)
          Creates a new persistent container that stores the agreement properties document and the agreement execution context.
 void deleteContainer()
          Deletes this container instance.
 String getAgreementClassName()
           
 String getAgreementFactoryId()
           
 String getAgreementId()
           
 PersistenceAgreementContextType getPersistedAgreementContextType()
           
 AgreementStateType getState()
           
static PersistentAgreementContainer[] listContainers()
          Creates a list of all persistent agreement containers.
static PersistentAgreementContainer[] listContainers(String agreementFactoryId)
          Lists all persistent agreement containers for a given factory
static PersistentAgreementContainer loadContainer(String agreementId)
          Loads a persistent container for the given agreement id and agreement factory id.
static PersistentAgreementContainer loadContainer(String agreementId, String agreementFactoryId)
          Loads a persistent container for the given agreement id and agreement factory id.
 void saveContainer()
          Save the container instance.
 void setAgreementClassName(String agreementClassName)
           
 void setAgreementFactoryId(String agreementFactoryId)
           
 void setPersistedAgreementContextType(PersistenceAgreementContextType persistenceAgreementContextType)
           
 void setState(AgreementStateType state)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PersistentAgreementContainer

public PersistentAgreementContainer()
The default constructor is required by the JPA2 environment. It is used to instantiate an instance of this entity. All values are then passed to this instance by setter-injection.


PersistentAgreementContainer

public PersistentAgreementContainer(Agreement agreement,
                                    String factoryId)
Creates a new PersistentAgreementContainer for the given agreement and agreement factory id.

Parameters:
agreement - the agreement for which the container will be created
factoryId - the id of the factory that created the agreement
Method Detail

getAgreementId

public String getAgreementId()
Returns:
the agreement id

getAgreementFactoryId

public String getAgreementFactoryId()
Returns:
the agreement factory id

setAgreementFactoryId

public void setAgreementFactoryId(String agreementFactoryId)
Parameters:
agreementFactoryId - the factory id to set

getState

public AgreementStateType getState()
Returns:
the agreement state

setState

public void setState(AgreementStateType state)
Parameters:
state - the agreement state to set

getAgreementClassName

public String getAgreementClassName()
Returns:
the agreement implementation class name

setAgreementClassName

public void setAgreementClassName(String agreementClassName)
Parameters:
agreementClassName - the agreement implementation class name to set

getPersistedAgreementContextType

public PersistenceAgreementContextType getPersistedAgreementContextType()
Returns:
the context of the persistent agreement

setPersistedAgreementContextType

public void setPersistedAgreementContextType(PersistenceAgreementContextType persistenceAgreementContextType)
Parameters:
persistenceAgreementContextType - the context of the persistent agreement to set

createContainer

public static PersistentAgreementContainer createContainer(Agreement agreement,
                                                           String factoryId)
                                                    throws AgreementFactoryException
Creates a new persistent container that stores the agreement properties document and the agreement execution context.

Parameters:
agreement - the agreement
factoryId - the id of the factory that created the agreement
Returns:
the persistent container
Throws:
AgreementFactoryException - indicates that the persistent container could not be created

loadContainer

public static PersistentAgreementContainer loadContainer(String agreementId,
                                                         String agreementFactoryId)
                                                  throws AgreementFactoryException
Loads a persistent container for the given agreement id and agreement factory id.

Parameters:
agreementId - the id of the agreement to load
agreementFactoryId - the id of the factory that created the agreement
Returns:
the persistent container
Throws:
AgreementFactoryException - indicates that the agreement could not be loaded

loadContainer

public static PersistentAgreementContainer loadContainer(String agreementId)
                                                  throws AgreementFactoryException
Loads a persistent container for the given agreement id and agreement factory id.

Parameters:
agreementId - the id of the agreement to load
Returns:
the persistent container
Throws:
AgreementFactoryException - indicates that the agreement with the given id could not be loaded

listContainers

public static PersistentAgreementContainer[] listContainers()
                                                     throws AgreementFactoryException
Creates a list of all persistent agreement containers.

Returns:
the persisted containers
Throws:
AgreementFactoryException - indicates an error while listing the agreement containers

listContainers

public static PersistentAgreementContainer[] listContainers(String agreementFactoryId)
                                                     throws AgreementFactoryException
Lists all persistent agreement containers for a given factory

Parameters:
agreementFactoryId - the factory id
Returns:
the container for the given factory id
Throws:
AgreementFactoryException - indicates an error while listing the persistent containers for the given factory id

saveContainer

public void saveContainer()
                   throws AgreementFactoryException
Save the container instance.

Throws:
AgreementFactoryException - indicates an error saving the container

deleteContainer

public void deleteContainer()
                     throws AgreementFactoryException
Deletes this container instance.

Throws:
AgreementFactoryException - indicates an error while deleting the container

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2008-2012 Fraunhofer Institute SCAI. All Rights Reserved.