|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.agmodel.brokerImpl.GenericSourceImpl
net.agmodel.metBroker.MetSourceImpl
An implementation of MetDataSource Responsible for knowing how to get weather element(s) for a period from a station. Relies on a collection of ServerStationImpl objects to record details of which elements are held on the database for each station. Note that MetSourceImpl is not persistent, though it uses persistent station and region details.
| Nested Class Summary | |
class |
MetSourceImpl.MetSourceContext
The MetSourceContext class is used by UserManagerImpl to maintain client-specific context. |
| Constructor Summary | |
MetSourceImpl(String ID,
MetBrokerImpl broker,
MultilingualString sourceName,
GeographicalArea coverage,
int loginRequirements,
String systemUsercode,
String systemPassword,
String driverName,
String suggestedTimeZone,
float suggestedDailyOffset,
Duration shortestResolution,
Duration longestResolution,
Duration timeliness,
boolean rebuildRequired,
String fromStation,
GeographicalArea defaultDisplayArea,
BrokerConfigDataSource source)
Creates an object responsible for managing the metadata associated with a database, and spawning driver instances. |
|
| Method Summary | |
void |
addRegion(String regionID,
MultilingualString regionName)
Adds a region to the list associated with a MetDataSource. If the region is already in the list, updates its associated details. |
void |
addStation(String stationID,
MultilingualString placeName,
Location location,
Period stationOperational,
String regionID)
Adds a station to the list associated with a MetDataSource. If the station is already in the list, updates the data associated with the station. |
boolean |
catalogCardExists(String clientSessionName,
String stationID,
MetElement element,
MetDuration resolution)
|
boolean |
checkCatalog(String clientSessionName,
String stationID,
MetElement element,
Duration resolution,
Period period)
|
boolean |
checkElementCatalog(String stationID,
MetElement element,
Duration resolution,
Period period)
|
MetSourceImpl.MetSourceContext |
createMetSourceContextForUser(String clientSessionName,
String language)
|
void |
disposeMetSourceContext(String clientSessionName)
Deletes the session for this client. |
void |
fillSpatialMetSet(SpatialMetRequest request,
MetBrokerImpl broker,
String language,
SpatialMetSetImpl result,
String clientSessionName)
|
DataSourceDetail |
getDetails(String language)
Returns the details of the MetSource in a transient form |
Period |
getOperatingPeriod()
Get the period over which the database has data available |
String |
getParameterValue(String name)
|
Date |
getRecent()
Gets a data for which currently operating stations of this database should have data |
Region |
getRegion(String clientSessionName,
String language,
String regionID)
|
String |
getStationReport(String clientSessionName,
String stationID,
String language)
|
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 stationID,
String language)
|
WeatherStation[] |
listMatchingStations(String clientSessionName,
SpatialMetRequest request,
String language)
Get an array of all the stations that can potentially contribute to the request To contribute, stations must fall within the area specified in the request, and record elements requested, and have operated at some point during the period of interest of the request. |
Region[] |
listRegions(String clientSessionName,
String language)
|
WeatherStation[] |
listStations(String clientSessionName,
String regionID,
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. |
void |
updateStationListIfRequired(String fromStation)
|
| Methods inherited from class net.agmodel.brokerImpl.GenericSourceImpl |
enter, exit, getDefaultDisplayArea, getDriverInstance, getGeographicalArea, getID, getLog4jCategory, getLoginRequirements, getName, getSystemPassword, getSystemUsercode, putName |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.agmodel.brokerImpl.GenericSourceForDrivers |
getID, getLog4jCategory, getName, getSystemPassword, getSystemUsercode |
| Constructor Detail |
public MetSourceImpl(String ID,
MetBrokerImpl broker,
MultilingualString sourceName,
GeographicalArea coverage,
int loginRequirements,
String systemUsercode,
String systemPassword,
String driverName,
String suggestedTimeZone,
float suggestedDailyOffset,
Duration shortestResolution,
Duration longestResolution,
Duration timeliness,
boolean rebuildRequired,
String fromStation,
GeographicalArea defaultDisplayArea,
BrokerConfigDataSource source)
throws GeneralException
ID - the identifier MetBroker uses to refer to this data sourcebroker - a link back to MetBrokersourceName - the source name, maybe in several languages.coverage - the area of the globe covered by this data sourceloginRequirements - whether the database requires that users log in (use one of the three constants in the MetBroker interface)systemUsercode - the usercode that MetBroker uses to get metadatasystemPassword - the password that MetBroker uses to get metadatadriverName - the name of the database driver class (assumed to be in net.agmodel.metDriver package)suggestedTimeZone - the default timeZone for queries to the database and responses (not necessarily the timezone of the data)suggestedDailyOffset - the default offset to use for daily data (usually 9 for 9am or 0 for midnight)shortestResolution - the shortest resolution data stored in the database (eg hourly)longestResolution - the longest resolution data stored in the database (eg daily)timeliness - the maximum time it takes for newly recorded data to get into the database (usually between a month and an hour)rebuildRequired - force rebuilding of the list of stationsfromStation - building the station list from this station onward
GeneralException| Method Detail |
public Date getRecent()
MetSourceForDrivers
getRecent in interface MetSourceForDrivers
public void updateStationListIfRequired(String fromStation)
throws GeneralException
GeneralException
public WeatherStation getWeatherStation(String stationID,
String language)
getWeatherStation in interface MetSourceForDrivers
public String getStationReport(String clientSessionName,
String stationID,
String language)
public void addStation(String stationID,
MultilingualString placeName,
Location location,
Period stationOperational,
String regionID)
addStation in interface MetSourceForDriversstationID - the ID that the host database uses to refer to the stationplaceName - the name of the place where the station is located, in one or more languageslocation - the location of the stationstationOperational - 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.
public void addRegion(String regionID,
MultilingualString regionName)
addRegion in interface MetSourceForDriversregionID - a string used to identify the region on the host database.regionName - the name of the region in one or more languages.
public void recordElementStatus(String stationID,
MetElement element,
Duration resolution,
Period period,
boolean status)
MetSourceForDrivers
recordElementStatus in interface MetSourceForDriversstationID - the station in questionelement - the meteorological elementperiod - the period of time (which might not have an end specified)resolution - the temporal resolution. There are useful constants in weatherData.MetDurationstatus - true if the element was recorded over the period, false if it wasn't
public void recordMultipleElementStatus(String stationID,
MetElement[] elements,
Duration[] resolutions,
Period period,
boolean status)
MetSourceForDrivers
recordMultipleElementStatus in interface MetSourceForDriversstationID - the station in questionelements - the meteorological elementsperiod - 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
public boolean checkElementCatalog(String stationID,
MetElement element,
Duration resolution,
Period period)
checkElementCatalog in interface MetSourceForDrivers
public boolean checkCatalog(String clientSessionName,
String stationID,
MetElement element,
Duration resolution,
Period period)
public boolean catalogCardExists(String clientSessionName,
String stationID,
MetElement element,
MetDuration resolution)
public String getSuggestedTimezone()
MetSourceForDrivers
getSuggestedTimezone in interface MetSourceForDriverspublic float getSuggestedDailyOffset()
MetSourceForDrivers
getSuggestedDailyOffset in interface MetSourceForDriverspublic Period getOperatingPeriod()
public DataSourceDetail getDetails(String language)
getDetails in class GenericSourceImpllanguage - the language to use for any text;
public WeatherStation[] listMatchingStations(String clientSessionName,
SpatialMetRequest request,
String language)
request - specifies the data required
public WeatherStation[] listStations(String clientSessionName,
String regionID,
String language)
public Region[] listRegions(String clientSessionName,
String language)
public Region getRegion(String clientSessionName,
String language,
String regionID)
public void fillSpatialMetSet(SpatialMetRequest request,
MetBrokerImpl broker,
String language,
SpatialMetSetImpl result,
String clientSessionName)
throws ConnectionException
ConnectionExceptionpublic String getParameterValue(String name)
getParameterValue in interface GenericSourceForDrivers
public void processSequence(MetElement element,
MetSequence sequence,
MetRequest request,
Duration queryResolution,
StationDataSetImpl result)
MetSourceForDrivers
processSequence in interface MetSourceForDriverselement - the element that the sequence representsqueryResolution - the resolution of the original database querysequence - a set of data or null if there is no dataresult - the result set that the sequence will be added into
public MetSourceImpl.MetSourceContext createMetSourceContextForUser(String clientSessionName,
String language)
public void disposeMetSourceContext(String clientSessionName)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||