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
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 Summary
Modifier and TypeFieldDescriptionprotected FileDAOFactory
Deprecated.Interface to other DAOsprotected IDGenerator
Deprecated.ID Generator instance. -
Constructor Summary
ConstructorDescriptionAbstractFileDAO
(IDAOFactory factory, IDGenerator idGen, String prefix) Deprecated.Constructor of this DAO -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Deprecated.Disposes this DAO.get
(long id) Deprecated.Get entity with given ID from DAOprotected Collection<T>
Deprecated.Returns a list of all entities stored in this DAOprotected void
Deprecated.Store a new element in this DAO.void
removeEntity
(T entity, boolean doCascade) Deprecated.Remove the given entity from this DAO's controlvoid
storeAll()
Deprecated.Stores all elements controlled by this DAO on the persistent storage
-
Field Details
-
factory
Deprecated.Interface to other DAOs -
idGen
Deprecated.ID Generator instance. Used by subclasses to create IDs of new elements
-
-
Constructor Details
-
AbstractFileDAO
Deprecated.Constructor of this DAO- Parameters:
factory
- Interface to other DAOsidGen
- Identifier Generator used for new elementsprefix
- 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
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
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
Deprecated.Returns a list of all entities stored in this DAO- Returns:
- A list of all entities stored in this DAO
-
removeEntity
Deprecated.Remove the given entity from this DAO's control- Parameters:
entity
- The entity to removedoCascade
- 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
-