uk.ac.ic.doc.automed.wrappers
Class AutoMedWrapper

java.lang.Object
  |
  +--uk.ac.ic.doc.automed.wrappers.AutoMedWrapper
Direct Known Subclasses:
SQLWrapper

public abstract class AutoMedWrapper
extends java.lang.Object

An AutoMedWrapper represents an open connection to a datasource. Since datasources are so varied, much of the functionality of is deligated to implemention A foundation class for AutoMed wrappers.

Author:
Peter McBrien (pjm@doc.ic.ac.uk)

Constructor Summary
AutoMedWrapper()
           
 
Method Summary
static boolean atDebugLevel(int level)
          Determine is debug is at or above a certain level.
abstract  ASG executeIQL(ASG q)
           
abstract  AutoMedResult executeLocalQuery(AutoMedQuery q)
           
 AccessMethod getAccessMethod()
          Returns the AccessMethod associated with this wrapper, which holds the details of the datasource being wrapped.
static AutoMedWrapper getAutoMedWrapper(AccessMethod am, java.lang.String password)
          Build the appropriate wrapper for a given stored AccessMethod
 Schema getSchema()
          Returns the Schema that represents in the datasource in terms of SchemaObjects.
static void setDebugLevel(int debug)
          Set the debug level for all AutoMed wrappers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AutoMedWrapper

public AutoMedWrapper()
Method Detail

setDebugLevel

public static void setDebugLevel(int debug)
Set the debug level for all AutoMed wrappers. A value of 0 ensures no debug information is produced; 10 ensures all debug information is produced.


atDebugLevel

public static boolean atDebugLevel(int level)
Determine is debug is at or above a certain level.

Parameters:
level - to test if debug is at or above

getAccessMethod

public final AccessMethod getAccessMethod()
Returns the AccessMethod associated with this wrapper, which holds the details of the datasource being wrapped.


getSchema

public final Schema getSchema()
Returns the Schema that represents in the datasource in terms of SchemaObjects.


getAutoMedWrapper

public static AutoMedWrapper getAutoMedWrapper(AccessMethod am,
                                               java.lang.String password)
                                        throws DataSourceException
Build the appropriate wrapper for a given stored AccessMethod

Parameters:
am - The AccessMethod which contains the details needed in order to create the wrapper.
password - Any password that the datasource may require to access it. If no password is required this may be left null.
Throws:
DataSourceException - if the AccessMethod.getDBDriver() returns a java class for which there is not a known supporting AutoMedWrapper subclass.

executeLocalQuery

public abstract AutoMedResult executeLocalQuery(AutoMedQuery q)
                                         throws DataSourceException
DataSourceException

executeIQL

public abstract ASG executeIQL(ASG q)
                        throws DataSourceException
DataSourceException