|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ebay.carad.os.vitalsigns.dao.SqlDataDAO
public class SqlDataDAO
An IDataDAO implementation that stores its data in a SQL DB. Default queries are provided in the form of a Format, but can be substituted for a particular SQL-syntax for other types of databases.
Uses a ISqlDao to perform its' queries.
TODO : add various SQL syntaxes to SqlDataDAO that allow a string like "MySQL.dialect" or "MSSQL.dialect" to determine what default queries to use.
setInsertQuery(String)
,
setSelectQuery(String)
Field Summary | |
---|---|
private static org.apache.log4j.Logger |
LOGGER
|
private java.text.Format |
mInsertQuery
|
private java.text.Format |
mSelectQuery
|
private ISqlDAO |
mSqlDAO
|
Fields inherited from interface com.ebay.carad.os.vitalsigns.dao.IDataDAO |
---|
EMPTY_DATA_POINT_ARRAY, NO_OP_INSTANCE |
Constructor Summary | |
---|---|
SqlDataDAO()
|
Method Summary | |
---|---|
DataPoint[] |
getData(IDashboardReport report)
|
ISqlDAO |
getSqlDAO()
|
void |
setInsertQuery(java.lang.String query)
The query to insert a new DataPoint record. |
void |
setSelectQuery(java.lang.String query)
The query to select all DataPoint records for a given report. |
void |
setSqlDAO(ISqlDAO sqlDAO)
|
void |
storeReportData(float data,
IReportingListenerContainer agent,
IDashboardReport report)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.apache.log4j.Logger LOGGER
private ISqlDAO mSqlDAO
private java.text.Format mInsertQuery
private java.text.Format mSelectQuery
Constructor Detail |
---|
public SqlDataDAO()
Method Detail |
---|
public void storeReportData(float data, IReportingListenerContainer agent, IDashboardReport report) throws ReportingException
storeReportData
in interface IDataDAO
ReportingException
public DataPoint[] getData(IDashboardReport report)
getData
in interface IDataDAO
public void setSqlDAO(ISqlDAO sqlDAO)
public ISqlDAO getSqlDAO()
public void setInsertQuery(java.lang.String query)
The query to insert a new DataPoint record. String is formatted with MessageFormat, so the rules that apply to MessageFormat apply to this String. The parameters given to the format are: new Object[] { new Long(System.currentTimeMillis()), new Integer(report.getID()), new Float(report.getThisRunData()) }.
query
- the query to insert a new DataPoint recordMessageFormat
public void setSelectQuery(java.lang.String query)
The query to select all DataPoint records for a given report. String is formatted with MessageFormat, so the rules that apply to MessageFormat apply to this String. The parameters given to the format are: new Object[] { new Integer(report.getID()) }.
Note that the following column names must be returned by this query:
query
- the query to select a set of DataPoint records based on report IDMessageFormat
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |