net.sf.farrago.namespace.impl
Class MedAbstractDataWrapper

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.MedAbstractDataWrapper
All Implemented Interfaces:
FarragoMedDataWrapperInfo, FarragoMedDataWrapper, FarragoPlugin, FarragoAllocation, ClosableAllocation
Direct Known Subclasses:
FlatFileDataWrapper, FtrsDataWrapper, LcsDataWrapper, MedJdbcForeignDataWrapper, MedMdrForeignDataWrapper, MedMockForeignDataWrapper, MedMockLocalDataWrapper, MedMqlForeignDataWrapper

public abstract class MedAbstractDataWrapper
extends MedAbstractBase
implements FarragoMedDataWrapper

MedAbstractDataWrapper is an abstract base class for implementations of the FarragoMedDataWrapper interface.

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

Field Summary
private  String libraryName
           
private  Properties props
           
private  FarragoRepos repos
           
 
Fields inherited from class net.sf.farrago.plugin.FarragoAbstractPluginBase
BOOLEAN_CHOICES_DEFAULT_FALSE, BOOLEAN_CHOICES_DEFAULT_TRUE, EMPTY_DRIVER_PROPERTIES
 
Constructor Summary
protected MedAbstractDataWrapper()
           
 
Method Summary
 void closeAllocation()
          Closes this object.
 DriverPropertyInfo[] getColumnPropertyInfo(Locale locale, Properties wrapperProps, Properties serverProps, Properties tableProps, Properties columnProps)
          Obtains information about the properties applicable to individual column initialization (the columnPropMap parameter to the FarragoMedDataServer.newColumnSet(java.lang.String[], java.util.Properties, net.sf.farrago.type.FarragoTypeFactory, org.eigenbase.reltype.RelDataType, java.util.Map) method).
 DriverPropertyInfo[] getColumnSetPropertyInfo(Locale locale, Properties wrapperProps, Properties serverProps, Properties tableProps)
          Obtains information about the properties applicable to column set initialization (the tableProps parameter to the newColumnSet method).
 String getLibraryName()
          return the library name used to initialize this plugin
 DriverPropertyInfo[] getPluginPropertyInfo(Locale locale, Properties props)
          Obtains information about the properties applicable to plugin initialization.
 Properties getProperties()
          return the options with which this plugin was initialized
 FarragoRepos getRepos()
           
 DriverPropertyInfo[] getServerPropertyInfo(Locale locale, Properties wrapperProps, Properties serverProps)
          Obtains information about the properties applicable to server initialization (the props parameter to the newServer method).
 void initialize(FarragoRepos repos, Properties props)
          Initializes this plugin with a given set of properties.
 boolean isForeign()
          Determines whether this data wrapper accesses foreign data, or manages local data.
 void setLibraryName(String libraryName)
          set the library name used to initialize this plugin
 boolean supportsServerSharing()
          Returns whether server supports sharing by multiple threads.
 
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.FarragoMedDataWrapper
newServer
 
Methods inherited from interface net.sf.farrago.plugin.FarragoPlugin
getDescription, getSuggestedName
 

Field Detail

repos

private FarragoRepos repos

props

private Properties props

libraryName

private String libraryName
Constructor Detail

MedAbstractDataWrapper

protected MedAbstractDataWrapper()
Method Detail

getRepos

public FarragoRepos getRepos()
Returns:
the repos with which this wrapper was initialized

getProperties

public Properties getProperties()
Description copied from interface: FarragoPlugin
return the options with which this plugin was initialized

Specified by:
getProperties in interface FarragoPlugin
Returns:
the options specified by CREATE FOREIGN DATA WRAPPER

getLibraryName

public String getLibraryName()
Description copied from interface: FarragoPlugin
return the library name used to initialize this plugin

Specified by:
getLibraryName in interface FarragoPlugin
Returns:
the library name used to initialize this wrapper

setLibraryName

public void setLibraryName(String libraryName)
Description copied from interface: FarragoPlugin
set the library name used to initialize this plugin

Specified by:
setLibraryName in interface FarragoPlugin
Parameters:
libraryName - library name used to initialize this wrapper

getPluginPropertyInfo

public DriverPropertyInfo[] getPluginPropertyInfo(Locale locale,
                                                  Properties props)
Description copied from interface: FarragoMedDataWrapperInfo
Obtains information about the properties applicable to plugin initialization.

Specified by:
getPluginPropertyInfo in interface FarragoMedDataWrapperInfo
Specified by:
getPluginPropertyInfo in interface FarragoPlugin
Parameters:
locale - Locale for formatting property info
props - proposed list of property name/value pairs which will be sent to FarragoPlugin.initialize(net.sf.farrago.catalog.FarragoRepos, java.util.Properties)
Returns:
0 or more property info descriptors

getServerPropertyInfo

public DriverPropertyInfo[] getServerPropertyInfo(Locale locale,
                                                  Properties wrapperProps,
                                                  Properties serverProps)
Description copied from interface: FarragoMedDataWrapperInfo
Obtains information about the properties applicable to server initialization (the props parameter to the newServer method).

Specified by:
getServerPropertyInfo in interface FarragoMedDataWrapperInfo
Parameters:
locale - Locale for formatting property info
wrapperProps - proposed list of property name/value pairs which will be sent to FarragoPlugin.initialize(net.sf.farrago.catalog.FarragoRepos, java.util.Properties)
serverProps - proposed list of property name/value pairs which will be sent to FarragoMedDataWrapper.newServer(java.lang.String, java.util.Properties)
Returns:
0 or more property info descriptors

getColumnSetPropertyInfo

public DriverPropertyInfo[] getColumnSetPropertyInfo(Locale locale,
                                                     Properties wrapperProps,
                                                     Properties serverProps,
                                                     Properties tableProps)
Description copied from interface: FarragoMedDataWrapperInfo
Obtains information about the properties applicable to column set initialization (the tableProps parameter to the newColumnSet method).

Specified by:
getColumnSetPropertyInfo in interface FarragoMedDataWrapperInfo
Parameters:
locale - Locale for formatting property info
wrapperProps - proposed list of property name/value pairs which will be sent to FarragoPlugin.initialize(net.sf.farrago.catalog.FarragoRepos, java.util.Properties)
serverProps - proposed list of property name/value pairs which will be sent to FarragoMedDataWrapper.newServer(java.lang.String, java.util.Properties)
tableProps - proposed list of property name/value pairs which will be sent to the tableProps parameter of FarragoMedDataServer.newColumnSet(java.lang.String[], java.util.Properties, net.sf.farrago.type.FarragoTypeFactory, org.eigenbase.reltype.RelDataType, java.util.Map)
Returns:
0 or more property info descriptors

getColumnPropertyInfo

public DriverPropertyInfo[] getColumnPropertyInfo(Locale locale,
                                                  Properties wrapperProps,
                                                  Properties serverProps,
                                                  Properties tableProps,
                                                  Properties columnProps)
Description copied from interface: FarragoMedDataWrapperInfo
Obtains information about the properties applicable to individual column initialization (the columnPropMap parameter to the FarragoMedDataServer.newColumnSet(java.lang.String[], java.util.Properties, net.sf.farrago.type.FarragoTypeFactory, org.eigenbase.reltype.RelDataType, java.util.Map) method).

Specified by:
getColumnPropertyInfo in interface FarragoMedDataWrapperInfo
Parameters:
locale - Locale for formatting property info
wrapperProps - proposed list of property name/value pairs which will be sent to FarragoPlugin.initialize(net.sf.farrago.catalog.FarragoRepos, java.util.Properties)
serverProps - proposed list of property name/value pairs which will be sent to FarragoMedDataWrapper.newServer() FarragoMedDataWrapper.newServer(java.lang.String, java.util.Properties)
tableProps - proposed list of property name/value pairs which will be sent as the tableProps parameter of FarragoMedDataServer.newColumnSet(java.lang.String[], java.util.Properties, net.sf.farrago.type.FarragoTypeFactory, org.eigenbase.reltype.RelDataType, java.util.Map)
columnProps - proposed list of property name/value pairs which will be sent as an entry in the columnPropMap parameter of FarragoMedDataServer.newColumnSet(java.lang.String[], java.util.Properties, net.sf.farrago.type.FarragoTypeFactory, org.eigenbase.reltype.RelDataType, java.util.Map)
Returns:
0 or more property info descriptors

initialize

public void initialize(FarragoRepos repos,
                       Properties props)
                throws SQLException
Description copied from interface: FarragoPlugin
Initializes this plugin with a given set of properties. This is called after an uninitialized instance has been created via Class.forName. As much validation as possible should be performed.

Specified by:
initialize in interface FarragoPlugin
Parameters:
repos - FarragoRepos which can be used for metadata access
props - plugin properties
Throws:
SQLException - if plugin initialization is unsuccessful

closeAllocation

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

Specified by:
closeAllocation in interface ClosableAllocation

isForeign

public boolean isForeign()
Description copied from interface: FarragoMedDataWrapperInfo
Determines whether this data wrapper accesses foreign data, or manages local data.

Specified by:
isForeign in interface FarragoMedDataWrapperInfo
Returns:
true for foreign data; false for local data

supportsServerSharing

public boolean supportsServerSharing()
Description copied from interface: FarragoMedDataWrapper
Returns whether server supports sharing by multiple threads. Used by FarragoDataWrapperCache.loadServer(java.lang.String, net.sf.farrago.namespace.FarragoMedDataWrapper, java.util.Properties) to determine if the entry should be exclusive (not shared).

Specified by:
supportsServerSharing in interface FarragoMedDataWrapper
Returns:
true only if server sharing is supported