net.agmodel.genericBroker
Class GenericSourceImpl

java.lang.Object
  |
  +--net.agmodel.genericBroker.GenericSourceImpl

public abstract class GenericSourceImpl
extends Object

A general class for describing a datasource and providing access to it.


Field Summary
protected  GenericBrokerImpl broker
           
protected  String driverName
           
protected  String ID
           
protected  int loginRequirements
           
protected  Location2D northWestBound
           
protected  MultilingualString sourceName
           
protected  Location2D southEastBound
           
protected static boolean trace
           
 
Constructor Summary
GenericSourceImpl(String ID, GenericBrokerImpl broker, MultilingualString sourceName, GeographicalArea coverage, int loginRequirements, String driverName)
          Creates an object responsible for managing the metadata associated with a database, and spawning driver instances.
 
Method Summary
 void enter(String methodname, String clientinfo)
          Print Method entry info if tracing
 void exit(String methodname, String clientinfo)
          Print Method exiting info if tracing
protected abstract  Constructor getAccessConstructor()
           
protected abstract  DBAccessMechanism getAccessMechanism()
           
protected  DBAccessMechanism getAccessMechanism(Object[] parameters)
           
abstract  DataSourceDetail getDetails(String language)
          Returns the details of the dataSource in a form suitable for transmission to client applications
 GeographicalArea getGeographicalArea()
          The portion of the globe that the database covers
 String getID()
          Returns a unique ID which programs can use to identify the database.
 int getLoginRequirements()
          Indicate the usercode and password detail that need to be supplied by users of the database Use the constants included with this interface.
 String getName(String language)
          The name of the database, suitable for presentation to the user.
 void putName(String language, String text)
           
protected  void setCoverage(GeographicalArea newcoverage)
           
protected  void setID(String ID)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

trace

protected static boolean trace

northWestBound

protected Location2D northWestBound

southEastBound

protected Location2D southEastBound

loginRequirements

protected int loginRequirements

ID

protected String ID

sourceName

protected MultilingualString sourceName

driverName

protected String driverName

broker

protected GenericBrokerImpl broker
Constructor Detail

GenericSourceImpl

public GenericSourceImpl(String ID,
                         GenericBrokerImpl broker,
                         MultilingualString sourceName,
                         GeographicalArea coverage,
                         int loginRequirements,
                         String driverName)
                  throws GeneralException
Creates an object responsible for managing the metadata associated with a database, and spawning driver instances.

Parameters:
ID - the identifier the broker uses to refer to this data source
broker - a link back to the Broker
sourceName - the source name, maybe in several languages.
coverage - the area of the globe covered by this data source
loginRequirements - whether the database requires that users log in (use one of the three constants in the GenericBrokerRMI interface)
driverName - the name of the database driver class (assumed to be in net.agmodel.metDriver package)
Throws:
GeneralException
Method Detail

getAccessConstructor

protected abstract Constructor getAccessConstructor()
                                             throws ClassNotFoundException,
                                                    NoSuchMethodException
ClassNotFoundException
NoSuchMethodException

getAccessMechanism

protected abstract DBAccessMechanism getAccessMechanism()

getAccessMechanism

protected DBAccessMechanism getAccessMechanism(Object[] parameters)

getName

public String getName(String language)
The name of the database, suitable for presentation to the user. Usually this method would be called by the broker, which knows the language already.

Parameters:
language - the language in which to return the name
Returns:
the name of the database
Throws:
IllegalArgumentException - if the language is not known

putName

public void putName(String language,
                    String text)

setID

protected void setID(String ID)

getID

public String getID()
Returns a unique ID which programs can use to identify the database.

Returns:
the ID associated with the database

setCoverage

protected void setCoverage(GeographicalArea newcoverage)

getGeographicalArea

public GeographicalArea getGeographicalArea()
The portion of the globe that the database covers

Returns:
a GeographicalArea which encompasses the locations of all the stations in the database.

getLoginRequirements

public int getLoginRequirements()
Indicate the usercode and password detail that need to be supplied by users of the database Use the constants included with this interface.


getDetails

public abstract DataSourceDetail getDetails(String language)
Returns the details of the dataSource in a form suitable for transmission to client applications

Parameters:
language - the language to use for any text;
Returns:
the details

enter

public void enter(String methodname,
                  String clientinfo)
Print Method entry info if tracing


exit

public void exit(String methodname,
                 String clientinfo)
Print Method exiting info if tracing