org.openmuc.core.datamanager.impl
Class DataStorageImpl

java.lang.Object
  extended by org.openmuc.core.datamanager.impl.DataStorageImpl
All Implemented Interfaces:
DataStorage

public class DataStorageImpl
extends java.lang.Object
implements DataStorage


Constructor Summary
DataStorageImpl(org.osgi.util.tracker.ServiceTracker listenerTracker, ChannelConfiguration channelConfig, DatabaseInterface database, DeviceURI url, DeviceDriverManager driverManager)
           
 
Method Summary
 void addListener(DataStorageListener listener)
           
 boolean addMeasurement(Measurement msr)
           
 ChannelConfiguration getConfiguration()
           
 Value getCurrentValue()
           
 ChannelIdentifier getDataId()
           
 java.lang.String getLabel()
           
 long getLastUpdateTime()
           
 java.lang.Double getLowerLimit()
           
 double getMeanValue()
           
 State getState()
           
 java.lang.Double getUpperLimit()
           
 Value getValue(long timestamp)
          Get a Value object for the specified timestamp.
 java.util.List<Value> getValues(long startTime)
          Get a list of Value objects (time serie).
 java.util.List<Value> getValues(long startTime, long endTime)
          Get a list of Value objects (time serie).
 void setDatabase(DatabaseInterface dbl)
           
 void setState(State state)
           
 void setValue(double value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataStorageImpl

public DataStorageImpl(org.osgi.util.tracker.ServiceTracker listenerTracker,
                       ChannelConfiguration channelConfig,
                       DatabaseInterface database,
                       DeviceURI url,
                       DeviceDriverManager driverManager)
Method Detail

getCurrentValue

public Value getCurrentValue()
Specified by:
getCurrentValue in interface DataStorage

setDatabase

public void setDatabase(DatabaseInterface dbl)

addMeasurement

public boolean addMeasurement(Measurement msr)
Specified by:
addMeasurement in interface DataStorage

getMeanValue

public double getMeanValue()

getDataId

public ChannelIdentifier getDataId()
Specified by:
getDataId in interface DataStorage

getValue

public Value getValue(long timestamp)
Description copied from interface: DataStorage
Get a Value object for the specified timestamp.

Specified by:
getValue in interface DataStorage
Returns:
a Value object or null if none was found.

getValues

public java.util.List<Value> getValues(long startTime)
Description copied from interface: DataStorage
Get a list of Value objects (time serie).

Specified by:
getValues in interface DataStorage
Returns:
a list of Value objects or an empty list if no Value has been found.

getValues

public java.util.List<Value> getValues(long startTime,
                                       long endTime)
Description copied from interface: DataStorage
Get a list of Value objects (time serie).

Specified by:
getValues in interface DataStorage
Returns:
a list of Value objects or an empty list if no Value has been found.

getLastUpdateTime

public long getLastUpdateTime()
Specified by:
getLastUpdateTime in interface DataStorage

setValue

public void setValue(double value)
Specified by:
setValue in interface DataStorage

getState

public State getState()
Specified by:
getState in interface DataStorage

addListener

public void addListener(DataStorageListener listener)
Specified by:
addListener in interface DataStorage

getLabel

public java.lang.String getLabel()
Specified by:
getLabel in interface DataStorage

setState

public void setState(State state)
Specified by:
setState in interface DataStorage

getLowerLimit

public java.lang.Double getLowerLimit()
Specified by:
getLowerLimit in interface DataStorage

getUpperLimit

public java.lang.Double getUpperLimit()
Specified by:
getUpperLimit in interface DataStorage

getConfiguration

public ChannelConfiguration getConfiguration()
Specified by:
getConfiguration in interface DataStorage