|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.tinyos.tinydb.DBLogger
DBLogger is repsonsible for logging query results to Postgres. When instantiated with a query, it creates a new table to hold the results of that query and registers itself as a listener to results from that query. The name of table that is logged to can be retrieved via the getTableName() method. It will be uniquely generated for each query. The schema of the results table is: +----------------------------------------------------------+ | time stamp | epoch no | field1 | .... | field n | +----------------------------------------------------------+ Additionally, each query is logged to a queries table (which must have been created before DBLogger is invoked. The command to insert the queries table is: create table queries (qname varchar(10), query_time timestamp, query_string varchar(500));
Constructor Summary | |
DBLogger(net.tinyos.tinydb.TinyDBQuery query,
java.lang.String queryStr,
net.tinyos.tinydb.TinyDBNetwork nw)
Start logging the specified query |
Method Summary | |
void |
addQuery(net.tinyos.tinydb.TinyDBQuery q)
QueryListener Method. |
void |
addResult(net.tinyos.tinydb.QueryResult qr)
ResultListener Method. |
void |
close()
Shut down the connection to Postgres. |
java.lang.String |
getTableName()
|
void |
removeQuery(net.tinyos.tinydb.TinyDBQuery q)
QueryListener Method. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DBLogger(net.tinyos.tinydb.TinyDBQuery query, java.lang.String queryStr, net.tinyos.tinydb.TinyDBNetwork nw) throws java.sql.SQLException
query
- The query to logqueryStr
- The SQL string corresponding to query (since not all TinyDB queries have a unique
SQL representation)nw
- The TinyDBNetwork that will deliver results for this queryMethod Detail |
public java.lang.String getTableName()
public void addResult(net.tinyos.tinydb.QueryResult qr)
addResult
in interface ResultListener
qr
- The result to logpublic void removeQuery(net.tinyos.tinydb.TinyDBQuery q)
removeQuery
in interface QueryListener
q
- The query to stop logging forpublic void addQuery(net.tinyos.tinydb.TinyDBQuery q)
addQuery
in interface QueryListener
public void close()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |