net.agmodel.brokerImpl
Interface DBAccessMechanism

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

public interface DBAccessMechanism

Defines general operations on a database.
Separate methods are used for connections for data and metadata because in a number of cases these are stored on different machines in different formats.

Author:
Matthew Laurenson

Method Summary
 void checkForDatabaseUpdates()
          connect to database and check the metadata
 boolean connectForData(String username, String password)
          Called before data is retrieved from the AccessMechanism
 boolean connectForMetaData(String username, String password)
          Called before metadata is retrieved from the AccessMechanism
 void disconnectFromData()
          Called after data is retrieved from the AccessMechanism using connectForData.
 void disconnectFromMetaData()
          Called after meta data is retrieved from the AccessMechanism using connectForMetaData.
 

Method Detail

connectForData

public boolean connectForData(String username,
                              String password)
                       throws ConnectionException
Called before data is retrieved from the AccessMechanism

Parameters:
username - a valid username for the database if it requires it, or null otherwise.
password - the corresponding password (not encrypted) if required, or null otherwise.
Returns:
true if the connection was established, false otherwise
Throws:
ConnectionException - if a connection could not be established

disconnectFromData

public void disconnectFromData()
                        throws ConnectionException
Called after data is retrieved from the AccessMechanism using connectForData.

Throws:
ConnectionException - if a connection could not be disconnected

connectForMetaData

public boolean connectForMetaData(String username,
                                  String password)
                           throws ConnectionException
Called before metadata is retrieved from the AccessMechanism

Parameters:
username - a valid username for the database if it requires it, or null otherwise.
password - the corresponding password (not encrypted) if required, or null otherwise.
Returns:
true if the connection was established, false otherwise
Throws:
ConnectionException - if a connection could not be established

disconnectFromMetaData

public void disconnectFromMetaData()
                            throws ConnectionException
Called after meta data is retrieved from the AccessMechanism using connectForMetaData.

Throws:
ConnectionException - if a connection could not be disconnected

checkForDatabaseUpdates

public void checkForDatabaseUpdates()
                             throws ConnectionException
connect to database and check the metadata

Throws:
ConnectionException


Copyright (C) NARC 2001 All Rights Reserved.