Class AbstractFileDAO<T>

java.lang.Object
de.uka.ipd.sdq.sensorframework.dao.file.AbstractFileDAO<T>
Type Parameters:
T - The type of the entities this DAO is able to handle
Direct Known Subclasses:
FileExperimentDAO, FileExperimentRunDAO, FileSensorDAO, FileStateDAO

public abstract class AbstractFileDAO<T> extends Object
Deprecated.
Superseded by EDP2.
An abstract implementation of a file DAO. The DAO is based on the following principle. All entities are stored in a hashmap which hashes IDs to entities. The hashmap is fully loaded from the background storage at startup, manipulated in memory, and finally stored back on request or when the DAO is disposed.
  • Field Details

    • factory

      protected FileDAOFactory factory
      Deprecated.
      Interface to other DAOs
    • idGen

      protected IDGenerator idGen
      Deprecated.
      ID Generator instance. Used by subclasses to create IDs of new elements
  • Constructor Details

    • AbstractFileDAO

      public AbstractFileDAO(IDAOFactory factory, IDGenerator idGen, String prefix)
      Deprecated.
      Constructor of this DAO
      Parameters:
      factory - Interface to other DAOs
      idGen - Identifier Generator used for new elements
      prefix - Filename prefix for the filename used to persist the elements controlled by this DAO
  • Method Details

    • storeAll

      public void storeAll()
      Deprecated.
      Stores all elements controlled by this DAO on the persistent storage
    • get

      public T get(long id)
      Deprecated.
      Get entity with given ID from DAO
      Parameters:
      id - ID of the element to retrieve. The element with ID id has to exist otherwise an IllegalArguementException is thrown
      Returns:
      The requested element
    • putEntity

      protected void putEntity(T entity)
      Deprecated.
      Store a new element in this DAO. Used by subclasses to register newly created elements
      Parameters:
      entity - A new element. The element must not be controlled by the DAO already
    • getAllEntities

      protected Collection<T> getAllEntities()
      Deprecated.
      Returns a list of all entities stored in this DAO
      Returns:
      A list of all entities stored in this DAO
    • removeEntity

      public void removeEntity(T entity, boolean doCascade)
      Deprecated.
      Remove the given entity from this DAO's control
      Parameters:
      entity - The entity to remove
      doCascade - If true, all entities which depend on the passed entity are deleted as well
    • dispose

      public void dispose()
      Deprecated.
      Disposes this DAO. This includes persisting all changes to the background storage