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 LoggerLOGGERError logger for this class.protected FileresourceFilePointer 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 voidclose()Closes the connection to the data store.voiddelete()Deletes all of the stored data.voiddeserialize(org.eclipse.net4j.util.io.ExtendedDataInputStream input)Deserialize the data from an input stream.voidflush()Write all non-persisted data to disk.BackgroundMemoryListImpl.BinaryRepresentationgetBinaryRepresentation()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.voidopen()Opens the connection to the data store and makes it's data accessible.voidserialize(org.eclipse.net4j.util.io.ExtendedDataOutputStream output)Serialize the data to an output stream.voidsetBinaryRepresentation(BackgroundMemoryListImpl.BinaryRepresentation binaryRepresentation)voidsetResourceFile(File resourceFile)Sets the resource file from which the ExperimentGroup data is loaded.voidsetSerializer(Serializer<V> serializer)voidsetUnit(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 DataNotAccessibleExceptionDescription copied from interface:Edp2DaoOpens the connection to the data store and makes it's data accessible.- Specified by:
openin interfaceEdp2Dao- Overrides:
openin classEdp2DaoImpl- Throws:
DataNotAccessibleException- Errors when initializing the data access.
-
close
public void close() throws DataNotAccessibleExceptionDescription copied from interface:Edp2DaoCloses the connection to the data store. If necessary, data is persisted before closing.- Specified by:
closein interfaceEdp2Dao- Overrides:
closein 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:
getMeasurementsin 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:BinaryMeasurementsDaoReturns the unit in which all measurements are stored.- Specified by:
getUnitin 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:BinaryMeasurementsDaoSets the unit in which all measurements are stored.- Specified by:
setUnitin 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 DataNotAccessibleExceptionDescription copied from interface:MeasurementsDaoSerialize the data to an output stream. Used to transfer Measurements to and from remote locations.- Specified by:
serializein 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 DataNotAccessibleExceptionDescription copied from interface:MeasurementsDaoDeserialize the data from an input stream. Used to transfer Measurements to and from remote locations.- Specified by:
deserializein interfaceMeasurementsDao<V,Q extends javax.measure.quantity.Quantity>- Parameters:
input- Input data stream.- Throws:
DataNotAccessibleException
-
flush
public void flush()
Description copied from interface:Edp2DaoWrite 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 DataNotAccessibleExceptionDescription copied from interface:Edp2DaoDeletes all of the stored data.- Specified by:
deletein interfaceEdp2Dao- Overrides:
deletein classEdp2DaoImpl- Throws:
DataNotAccessibleException- Errors when accessing data.
-
-