org.objectweb.dsrg.sofa.repository
Class RepositoryDeleter

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

public class RepositoryDeleter
extends java.lang.Object

This class is responsible for deleting any data from the repository.


Constructor Summary
RepositoryDeleter(NodeConfiguration configuration)
          This constructor should not be used by public.
 
Method Summary
 boolean delete(VersionedEntity[] entityArray, boolean deleteDependencies)
          Main method of this class.
 boolean delete(VersionedEntity entity, boolean deleteDependencies)
          Main method of this class.
 java.util.Set<VersionedEntity> getDeletingDependencies(VersionedEntity entity)
          Function for getting all dependencies that should be deleted with the entity.
 VersionedEntity[] getDeletingDependencies(VersionedEntity[] entities)
          Function for getting all dependencies that should be deleted with the entities.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RepositoryDeleter

public RepositoryDeleter(NodeConfiguration configuration)
This constructor should not be used by public. It is used by RepositoryAgent.

Parameters:
configuration - RepositoryAgent's NodeConfiguration
Method Detail

delete

public boolean delete(VersionedEntity entity,
                      boolean deleteDependencies)
               throws java.io.IOException
Main method of this class. Deletes specified entity from repository.

Parameters:
entity - VersionedEntity to be deleted from Repository
deleteDependencies - Boolean indicating whether the dependencies of the entity should also be deleted. You probably want this to be set to true.
Throws:
java.io.IOException

delete

public boolean delete(VersionedEntity[] entityArray,
                      boolean deleteDependencies)
               throws java.io.IOException
Main method of this class. Deletes specified entities from repository.

Parameters:
entityArray - Array of VersionedEntities to be deleted from Repository
deleteDependencies - Boolean indicating whether the dependencies of the entities should also be deleted. You probably want this to be set to true.
Throws:
java.io.IOException

getDeletingDependencies

public java.util.Set<VersionedEntity> getDeletingDependencies(VersionedEntity entity)
Function for getting all dependencies that should be deleted with the entity. WARNING - can take quite a time to execute.

Parameters:
entity - The entity which is about to be deleted.
Returns:
List of dependencies to be deleted with the entity to keep consistency.

getDeletingDependencies

public VersionedEntity[] getDeletingDependencies(VersionedEntity[] entities)
Function for getting all dependencies that should be deleted with the entities. WARNING - can take quite a time to execute.

Parameters:
entities - The entities which are about to be deleted.
Returns:
List of dependencies to be deleted with the entities to keep consistency.