net.sf.farrago.namespace.impl
Class MedAbstractDataServer

java.lang.Object
  extended by net.sf.farrago.plugin.FarragoAbstractPluginBase
      extended by net.sf.farrago.namespace.impl.MedAbstractBase
          extended by net.sf.farrago.namespace.impl.MedAbstractDataServer
All Implemented Interfaces:
FarragoMedDataServer, FarragoAllocation, ClosableAllocation
Direct Known Subclasses:
FlatFileDataServer, MedAbstractLocalDataServer, MedJdbcDataServer, MedMdrDataServer, MedMockDataServer, MedMqlDataServer

public abstract class MedAbstractDataServer
extends MedAbstractBase
implements FarragoMedDataServer

MedAbstractDataServer is an abstract base class for implementations of the FarragoMedDataServer interface.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/namespace/impl/MedAbstractDataServer.java#17 $
Author:
John V. Sichi

Field Summary
private  DataSource loopbackDataSource
           
private  Properties props
           
private  String serverMofId
           
 
Fields inherited from class net.sf.farrago.plugin.FarragoAbstractPluginBase
BOOLEAN_CHOICES_DEFAULT_FALSE, BOOLEAN_CHOICES_DEFAULT_TRUE, EMPTY_DRIVER_PROPERTIES
 
Fields inherited from interface net.sf.farrago.namespace.FarragoMedDataServer
PROP_SERVER_NAME, PROP_SERVER_TYPE, PROP_SERVER_VERSION
 
Constructor Summary
protected MedAbstractDataServer(String serverMofId, Properties props)
           
 
Method Summary
 void closeAllocation()
          Closes this object.
 DataSource getLoopbackDataSource()
           
 FarragoMedNameDirectory getNameDirectory()
          Gets a FarragoMedNameDirectory corresponding to this server.
 Properties getProperties()
           
 Object getRuntimeSupport(Object param)
          Gets an object needed for runtime support.
 String getServerMofId()
           
 void registerRelMetadataProviders(ChainedRelMetadataProvider chain)
          Gives this wrapper a chance to register one or more RelMetadataProviders in the chain which will be used to answer relational expression metadata queries during optimization.
 void registerRules(RelOptPlanner planner)
          Gives this wrapper a chance to register any special optimization rules.
 void releaseResources()
          Gives this wrapper a chance to release any resources.
 void setLoopbackDataSource(DataSource loopbackDataSource)
          Sets a loopback DataSource which can be used to issue internal SQL queries against the containing DBMS.
 
Methods inherited from class net.sf.farrago.plugin.FarragoAbstractPluginBase
getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getLongProperty, getShortProperty, requireProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.farrago.namespace.FarragoMedDataServer
newColumnSet
 

Field Detail

serverMofId

private String serverMofId

props

private Properties props

loopbackDataSource

private DataSource loopbackDataSource
Constructor Detail

MedAbstractDataServer

protected MedAbstractDataServer(String serverMofId,
                                Properties props)
Method Detail

getServerMofId

public String getServerMofId()
Returns:
the MofId of the catalog definition for this server

getProperties

public Properties getProperties()
Returns:
the options specified by CREATE SERVER

getLoopbackDataSource

public DataSource getLoopbackDataSource()
Returns:
current loopback data source

setLoopbackDataSource

public void setLoopbackDataSource(DataSource loopbackDataSource)
Description copied from interface: FarragoMedDataServer
Sets a loopback DataSource which can be used to issue internal SQL queries against the containing DBMS. This may be called multiple times on the same server instance with different data sources; the server should use only the last one provided.

Specified by:
setLoopbackDataSource in interface FarragoMedDataServer
Parameters:
loopbackDataSource - a DataSource for establishing a loopback connection into Farrago, or null if loopback connections are not available in the current context

getNameDirectory

public FarragoMedNameDirectory getNameDirectory()
                                         throws SQLException
Description copied from interface: FarragoMedDataServer
Gets a FarragoMedNameDirectory corresponding to this server.

Specified by:
getNameDirectory in interface FarragoMedDataServer
Returns:
directory, or null if this server does not have the required metadata capability
Throws:
SQLException - if directory access is unsuccessful (but not if directory access is unsupported)

getRuntimeSupport

public Object getRuntimeSupport(Object param)
                         throws SQLException
Description copied from interface: FarragoMedDataServer
Gets an object needed for runtime support. Typically, this will be called from code generated by this server. The meaning of this is entirely dependent on the server implementation. If the returned object implements FarragoAllocation, its closeAllocation() method will be called automatically as soon as it is no longer needed.

Specified by:
getRuntimeSupport in interface FarragoMedDataServer
Parameters:
param - parameter supplied at runtime
Returns:
support object
Throws:
SQLException

registerRules

public void registerRules(RelOptPlanner planner)
Description copied from interface: FarragoMedDataServer
Gives this wrapper a chance to register any special optimization rules. This method may be called more than once, each time with a different planner instance.

Specified by:
registerRules in interface FarragoMedDataServer
Parameters:
planner - the planner in which the rules should be registered

registerRelMetadataProviders

public void registerRelMetadataProviders(ChainedRelMetadataProvider chain)
Description copied from interface: FarragoMedDataServer
Gives this wrapper a chance to register one or more RelMetadataProviders in the chain which will be used to answer relational expression metadata queries during optimization. Wrappers which define their own relational expressions will generally need to supply corresponding metadata providers.

Specified by:
registerRelMetadataProviders in interface FarragoMedDataServer
Parameters:
chain - receives wrappers's custom providers, if any

closeAllocation

public void closeAllocation()
Description copied from interface: ClosableAllocation
Closes this object.

Specified by:
closeAllocation in interface ClosableAllocation

releaseResources

public void releaseResources()
Description copied from interface: FarragoMedDataServer
Gives this wrapper a chance to release any resources.

Specified by:
releaseResources in interface FarragoMedDataServer