Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

recoin.system
Class RepositoryManager  view RepositoryManager download RepositoryManager.java

java.lang.Object
  extended byrecoin.system.RepositoryManager
Direct Known Subclasses:
MySQLRepositoryManager

public abstract class RepositoryManager
extends java.lang.Object

The RepositoryManager is an abstract superclass for all classes implementing an interface to a RECOIN repository.

Non abstract subclasses have to implement the methods declared in this class. This ensures the compatibility of different RepositoryManager implementations. Furthermore, any subclasses have to provide an empty constructor method in order to be dynamically loaded via the Reflection-API at runtime.

All methods that access and manipulate data in the repository should throw a RepositoryException if there are any errors or inconsistencies between the representation of the object in the repository and the runtime object.

Version:
0.2.9

Field Summary
private  Repository repository
          The repository.
private  RuntimeManager runtimeManager
          The RuntimeManager of the application.
 
Constructor Summary
RepositoryManager()
          Creates a new RepositoryManager.
 
Method Summary
abstract  boolean activateModule(int moduleID, boolean active)
          Sets the active state of the Module with the specified ID to the specified value.
abstract  boolean createAttribute(int ComponentID, java.lang.String name)
          Creates a new attribute with the specified unique name for the Component with the specified ID.
abstract  boolean createAttribute(int componentID, java.lang.String name, java.lang.String value)
          Creates an attribute with the specified unique name and value for the Component with the specified ID.
abstract  recoin.group.Component createComponent()
          Creates a new Component in the repository and returns it.
abstract  recoin.group.ComponentSupport createComponentSupport(java.lang.String classname)
          Creates a ComponentSupport with the specified unique classname and returns it.
abstract  boolean createInOutSupport(int componentID, int inSupportID)
          Creates an InOutSupport for the Component with the specified ID that has the ComponentSupport with the specified ID as its input.
abstract  recoin.group.Module createModule(java.lang.String group)
          Creates a new Module for the specified group and returns it.
abstract  java.util.Hashtable getAttributesByComponentId(int id)
          Returns the attributes of the Component with the specified ID in a Hashtable.
abstract  java.util.Vector getAvailableComponents(int moduleID)
          Returns all Components that are currently not loaded into a Component-to-Module relationship with the Module that has the specified ID.
abstract  recoin.group.Component getComponentById(int id)
          Returns the Component with the specified ID.
abstract  java.util.Vector getComponents()
          Returns all Components from the repository.
abstract  java.util.Vector getComponentsByModuleId(int id)
          Returns the Components that are loaded into a Component-to-Module relationship in the repository.
abstract  java.util.Vector getComponentSupport()
          Returns all ComponentSupports currently in the repository.
abstract  recoin.group.ComponentSupport getComponentSupportById(int id)
          Returns the ComponentSupport with the specified ID.
abstract  java.util.Vector getInOutSupportByComponentId(int id)
          Returns the InOutSupports of the Component with the specified ID.
abstract  recoin.group.Module getModuleById(int id)
          Returns the Module with the specified ID.
abstract  java.util.Vector getModulesByGroupname(java.lang.String groupname)
          Returns the Modules that have declared to belong to the ModuleGroup with the specified groupname.
 Repository getRepository()
          Returns the Repository object that is used by this RepositoryManager.
 RuntimeManager getRuntimeManager()
          Gets the RuntimeManager.
abstract  void initiate()
          Initiates this RepositoryManager.
This method should be overwritten to setup the RepositoryManager.
abstract  boolean loadComponent(int componentID, int moduleID)
          Loads the Component with the specified ID into the Module with the specified ID, i.e.
abstract  boolean removeAttribute(int componentID, java.lang.String name)
          Removes the attribute with the specified unique name from the Component with the specified ID.
abstract  boolean removeComponent(int id)
          Removes the Component with the specified ID from the repository.
abstract  boolean removeComponentSupport(int id)
          Removes the ComponentSupport with the specified ID from the repository.
abstract  boolean removeInOutSupport(int id)
          Removes the InOutSupport with the specified ID from the repository.
abstract  boolean removeModule(int id)
          Removes the Module with the specified ID from the repository.
 void setRepository(Repository repository)
          Sets the Repository that should be used by this RepositoryManager to the specified one.
 void setRuntimeManager(RuntimeManager rm)
          Sets the RuntimeManager.
abstract  boolean unloadComponent(int componentID, int moduleID)
          Unloads the Component with the specified ID from the Module with the specified ID, i.e.
abstract  boolean updateAttribute(int componentID, java.lang.String name, java.lang.String value)
          Updates the attribute of the Component with the specified ID that has the specified unique name and sets it to the specified value.
abstract  boolean updateComponent(recoin.group.Component component)
          Updates the specified Component in the repository.
abstract  boolean updateComponent(recoin.group.Component component, int moduleID)
          Updates the relationship between the specified Component and the Module with the specified ID.
abstract  boolean updateComponentSupport(recoin.group.ComponentSupport cSupport)
          Updates the specified ComponentSupport in the repository.
abstract  boolean updateInOutSupport(recoin.group.InOutSupport ioSupport)
          Updates the specified InOutSupport in the repository.
abstract  boolean updateModule(recoin.group.Module module)
          Updates the specified Module in the repository.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

runtimeManager

private RuntimeManager runtimeManager
The RuntimeManager of the application.


repository

private Repository repository
The repository.

Constructor Detail

RepositoryManager

public RepositoryManager()
Creates a new RepositoryManager.

Method Detail

initiate

public abstract void initiate()
                       throws recoin.exception.InitiationException
Initiates this RepositoryManager.
This method should be overwritten to setup the RepositoryManager. This is the place to load drivers, initiate fields, etc.


getComponentById

public abstract recoin.group.Component getComponentById(int id)
                                                 throws recoin.exception.RepositoryException
Returns the Component with the specified ID.


getModuleById

public abstract recoin.group.Module getModuleById(int id)
                                           throws recoin.exception.RepositoryException
Returns the Module with the specified ID.


getComponentsByModuleId

public abstract java.util.Vector getComponentsByModuleId(int id)
                                                  throws recoin.exception.RepositoryException
Returns the Components that are loaded into a Component-to-Module relationship in the repository.


getComponents

public abstract java.util.Vector getComponents()
                                        throws recoin.exception.RepositoryException
Returns all Components from the repository.


getAvailableComponents

public abstract java.util.Vector getAvailableComponents(int moduleID)
                                                 throws recoin.exception.RepositoryException
Returns all Components that are currently not loaded into a Component-to-Module relationship with the Module that has the specified ID.


getAttributesByComponentId

public abstract java.util.Hashtable getAttributesByComponentId(int id)
                                                        throws recoin.exception.RepositoryException
Returns the attributes of the Component with the specified ID in a Hashtable. The Hashtable's keys are the names of the attributes. Both keys and values of the Hashtable are String objects and have to be cast by the objects that actually work with them, i.e. the ComponentWorkers that are loaded into the Components.


getModulesByGroupname

public abstract java.util.Vector getModulesByGroupname(java.lang.String groupname)
                                                throws recoin.exception.RepositoryException
Returns the Modules that have declared to belong to the ModuleGroup with the specified groupname.


getComponentSupport

public abstract java.util.Vector getComponentSupport()
                                              throws recoin.exception.RepositoryException
Returns all ComponentSupports currently in the repository.


getInOutSupportByComponentId

public abstract java.util.Vector getInOutSupportByComponentId(int id)
                                                       throws recoin.exception.RepositoryException
Returns the InOutSupports of the Component with the specified ID.


getComponentSupportById

public abstract recoin.group.ComponentSupport getComponentSupportById(int id)
                                                               throws recoin.exception.RepositoryException
Returns the ComponentSupport with the specified ID.


updateComponent

public abstract boolean updateComponent(recoin.group.Component component)
                                 throws recoin.exception.RepositoryException
Updates the specified Component in the repository.


updateComponent

public abstract boolean updateComponent(recoin.group.Component component,
                                        int moduleID)
                                 throws recoin.exception.RepositoryException
Updates the relationship between the specified Component and the Module with the specified ID. This method should be used to update runtime parameters and the initiated field of the Component.


updateModule

public abstract boolean updateModule(recoin.group.Module module)
                              throws recoin.exception.RepositoryException
Updates the specified Module in the repository.


updateAttribute

public abstract boolean updateAttribute(int componentID,
                                        java.lang.String name,
                                        java.lang.String value)
                                 throws recoin.exception.RepositoryException
Updates the attribute of the Component with the specified ID that has the specified unique name and sets it to the specified value.


updateComponentSupport

public abstract boolean updateComponentSupport(recoin.group.ComponentSupport cSupport)
                                        throws recoin.exception.RepositoryException
Updates the specified ComponentSupport in the repository.


updateInOutSupport

public abstract boolean updateInOutSupport(recoin.group.InOutSupport ioSupport)
                                    throws recoin.exception.RepositoryException
Updates the specified InOutSupport in the repository.


createComponent

public abstract recoin.group.Component createComponent()
                                                throws recoin.exception.RepositoryException
Creates a new Component in the repository and returns it.


createModule

public abstract recoin.group.Module createModule(java.lang.String group)
                                          throws recoin.exception.RepositoryException
Creates a new Module for the specified group and returns it.


createAttribute

public abstract boolean createAttribute(int ComponentID,
                                        java.lang.String name)
                                 throws recoin.exception.RepositoryException
Creates a new attribute with the specified unique name for the Component with the specified ID.


createAttribute

public abstract boolean createAttribute(int componentID,
                                        java.lang.String name,
                                        java.lang.String value)
                                 throws recoin.exception.RepositoryException
Creates an attribute with the specified unique name and value for the Component with the specified ID.


createComponentSupport

public abstract recoin.group.ComponentSupport createComponentSupport(java.lang.String classname)
                                                              throws recoin.exception.RepositoryException
Creates a ComponentSupport with the specified unique classname and returns it.


createInOutSupport

public abstract boolean createInOutSupport(int componentID,
                                           int inSupportID)
                                    throws recoin.exception.RepositoryException
Creates an InOutSupport for the Component with the specified ID that has the ComponentSupport with the specified ID as its input.


removeComponent

public abstract boolean removeComponent(int id)
                                 throws recoin.exception.RepositoryException
Removes the Component with the specified ID from the repository.


removeModule

public abstract boolean removeModule(int id)
                              throws recoin.exception.RepositoryException
Removes the Module with the specified ID from the repository.


removeAttribute

public abstract boolean removeAttribute(int componentID,
                                        java.lang.String name)
                                 throws recoin.exception.RepositoryException
Removes the attribute with the specified unique name from the Component with the specified ID.


removeComponentSupport

public abstract boolean removeComponentSupport(int id)
                                        throws recoin.exception.RepositoryException
Removes the ComponentSupport with the specified ID from the repository.


removeInOutSupport

public abstract boolean removeInOutSupport(int id)
                                    throws recoin.exception.RepositoryException
Removes the InOutSupport with the specified ID from the repository.


loadComponent

public abstract boolean loadComponent(int componentID,
                                      int moduleID)
                               throws recoin.exception.RepositoryException
Loads the Component with the specified ID into the Module with the specified ID, i.e. a Component-to-Module relationship is established in the repository.


unloadComponent

public abstract boolean unloadComponent(int componentID,
                                        int moduleID)
                                 throws recoin.exception.RepositoryException
Unloads the Component with the specified ID from the Module with the specified ID, i.e. the Component-to-Module relationship is removed from the repository.


activateModule

public abstract boolean activateModule(int moduleID,
                                       boolean active)
                                throws recoin.exception.RepositoryException
Sets the active state of the Module with the specified ID to the specified value.


setRuntimeManager

public void setRuntimeManager(RuntimeManager rm)
Sets the RuntimeManager.


getRuntimeManager

public RuntimeManager getRuntimeManager()
Gets the RuntimeManager.


getRepository

public Repository getRepository()
Returns the Repository object that is used by this RepositoryManager.


setRepository

public void setRepository(Repository repository)
Sets the Repository that should be used by this RepositoryManager to the specified one.