net.sf.farrago.namespace.mdr
Class MedMdrForeignDataWrapper

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
              extended by net.sf.farrago.namespace.mdr.MedMdrForeignDataWrapper
All Implemented Interfaces:
FarragoMedDataWrapperInfo, FarragoMedDataWrapper, FarragoPlugin, FarragoAllocation, ClosableAllocation

public class MedMdrForeignDataWrapper
extends MedAbstractDataWrapper

MedMdrForeignDataWrapper implements the FarragoMedDataWrapper interface by representing classes in an MDR repository as tables (mapping the class extent to a corresponding set of rows).

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/namespace/mdr/MedMdrForeignDataWrapper.java#13 $
Author:
John V. Sichi

Field Summary
 
Fields inherited from class net.sf.farrago.plugin.FarragoAbstractPluginBase
BOOLEAN_CHOICES_DEFAULT_FALSE, BOOLEAN_CHOICES_DEFAULT_TRUE, EMPTY_DRIVER_PROPERTIES
 
Constructor Summary
MedMdrForeignDataWrapper()
          Default constructor for access to external repositories.
 
Method Summary
 String getDescription(Locale locale)
          Obtains a description of this plugin.
 String getSuggestedName()
          Obtains a suggested name for this plugin in the SQL catalog.
 void initialize(FarragoRepos repos, Properties props)
          Initializes this plugin with a given set of properties.
 FarragoMedDataServer newServer(String serverMofId, Properties props)
          Creates an instance of this wrapper for a particular server.
 
Methods inherited from class net.sf.farrago.namespace.impl.MedAbstractDataWrapper
closeAllocation, getColumnPropertyInfo, getColumnSetPropertyInfo, getLibraryName, getPluginPropertyInfo, getProperties, getRepos, getServerPropertyInfo, isForeign, setLibraryName, supportsServerSharing
 
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
 

Constructor Detail

MedMdrForeignDataWrapper

public MedMdrForeignDataWrapper()
Default constructor for access to external repositories.

Method Detail

getSuggestedName

public String getSuggestedName()
Description copied from interface: FarragoPlugin
Obtains a suggested name for this plugin in the SQL catalog.

Returns:
suggested name

getDescription

public String getDescription(Locale locale)
Description copied from interface: FarragoPlugin
Obtains a description of this plugin.

Parameters:
locale - Locale for formatting description
Returns:
localized description

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
Overrides:
initialize in class MedAbstractDataWrapper
Parameters:
repos - FarragoRepos which can be used for metadata access
props - plugin properties
Throws:
SQLException - if plugin initialization is unsuccessful

newServer

public FarragoMedDataServer newServer(String serverMofId,
                                      Properties props)
                               throws SQLException
Description copied from interface: FarragoMedDataWrapper
Creates an instance of this wrapper for a particular server. This supports the SQL/MED CREATE SERVER statement. The TYPE and VERSION attributes are rolled in with the other properties. As much validation as possible should be performed, including establishing connections if appropriate.

If this wrapper returns false from the isForeign method, then returned server instances must implement the FarragoMedLocalDataServer interface.

Parameters:
serverMofId - MOFID of server definition in repository; this can be used for accessing the server definition from generated code
props - server properties
Returns:
new server instance
Throws:
SQLException - if server connection is unsuccessful