net.agmodel.metDriver
Interface MetAccessMechanism

All Superinterfaces:
DBAccessMechanism
All Known Implementing Classes:
Amedas, CliDB, ClimDBApacheSOAP, FAWNMetDB, FieldServer, FilePerStationPerYear2, GAEMNHTML, Hitsujigaoka, HortPlus, HRI, Kanagawa, Mamedas, PAWS, Planteforsk, PrefMetDB, SASA, SNUWDMS, TERN, WakayamaRainDB

public interface MetAccessMechanism
extends DBAccessMechanism

Defines the operations that meteorological databases drivers must implement. In addition, drivers must have a constructor which takes a reference to its associated MetSourceImpl as parameters (so that it can be dynamically linked when a MetSourceImpl is loaded. Here is the relevant call in MetSourceImpl: Constructor temp = accessClass.getConstructor(new Class[] {MetSourceForDrivers.class}); Each client has their own copy of driver, holding, for example, an SQL connection to the database. In addition the same driver class might possibly be used to connect to more than one database.

Author:
Matthew Laurenson

Method Summary
 TimeZone getDatabaseTimeZone()
           
 void queryForStation(MetRequest request, String hostID, StationDataSetImpl result)
          Retrieve the relevant data from a single station.
 void updateRegionList()
          Update the list of regions (if any) held by the MetSource
 void updateStationList(String fromStation)
          Update the list of stations held by the MetSource
 
Methods inherited from interface net.agmodel.brokerImpl.DBAccessMechanism
checkForDatabaseUpdates, connectForData, connectForMetaData, disconnectFromData, disconnectFromMetaData
 

Method Detail

queryForStation

public void queryForStation(MetRequest request,
                            String hostID,
                            StationDataSetImpl result)
                     throws ConnectionException
Retrieve the relevant data from a single station.

Parameters:
request - describes what data is required
hostID - identifies which station from the met data source to query
result - the skeletal query result (created by MetSourceImpl) for the driver fill in with data hostID is the native identifier for the station on the host database system.
If the request is a StationMetRequest, then the hostID will also be embedded in the request but should be ignored by this method. If there is no data at all for the station, this method should return the skeletal query result untouched. If there is no data for a particular element, then no corresponding sequence should be inserted into the StationDataSetImpl.
Throws:
ConnectionException

updateStationList

public void updateStationList(String fromStation)
                       throws GeneralException
Update the list of stations held by the MetSource

Parameters:
fromStation - start the update from this station (the driver may ignore this value and update all stations) The fromStation parameter is intended to help with large databases where, particularly during driver development, the updating process may fail midway through. It avoids the need to start again from the beginning. Drivers are welcome to entirely ignore this parameter. A null parameter value indicates that updating should start from the beginning.
Throws:
GeneralException

updateRegionList

public void updateRegionList()
                      throws GeneralException
Update the list of regions (if any) held by the MetSource

Throws:
GeneralException

getDatabaseTimeZone

public TimeZone getDatabaseTimeZone()


Copyright (C) NARC 2001 All Rights Reserved.