1 | package de.uka.ipd.sdq.pipesandfilters.framework.recorder.sensorframework.strategies; |
2 | |
3 | import de.uka.ipd.sdq.pipesandfilters.framework.MetaDataInit; |
4 | import de.uka.ipd.sdq.pipesandfilters.framework.recorder.sensorframework.SensorHelper; |
5 | import de.uka.ipd.sdq.sensorframework.entities.Experiment; |
6 | import de.uka.ipd.sdq.sensorframework.entities.ExperimentRun; |
7 | import de.uka.ipd.sdq.sensorframework.entities.Sensor; |
8 | import de.uka.ipd.sdq.sensorframework.entities.dao.IDAOFactory; |
9 | |
10 | public abstract class AbstractWriteDataStrategy implements IWriteDataStrategy { |
11 | |
12 | protected IDAOFactory daoFactory; |
13 | |
14 | protected Experiment experiment; |
15 | |
16 | protected ExperimentRun run; |
17 | |
18 | protected Sensor sensor; |
19 | |
20 | public AbstractWriteDataStrategy(IDAOFactory daoFactory, |
21 | Experiment experiment, ExperimentRun run) { |
22 | this.daoFactory = daoFactory; |
23 | this.experiment = experiment; |
24 | this.run = run; |
25 | } |
26 | |
27 | @Override |
28 | public void initialise(MetaDataInit metaData) { |
29 | String sensorId = metaData.getMeasurementName(); |
30 | sensor = SensorHelper.createOrReuseTimeSensor(daoFactory, experiment, |
31 | sensorId); |
32 | } |
33 | |
34 | } |