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 ofBinaryMeasurementsDao
.
-
-
Field Summary
Fields Modifier and Type Field Description protected static Logger
LOGGER
Error logger for this class.protected File
resourceFile
Pointer to the file containing the resource.
-
Constructor Summary
Constructors Constructor Description FileBinaryMeasurementsDaoImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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.BackgroundMemoryListImpl.BinaryRepresentation
getBinaryRepresentation()
List<javax.measure.Measure<V,Q>>
getMeasurements()
Serializer<V>
getSerializer()
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
setUnit(javax.measure.unit.Unit<Q> unit)
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
-
-
-
-
Method Detail
-
open
public void open() throws DataNotAccessibleException
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
public void close() throws DataNotAccessibleException
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
public Serializer<V> getSerializer()
-
setSerializer
public void setSerializer(Serializer<V> serializer)
-
getMeasurements
public List<javax.measure.Measure<V,Q>> getMeasurements()
- Specified by:
getMeasurements
in interfaceMeasurementsDao<V,Q extends javax.measure.quantity.Quantity>
- Returns:
- Observed measurements.
-
getBinaryRepresentation
public BackgroundMemoryListImpl.BinaryRepresentation getBinaryRepresentation()
- Returns:
- the binaryRepresentation
-
setBinaryRepresentation
public void setBinaryRepresentation(BackgroundMemoryListImpl.BinaryRepresentation binaryRepresentation)
- Parameters:
binaryRepresentation
- the binaryRepresentation to set
-
getUnit
public javax.measure.unit.Unit<Q> 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
public void setUnit(javax.measure.unit.Unit<Q> unit)
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
public void setResourceFile(File resourceFile)
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
public void delete() throws DataNotAccessibleException
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.
-
-