net.agmodel.metDriver
Interface MetSourceForDrivers

All Superinterfaces:
GenericSourceForDrivers
All Known Implementing Classes:
MetSourceImpl

public interface MetSourceForDrivers
extends GenericSourceForDrivers

The interface MetAccessMechanisms use to communicate with a service that maintains metdata about a meteorological database.

Author:
Matthew Laurenson

Method Summary
 void addRegion(String regionID, MultilingualString regionName)
          Add a database region to the list maintained by the MetDataSource.
 void addStation(String hostDBIdentifier, MultilingualString placeName, Location location, Period operational, String regionID)
          Add the details of a particular station to the list maintained by the the MetDataSource.
 boolean checkElementCatalog(String stationID, MetElement element, Duration resolution, Period period)
           
 Date getRecent()
          Gets a data for which currently operating stations of this database should have data
 float getSuggestedDailyOffset()
          Provide client applications with a sensible default offset for building requests for daily data for displaying the resulting data.
 String getSuggestedTimezone()
          Provide a sensible default timezone for building requests to the database and for displaying the resulting data.
 WeatherStation getWeatherStation(String hostID, String language)
           
 void processSequence(MetElement element, MetSequence sequence, MetRequest request, Duration queryResolution, StationDataSetImpl result)
          Adds the supplied sequence into the supplied result set, summarising it if necessary.
If the sequence is null the source metadata is updated to reflect the absence of any data.
 void recordElementStatus(String stationID, MetElement element, Duration resolution, Period period, boolean status)
          Record that a station measured or didn't measure an element at a particular resolution over a period.
 void recordMultipleElementStatus(String stationID, MetElement[] elements, Duration[] resolutions, Period period, boolean status)
          Record that a station measured or didn't measure a set of elements at a particular resolution over a period.
 
Methods inherited from interface net.agmodel.brokerImpl.GenericSourceForDrivers
getID, getLog4jCategory, getName, getParameterValue, getSystemPassword, getSystemUsercode
 

Method Detail

addRegion

public void addRegion(String regionID,
                      MultilingualString regionName)
Add a database region to the list maintained by the MetDataSource.

Parameters:
regionID - a string used to identify the region on the host database.
regionName - the name of the region in one or more languages.

addStation

public void addStation(String hostDBIdentifier,
                       MultilingualString placeName,
                       Location location,
                       Period operational,
                       String regionID)
Add the details of a particular station to the list maintained by the the MetDataSource.

Parameters:
hostDBIdentifier - the ID that the host database uses to refer to the station
placeName - the name of the place where the station is located, in one or more languages
location - the location of the station
operational - the date when the station began operating, and, if it has closed, the date when it closed.
regionID - the region which the station belongs to, or null if there are no regions in the database.
Returns:
a driver-side interface to the station

recordElementStatus

public void recordElementStatus(String stationID,
                                MetElement element,
                                Duration resolution,
                                Period period,
                                boolean status)
Record that a station measured or didn't measure an element at a particular resolution over a period. Used to initially specify the data holding of a station, and update it based on the results of queries.

Parameters:
stationID - the station in question
element - the meteorological element
period - the period of time (which might not have an end specified)
resolution - the temporal resolution. There are useful constants in weatherData.MetDuration
status - true if the element was recorded over the period, false if it wasn't

recordMultipleElementStatus

public void recordMultipleElementStatus(String stationID,
                                        MetElement[] elements,
                                        Duration[] resolutions,
                                        Period period,
                                        boolean status)
Record that a station measured or didn't measure a set of elements at a particular resolution over a period. Used to initially specify the data holding of a station, and update it based on the results of queries. This method calls recordElementStatus(String, MetElement...) multiple times within a single transaction, improving performance considerably

Parameters:
stationID - the station in question
elements - the meteorological elements
period - the period of time (which might not have an end specified)
status - true if the element was recorded over the period, false if it wasn't

checkElementCatalog

public boolean checkElementCatalog(String stationID,
                                   MetElement element,
                                   Duration resolution,
                                   Period period)

getWeatherStation

public WeatherStation getWeatherStation(String hostID,
                                        String language)

getSuggestedTimezone

public String getSuggestedTimezone()
Provide a sensible default timezone for building requests to the database and for displaying the resulting data. The String ID of the timezone is used rather than a TimeZone object for speed of transmission and portability to other languages.

Returns:
the timezone that users of this database are likely to be in.

getSuggestedDailyOffset

public float getSuggestedDailyOffset()
Provide client applications with a sensible default offset for building requests for daily data for displaying the resulting data. Daily weather data is usually recorded either at midnight or in the morning at around 9am local time.

Returns:
the number of hours from midnight that the data is recorded,eg if at midnight return 0, if at 9am return 9

processSequence

public void processSequence(MetElement element,
                            MetSequence sequence,
                            MetRequest request,
                            Duration queryResolution,
                            StationDataSetImpl result)
Adds the supplied sequence into the supplied result set, summarising it if necessary.
If the sequence is null the source metadata is updated to reflect the absence of any data.

Parameters:
element - the element that the sequence represents
queryResolution - the resolution of the original database query
sequence - a set of data or null if there is no data
result - the result set that the sequence will be added into

getRecent

public Date getRecent()
Gets a data for which currently operating stations of this database should have data



Copyright (C) NARC 2001 All Rights Reserved.