net.sf.farrago.namespace
Interface FarragoMedNameDirectory

All Known Implementing Classes:
FlatFileNameDirectory, MedAbstractNameDirectory, MedJdbcNameDirectory, MedMdrNameDirectory, MedMockNameDirectory

public interface FarragoMedNameDirectory

FarragoMedNameDirectory defines a virtual hierarchical namespace interface in which to look up tables, routines, other namespaces, etc.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/namespace/FarragoMedNameDirectory.java#12 $
Author:
John V. Sichi

Method Summary
 FarragoMedColumnSet lookupColumnSet(FarragoTypeFactory typeFactory, String foreignName, String[] localName)
          Looks up a FarragoMedColumnSet by name.
 FarragoMedNameDirectory lookupSubdirectory(String foreignName)
          Looks up an immediate subdirectory by name.
 FemBaseColumnSet newImportedColumnSet(FarragoRepos repos, String tableName)
          Creates a new instance of FemBaseColumnSet in the catalog to represent an imported table.
 boolean queryMetadata(FarragoMedMetadataQuery query, FarragoMedMetadataSink sink)
          Executes a query against the metadata contained by this directory.
 

Method Detail

lookupColumnSet

FarragoMedColumnSet lookupColumnSet(FarragoTypeFactory typeFactory,
                                    String foreignName,
                                    String[] localName)
                                    throws SQLException
Looks up a FarragoMedColumnSet by name. This method supports Farrago's capability to reference a foreign table directly without having to create local metadata about it.

Parameters:
typeFactory - FarragoTypeFactory to use for defining types
foreignName - simple name of foreign ColumnSet to lookup as a direct child of this directory
localName - compound identifier by which FarragoMedColumnSet will be referenced locally
Returns:
FarragoMedColumnSet, or null if none found
Throws:
SQLException - if metadata access is unsuccessful

lookupSubdirectory

FarragoMedNameDirectory lookupSubdirectory(String foreignName)
                                           throws SQLException
Looks up an immediate subdirectory by name.

Parameters:
foreignName - identifier for subdirectory
Returns:
subdirectory, or null if none found
Throws:
SQLException - if metadata access is unsuccessful

queryMetadata

boolean queryMetadata(FarragoMedMetadataQuery query,
                      FarragoMedMetadataSink sink)
                      throws SQLException
Executes a query against the metadata contained by this directory. This method supports the SQL/MED IMPORT FOREIGN SCHEMA statement, and general metadata browsing.

NOTE: the supplied sink may be used to implement passive aborts by throwing an unchecked exception when an abort request is detected.

Parameters:
query - the query to execute
sink - target which receives the query results
Returns:
true if the query executed successfully; false if the requested query type was not supported
Throws:
SQLException - if metadata access is unsuccessful (but not if query is unsupported)

newImportedColumnSet

FemBaseColumnSet newImportedColumnSet(FarragoRepos repos,
                                      String tableName)
Creates a new instance of FemBaseColumnSet in the catalog to represent an imported table.

Parameters:
repos - repository storing catalog
tableName - name of imported table
Returns:
new object in catalog