Class FileBinaryMeasurementsDaoImpl<V,Q extends javax.measure.quantity.Quantity>
java.lang.Object
org.palladiosimulator.edp2.dao.impl.Edp2DaoImpl
org.palladiosimulator.edp2.dao.impl.AbstractMeasurementsDaoImpl<V,Q>
org.palladiosimulator.edp2.repository.local.dao.FileBinaryMeasurementsDaoImpl<V,Q>
- All Implemented Interfaces:
BinaryMeasurementsDao<V,
,Q> Edp2Dao
,MeasurementsDao<V,
Q>
public class FileBinaryMeasurementsDaoImpl<V,Q extends javax.measure.quantity.Quantity>
extends AbstractMeasurementsDaoImpl<V,Q>
implements BinaryMeasurementsDao<V,Q>
File-backed implementation of
BinaryMeasurementsDao
.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes the connection to the data store.void
delete()
Deletes all of the stored data.void
deserialize
(org.eclipse.net4j.util.io.ExtendedDataInputStream input) Deserialize the data from an input stream.void
flush()
Write all non-persisted data to disk.javax.measure.unit.Unit<Q>
getUnit()
Returns the unit in which all measurements are stored.void
open()
Opens the connection to the data store and makes it's data accessible.void
serialize
(org.eclipse.net4j.util.io.ExtendedDataOutputStream output) Serialize the data to an output stream.void
setBinaryRepresentation
(BackgroundMemoryListImpl.BinaryRepresentation binaryRepresentation) void
setResourceFile
(File resourceFile) Sets the resource file from which the ExperimentGroup data is loaded.void
setSerializer
(Serializer<V> serializer) void
Sets the unit in which all measurements are stored.Methods inherited from class org.palladiosimulator.edp2.dao.impl.Edp2DaoImpl
canClose, canDelete, canOpen, isDeleted, isOpen, setClosed, setDeleted, setOpen
-
Field Details
-
LOGGER
Error logger for this class. -
resourceFile
Pointer to the file containing the resource.
-
-
Constructor Details
-
FileBinaryMeasurementsDaoImpl
public FileBinaryMeasurementsDaoImpl()
-
-
Method Details
-
open
Description copied from interface:Edp2Dao
Opens the connection to the data store and makes it's data accessible.- Specified by:
open
in interfaceEdp2Dao
- Overrides:
open
in classEdp2DaoImpl
- Throws:
DataNotAccessibleException
- Errors when initializing the data access.
-
close
Description copied from interface:Edp2Dao
Closes the connection to the data store. If necessary, data is persisted before closing.- Specified by:
close
in interfaceEdp2Dao
- Overrides:
close
in classEdp2DaoImpl
- Throws:
DataNotAccessibleException
- Errors when accessing data.
-
getSerializer
-
setSerializer
-
getMeasurements
- Specified by:
getMeasurements
in interfaceMeasurementsDao<V,
Q extends javax.measure.quantity.Quantity> - Returns:
- Observed measurements.
-
getBinaryRepresentation
- Returns:
- the binaryRepresentation
-
setBinaryRepresentation
public void setBinaryRepresentation(BackgroundMemoryListImpl.BinaryRepresentation binaryRepresentation) - Parameters:
binaryRepresentation
- the binaryRepresentation to set
-
getUnit
Description copied from interface:BinaryMeasurementsDao
Returns the unit in which all measurements are stored.- Specified by:
getUnit
in interfaceBinaryMeasurementsDao<V,
Q extends javax.measure.quantity.Quantity> - Returns:
- the unit
-
setUnit
Description copied from interface:BinaryMeasurementsDao
Sets the unit in which all measurements are stored.- Specified by:
setUnit
in interfaceBinaryMeasurementsDao<V,
Q extends javax.measure.quantity.Quantity> - Parameters:
unit
- the unit to set
-
serialize
public void serialize(org.eclipse.net4j.util.io.ExtendedDataOutputStream output) throws DataNotAccessibleException Description copied from interface:MeasurementsDao
Serialize the data to an output stream. Used to transfer Measurements to and from remote locations.- Specified by:
serialize
in interfaceMeasurementsDao<V,
Q extends javax.measure.quantity.Quantity> - Parameters:
output
- Output data stream- Throws:
DataNotAccessibleException
-
deserialize
public void deserialize(org.eclipse.net4j.util.io.ExtendedDataInputStream input) throws DataNotAccessibleException Description copied from interface:MeasurementsDao
Deserialize the data from an input stream. Used to transfer Measurements to and from remote locations.- Specified by:
deserialize
in interfaceMeasurementsDao<V,
Q extends javax.measure.quantity.Quantity> - Parameters:
input
- Input data stream.- Throws:
DataNotAccessibleException
-
flush
public void flush()Description copied from interface:Edp2Dao
Write all non-persisted data to disk. -
setResourceFile
Sets the resource file from which the ExperimentGroup data is loaded. Can only be set once.- Parameters:
resourceFile
- File in which the ExperimentGroup is stored.
-
delete
Description copied from interface:Edp2Dao
Deletes all of the stored data.- Specified by:
delete
in interfaceEdp2Dao
- Overrides:
delete
in classEdp2DaoImpl
- Throws:
DataNotAccessibleException
- Errors when accessing data.
-