com.ebay.carad.os.vitalsigns.dataretrievers
Class QueryLogger
java.lang.Object
com.ebay.carad.os.vitalsigns.dataretrievers.QueryLogger
- All Implemented Interfaces:
- IDataRetriever, ITemplatizable, java.lang.Cloneable
- Direct Known Subclasses:
- DifferenceQueryLogger
public class QueryLogger
- extends java.lang.Object
- implements IDataRetriever, ITemplatizable
Takes the output of a simple one-cell query (column name "data")
from the production DB and logs it.
- Version:
- $Id$
- Author:
- Jeremy Kraybill, Jeremy Thomerson
Method Summary |
java.lang.Object |
clone()
|
java.lang.Float |
getData()
|
java.lang.Float |
getData(IDashboardAgent agent)
|
java.lang.String |
getQuery()
|
ISqlDAO |
getSqlDAO()
|
protected java.lang.Float |
getValue()
|
void |
setQuery(java.lang.String query)
Sets the SQL query for this logger. |
void |
setSqlDAO(ISqlDAO sqlDAO)
|
void |
templatize(java.lang.Object[] substitutions)
This implementation treats the query set on this instance as a MessageFormat,
and applies the substitutions to that format using MessageFormatUtil. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
COLUMN_NAME
private static final java.lang.String COLUMN_NAME
- See Also:
- Constant Field Values
LOGGER
private static final org.apache.log4j.Logger LOGGER
- Class logger.
ZERO
public static final java.lang.Float ZERO
mSqlDAO
private ISqlDAO mSqlDAO
mQuery
private java.lang.String mQuery
QueryLogger
public QueryLogger()
setQuery
public void setQuery(java.lang.String query)
- Sets the SQL query for this logger. Must return the column "data", which
is the column that will be logged.
- Parameters:
query
- the SQL query to set
getQuery
public java.lang.String getQuery()
- Returns:
- Returns the query.
getValue
protected java.lang.Float getValue()
getData
public java.lang.Float getData()
templatize
public void templatize(java.lang.Object[] substitutions)
- This implementation treats the query set on this instance as a MessageFormat,
and applies the substitutions to that format using MessageFormatUtil.
- Specified by:
templatize
in interface ITemplatizable
- Parameters:
substitutions
- an array of objects (usually strings) to use for templatization- See Also:
MessageFormat
,
MessageFormatUtil.format(String, Object[])
,
ITemplatizable.templatize(java.lang.Object[])
getData
public java.lang.Float getData(IDashboardAgent agent)
- Specified by:
getData
in interface IDataRetriever
getSqlDAO
public ISqlDAO getSqlDAO()
setSqlDAO
public void setSqlDAO(ISqlDAO sqlDAO)
clone
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
- Specified by:
clone
in interface IDataRetriever
- Overrides:
clone
in class java.lang.Object
- Throws:
java.lang.CloneNotSupportedException
Copyright © 2004-2009. All Rights Reserved.