org.openmuc.core.datamanager.impl
Class SQLiteDatabaseLayerProvider

java.lang.Object
  extended by org.openmuc.core.datamanager.impl.SQLiteDatabaseLayerProvider
All Implemented Interfaces:
DatabaseInterface

public class SQLiteDatabaseLayerProvider
extends java.lang.Object
implements DatabaseInterface


Constructor Summary
SQLiteDatabaseLayerProvider()
           
 
Method Summary
 void addChannel(ChannelConfiguration channel)
          Add a new item (measurement channel) to the database
 Value getValue(java.lang.String label, long timestamp)
          Gets a single value with a specified timestamp from the database.
 java.util.List<Value> getValues(java.lang.String label, long startTime)
          Gets all values (time series) of a channel from startTime until now.
 java.util.List<Value> getValues(java.lang.String label, long startTime, long endTime)
          Gets all values (time series) of a channel from startTime until endTime.
 void insertValue(java.lang.String label, Value reading)
          Insert a value into the database.
static boolean setFilename(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLiteDatabaseLayerProvider

public SQLiteDatabaseLayerProvider()
Method Detail

setFilename

public static boolean setFilename(java.lang.String name)

addChannel

public void addChannel(ChannelConfiguration channel)
Description copied from interface: DatabaseInterface
Add a new item (measurement channel) to the database

Specified by:
addChannel in interface DatabaseInterface
Parameters:
channel - unique identifier of the item

insertValue

public void insertValue(java.lang.String label,
                        Value reading)
                 throws java.io.IOException
Description copied from interface: DatabaseInterface
Insert a value into the database.

Specified by:
insertValue in interface DatabaseInterface
Parameters:
label - label unique identifier of the item
reading - a Value object
Throws:
java.io.IOException - Will be thrown if there is a problem with the underlying database layer

getValues

public java.util.List<Value> getValues(java.lang.String label,
                                       long startTime)
Description copied from interface: DatabaseInterface
Gets all values (time series) of a channel from startTime until now. It is the same as the call getValues(label, startTime, System.currentTimeMillies)

Specified by:
getValues in interface DatabaseInterface
Parameters:
label - unique identifier of the item
startTime - Time of the first value in the time series in ms since epoche.
Returns:
A List of value objects or an empty list if now matching object have been found.

getValues

public java.util.List<Value> getValues(java.lang.String label,
                                       long startTime,
                                       long endTime)
Description copied from interface: DatabaseInterface
Gets all values (time series) of a channel from startTime until endTime.

Specified by:
getValues in interface DatabaseInterface
Parameters:
label - unique identifier of the item
startTime - Time of the first value in the time series in ms since epoche.
endTime - Time of the last value in the time series in ms since epoche
Returns:
A List of value objects or an empty list if now matching object have been found.

getValue

public Value getValue(java.lang.String label,
                      long timestamp)
Description copied from interface: DatabaseInterface
Gets a single value with a specified timestamp from the database.

Specified by:
getValue in interface DatabaseInterface
Parameters:
label - unique identifier of the item
timestamp - timestamp of the value (ms since epoche)
Returns:
a Value object if to has been found or null