org.objectweb.dsrg.sofa.repository
Class DeleteDependencyCalculator

java.lang.Object
  extended by org.objectweb.dsrg.sofa.repository.DeleteDependencyCalculator

public class DeleteDependencyCalculator
extends java.lang.Object

Class for going through the whole repository and getting the list of entities to be deleted.


Nested Class Summary
protected  class DeleteDependencyCalculator.DeletingNode
          Class for keeping info about the structure of the repository.
 
Field Summary
protected  NodeConfiguration nodeConfiguration
           
protected  java.util.HashMap<org.eclipse.emf.common.util.URI,DeleteDependencyCalculator.DeletingNode> nodesCache
           
protected  RepositoryQuery repositoryQuery
           
protected  DeleteDependencyCalculator.DeletingNode root
           
 
Constructor Summary
DeleteDependencyCalculator(NodeConfiguration nodeConfiguration)
          Constructor.
 
Method Summary
protected  DeleteDependencyCalculator.DeletingNode cacheEntity(Architecture entity)
          Goes through all the dependencies of the entity and caches it into memory of this data structure.
protected  DeleteDependencyCalculator.DeletingNode cacheEntity(Aspect entity)
          Goes through all the dependencies of the entity and caches it into memory of this data structure.
protected  DeleteDependencyCalculator.DeletingNode cacheEntity(AssemblyDescriptor entity)
          Goes through all the dependencies of the entity and caches it into memory of this data structure.
protected  DeleteDependencyCalculator.DeletingNode cacheEntity(CodeBundle entity)
          Goes through all the dependencies of the entity and caches it into memory of this data structure.
protected  DeleteDependencyCalculator.DeletingNode cacheEntity(DeploymentPlan entity)
          Goes through all the dependencies of the entity and caches it into memory of this data structure.
protected  DeleteDependencyCalculator.DeletingNode cacheEntity(Frame entity)
          Goes through all the dependencies of the entity and caches it into memory of this data structure.
protected  DeleteDependencyCalculator.DeletingNode cacheEntity(InstanceAssemblyDescription entity)
          Goes through all the dependencies of the entity and caches it into memory of this data structure.
protected  DeleteDependencyCalculator.DeletingNode cacheEntity(Interface entity)
          Goes through all the dependencies of the entity and caches it into memory of this data structure.
protected  DeleteDependencyCalculator.DeletingNode cacheEntity(InterfaceType entity)
          Goes through all the dependencies of the entity and caches it into memory of this data structure.
protected  DeleteDependencyCalculator.DeletingNode cacheEntity(MicroComponent entity)
          Goes through all the dependencies of the entity and caches it into memory of this data structure.
protected  DeleteDependencyCalculator.DeletingNode cacheEntity(SubcomponentInstance entity)
          Goes through all the dependencies of the entity and caches it into memory of this data structure.
 java.util.List<VersionedEntity> getAllDependencies()
          Just for debugging purposes...
 java.util.List<VersionedEntity> getDeletingDependencies(org.eclipse.emf.common.util.URI uri)
          Gets all dependencies which should be deleted with a VersionedEntity for keeping the repository consistent.
 java.util.List<VersionedEntity> getDeletingDependencies(VersionedEntity entity)
          Gets all dependencies which should be deleted with a VersionedEntity for keeping the repository consistent.
protected  void indent(int indent)
           
 void printResult()
           
protected  org.eclipse.emf.ecore.EObject resolve(org.eclipse.emf.ecore.EObject e)
          Just until I find out why EcoreUtil.resolveAll works only for some entities.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nodesCache

protected java.util.HashMap<org.eclipse.emf.common.util.URI,DeleteDependencyCalculator.DeletingNode> nodesCache

root

protected DeleteDependencyCalculator.DeletingNode root

nodeConfiguration

protected NodeConfiguration nodeConfiguration

repositoryQuery

protected RepositoryQuery repositoryQuery
Constructor Detail

DeleteDependencyCalculator

public DeleteDependencyCalculator(NodeConfiguration nodeConfiguration)
Constructor. Connects to the repository and caches all the needed information.

Parameters:
nodeConfiguration - the configuration of the repository.
Method Detail

resolve

protected org.eclipse.emf.ecore.EObject resolve(org.eclipse.emf.ecore.EObject e)
Just until I find out why EcoreUtil.resolveAll works only for some entities.

Parameters:
e -
Returns:

getDeletingDependencies

public java.util.List<VersionedEntity> getDeletingDependencies(VersionedEntity entity)
Gets all dependencies which should be deleted with a VersionedEntity for keeping the repository consistent.

Parameters:
entity - the entity to be deleted and which's dependencies to find.
Returns:
the list of dependencies to be deleted with the entity or null when the entity is not present

getDeletingDependencies

public java.util.List<VersionedEntity> getDeletingDependencies(org.eclipse.emf.common.util.URI uri)
Gets all dependencies which should be deleted with a VersionedEntity for keeping the repository consistent.

Parameters:
entity - the entity to be deleted and which's dependencies to find.
Returns:
the list of dependencies to be deleted with the entity or null when the entity is not present

getAllDependencies

public java.util.List<VersionedEntity> getAllDependencies()
Just for debugging purposes...

Parameters:
entity -
Returns:

indent

protected void indent(int indent)

printResult

public void printResult()

cacheEntity

protected DeleteDependencyCalculator.DeletingNode cacheEntity(Architecture entity)
Goes through all the dependencies of the entity and caches it into memory of this data structure.

Parameters:
entity -
Returns:
the entity as DeletingNode with all dependencies.

cacheEntity

protected DeleteDependencyCalculator.DeletingNode cacheEntity(Aspect entity)
Goes through all the dependencies of the entity and caches it into memory of this data structure.

Parameters:
entity -
Returns:
the entity as DeletingNode with all dependencies.

cacheEntity

protected DeleteDependencyCalculator.DeletingNode cacheEntity(AssemblyDescriptor entity)
Goes through all the dependencies of the entity and caches it into memory of this data structure.

Parameters:
entity -
Returns:
the entity as DeletingNode with all dependencies.

cacheEntity

protected DeleteDependencyCalculator.DeletingNode cacheEntity(CodeBundle entity)
Goes through all the dependencies of the entity and caches it into memory of this data structure.

Parameters:
entity -
Returns:
the entity as DeletingNode with all dependencies.

cacheEntity

protected DeleteDependencyCalculator.DeletingNode cacheEntity(DeploymentPlan entity)
Goes through all the dependencies of the entity and caches it into memory of this data structure.

Parameters:
entity -
Returns:
the entity as DeletingNode with all dependencies.

cacheEntity

protected DeleteDependencyCalculator.DeletingNode cacheEntity(Frame entity)
Goes through all the dependencies of the entity and caches it into memory of this data structure.

Parameters:
entity -
Returns:
the entity as DeletingNode with all dependencies.

cacheEntity

protected DeleteDependencyCalculator.DeletingNode cacheEntity(InterfaceType entity)
Goes through all the dependencies of the entity and caches it into memory of this data structure.

Parameters:
entity -
Returns:
the entity as DeletingNode with all dependencies.

cacheEntity

protected DeleteDependencyCalculator.DeletingNode cacheEntity(MicroComponent entity)
Goes through all the dependencies of the entity and caches it into memory of this data structure. Note: It is better not to cache this object for a long time.

Parameters:
entity -
Returns:
the entity as DeletingNode with all dependencies.

cacheEntity

protected DeleteDependencyCalculator.DeletingNode cacheEntity(InstanceAssemblyDescription entity)
Goes through all the dependencies of the entity and caches it into memory of this data structure.

Parameters:
entity -
Returns:
the entity as DeletingNode with all dependencies.

cacheEntity

protected DeleteDependencyCalculator.DeletingNode cacheEntity(Interface entity)
Goes through all the dependencies of the entity and caches it into memory of this data structure.

Parameters:
entity -
Returns:
the entity as DeletingNode with all dependencies.

cacheEntity

protected DeleteDependencyCalculator.DeletingNode cacheEntity(SubcomponentInstance entity)
Goes through all the dependencies of the entity and caches it into memory of this data structure.

Parameters:
entity -
Returns:
the entity as DeletingNode with all dependencies.