net.agmodel.brokerImpl
Class GenericSourceImpl

java.lang.Object
  extended bynet.agmodel.brokerImpl.GenericSourceImpl
All Implemented Interfaces:
GenericSourceForDrivers
Direct Known Subclasses:
MetSourceImpl

public abstract class GenericSourceImpl
extends Object
implements GenericSourceForDrivers

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


Constructor Summary
GenericSourceImpl(String ID, GenericBrokerImpl broker, MultilingualString sourceName, GeographicalArea coverage, int loginRequirements, String driverName, GeographicalArea defaultDisplayArea)
           
GenericSourceImpl(String ID, GenericBrokerImpl broker, MultilingualString sourceName, GeographicalArea coverage, int loginRequirements, String driverName, GeographicalArea defaultDisplayArea, BrokerConfigDataSource source)
          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
 GeographicalArea getDefaultDisplayArea()
          The portion of the globe that the database covers
abstract  DataSourceDetail getDetails(String language)
          Returns the details of the dataSource in a form suitable for transmission to client applications
 DBAccessMechanism getDriverInstance()
           
 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.
 org.apache.log4j.Category getLog4jCategory()
           
 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.
 String getSystemPassword()
          Gets the password, if any, held by MetBroker for this particular source.
 String getSystemUsercode()
          Gets the usercode, if any, held by MetBroker for this particular source.
 void putName(String language, String text)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.agmodel.brokerImpl.GenericSourceForDrivers
getParameterValue
 

Constructor Detail

GenericSourceImpl

public GenericSourceImpl(String ID,
                         GenericBrokerImpl broker,
                         MultilingualString sourceName,
                         GeographicalArea coverage,
                         int loginRequirements,
                         String driverName,
                         GeographicalArea defaultDisplayArea,
                         BrokerConfigDataSource source)
                  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

GenericSourceImpl

public GenericSourceImpl(String ID,
                         GenericBrokerImpl broker,
                         MultilingualString sourceName,
                         GeographicalArea coverage,
                         int loginRequirements,
                         String driverName,
                         GeographicalArea defaultDisplayArea)
                  throws GeneralException
Method Detail

getLog4jCategory

public org.apache.log4j.Category getLog4jCategory()
Specified by:
getLog4jCategory in interface GenericSourceForDrivers

getSystemUsercode

public String getSystemUsercode()
Description copied from interface: GenericSourceForDrivers
Gets the usercode, if any, held by MetBroker for this particular source.

Specified by:
getSystemUsercode in interface GenericSourceForDrivers
Returns:
the usercode, typically used to get metadata.

getSystemPassword

public String getSystemPassword()
Description copied from interface: GenericSourceForDrivers
Gets the password, if any, held by MetBroker for this particular source.

Specified by:
getSystemPassword in interface GenericSourceForDrivers
Returns:
the password, typically used to get metadata.

getDriverInstance

public DBAccessMechanism getDriverInstance()

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.

Specified by:
getName in interface GenericSourceForDrivers
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)

getID

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

Specified by:
getID in interface GenericSourceForDrivers
Returns:
the ID associated with the database

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.

getDefaultDisplayArea

public GeographicalArea getDefaultDisplayArea()
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



Copyright (C) NARC 2001 All Rights Reserved.