|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.PropertyResources
util.PropertyBundles
mysql.GenericSql
stella.sensor.WeatherDatabase
public class WeatherDatabase
A simple class that reads weather data from the database and generates
WeatherSurveying.BlockData out of it.
| Nested Class Summary | |
|---|---|
static class |
WeatherDatabase.Dump
Retrieves a list of weather data and dumpe it to stdout. |
| Nested classes/interfaces inherited from class mysql.GenericSql |
|---|
GenericSql.Extract |
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private static String |
DEFDATEFIELD
The default binding name of the weather trigger. |
private static long |
DEFEXTRATIME
The default extra time. |
private static String |
DEFGOODFLAG
The default setting of the non-valid-reading indicator. |
private static String |
DEFPRINCIPAL
The default mapping of STELLA sensor names to sql fields. |
private static String |
DEFWEATHERFIELD
The default binding name of the weather trigger. |
static String |
KEY_DATEFIELD
The key to the sql date-field name. |
static String |
KEY_EXTRATIME
A time which is added to date queries to enlarge the time-space. |
static String |
KEY_GOODFLAG
The key to the good-weather string. |
static String |
KEY_PRINCIPAL
The mapping of STELLA sensor names to sql data fields. |
static String |
KEY_WEATHERFIELD
The key to the sql weather-field name. |
private Map<String,String> |
principal
The mapping of STELLA sensors names to sql field names. |
| Fields inherited from class mysql.GenericSql |
|---|
DEFDATEFORMAT, KEY_BRIDGE, KEY_CONNECT, KEY_DATEFORMAT, KEY_FAILFILE, KEY_PASSWORD, KEY_TABLE, KEY_TRUEREAD, KEY_TRUEWRITE, KEY_USER |
| Fields inherited from class util.PropertyBundles |
|---|
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES |
| Fields inherited from class util.PropertyResources |
|---|
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset |
| Fields inherited from class util.PropertyContainer |
|---|
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR |
| Fields inherited from interface util.ResourceSupplying |
|---|
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Fields inherited from interface util.PropertySupplying |
|---|
CONFIG, KEY_CLASS |
| Constructor Summary | |
|---|---|
WeatherDatabase(Map<String,String> prop)
Constructs a new database collector. |
|
| Method Summary | |
|---|---|
List<WeatherSurveying.DataBlock> |
getWeatherData(Date fromsharp,
Date tosharp)
Returns a list of mappings of sensor names to sensor values. |
void |
init()
Initializes the database current object as well as the database acess object. |
| Methods inherited from class mysql.GenericSql |
|---|
allColumns, canRead, canWrite, close, delete, exit, getConnection, getStatement, insert, isOpen, isReady, join, open, replace, retrieve, retrieve |
| Methods inherited from class util.PropertyBundles |
|---|
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource |
| Methods inherited from class util.PropertyResources |
|---|
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet |
| Methods inherited from class util.PropertyContainer |
|---|
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface util.ResourceSupplying |
|---|
getResource, getResourceAsStream, getResources |
| Methods inherited from interface util.PropertySupplying |
|---|
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties |
| Field Detail |
|---|
public static final String KEY_PRINCIPAL
public static final String KEY_DATEFIELD
public static final String KEY_WEATHERFIELD
public static final String KEY_GOODFLAG
public static final String KEY_EXTRATIME
private static final String DEFPRINCIPAL
private static final String DEFDATEFIELD
private static final String DEFWEATHERFIELD
private static final String DEFGOODFLAG
private static final long DEFEXTRATIME
private Map<String,String> principal
| Constructor Detail |
|---|
public WeatherDatabase(Map<String,String> prop)
GenericSql class must also be
present here if non-default values are wanted. Additionally, the weather
trigger stub is constructed here with the generic properties of the
collector.
| Method Detail |
|---|
public void init()
GenericSql.init() method and opening the connection.principal, #minima, and
#maxima) are assigned. Additionally, the format look-up table
is constructed using the class names pointed to in the
#KEY_FORMAT property to java classes. Only classes found that
also support a single-string constructor are used.
init in interface Initializableinit in class GenericSql
public List<WeatherSurveying.DataBlock> getWeatherData(Date fromsharp,
Date tosharp)
WeatherSurveying.BlockData objects.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||