AutoMedWrapperFactory
Keywords: uk.ac.ic.doc.automed.wrappers.AutoMedWrapperFactory,AutoMedWrapperFactory class

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## uk.ac.ic.doc.automed.wrappers
Class AutoMedWrapperFactory

    java.lang.Object
      |
      +--uk.ac.ic.doc.automed.wrappers.AutoMedWrapperFactory

Direct Known Subclasses:
  HdmWrapperFactory, SQLWrapperFactory, XMLWrapperFactory, YattaWrapperFactory

public abstract class AutoMedWrapperFactory
extends java.lang.Object

An AutoMedWrapperFactory class able to produce AutoMedWrapper instances, together with any data that the wrapper requires to be present in the repository. Once created in this manner, new instances of the datasource wrapper may be created using the AccessMethod recorded in the repository.

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

Field Summary
`protected java.lang.String` | `automedModelName`
`protected java.lang.String` | `baseName`
`protected boolean` | `factoryInUse`
`protected java.lang.String` | `modelName`
`static java.lang.String` | `SOURCE_PREFIX` String prefixed to AutoMed oriented Model names in order to obtain source oriented Model names.

Constructor Summary
`AutoMedWrapperFactory()`

Method Summary
`void` | `clearFeatures()` Clear all the features for this factory.
`abstract Schema` | `createAutoMedSchema(AutoMedWrapper wrapper, java.lang.String schemaName)` Create an AutoMed oriented schema from the source oriented schema.
`abstract Model` | `getAutoMedModel()` Return the AutoMed oriented `Model` used to represent the `Schema` of the datasource.
`java.lang.String` | `getAutoMedModelName()` Find the name of the `Model` that will be used to represent an AutoMed oriented view of the data source.
`java.lang.String[]` | `getFeatureNames()` Return the list of feature names provided by the wrapper factory.
`int` | `getFeatures()` Return the bitwise or of all the features in use for a wrapper.
`abstract Model` | `getModel()` Return the source oriented `Model` used to represent the `Schema` of the datasource.
`java.lang.String` | `getModelBaseName()` Return text used as basis for generating `Model` names
`java.lang.String` | `getModelName()` Find the name of the `Model` that will be used when a new wrapper is generated
`boolean` | `isFeatureInUse(int features)` Test if a certain group of features is being implemented in the representation of the datasource model in the AutoMed repository
`protected abstract void` | `populateSchema(AutoMedWrapper wrapper)` Read the metadata from the wrapper connection, and store in existing Schema within the wrapper.
`void` | `setFeatures(int features)` Allows certain features of the `Model` used for `Schema`s generated by this wrapper factory.
`void` | `setFeatures(int[] features)` Allows certain features of the `Model` used for `Schema`s generated by this wrapper factory.
`void` | `setModelBaseName(java.lang.String baseName)` Each implementing class gives a name for the `Model`s that will be generated for `Schema`s.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### factoryInUse

    protected boolean factoryInUse

### baseName

    protected java.lang.String baseName

### modelName

    protected java.lang.String modelName

### automedModelName

    protected java.lang.String automedModelName

### SOURCE_PREFIX

    public static final java.lang.String SOURCE_PREFIX

  String prefixed to AutoMed oriented Model names in order to obtain source oriented Model names. Note that some wrappers do not need cd * the source/AutoMed oriented distinction, and therefore do not use this prefix.

  See Also:
    Constant Field Values

Constructor Detail

### AutoMedWrapperFactory

    public AutoMedWrapperFactory()

Method Detail

### setModelBaseName

    public void setModelBaseName(java.lang.String baseName)

  Each implementing class gives a name for the `Model`s that will be generated for `Schema`s. This same will be suffixed by the value of `getFeatures()` (unless that is zero). Thus one may create different wrappers with different features set, and they obtain distinct `Model` names. Also for source oriented `Model`s that differ from AutoMed oriented `Model`s, it will be prefixed by `SOURCE_PREFIX`.

  Parameters:
    `baseName` - text that appears in the `Model` name

### getModelBaseName

    public java.lang.String getModelBaseName()

  Return text used as basis for generating `Model` names

### isFeatureInUse

    public final boolean isFeatureInUse(int features)

  Test if a certain group of features is being implemented in the representation of the datasource model in the AutoMed repository

  Parameters:
    `features` - is the bitwise `or' of feature flags to be tested
  Returns:
    true if all those features are being ignored

### getAutoMedModelName

    public final java.lang.String getAutoMedModelName()

  Find the name of the `Model` that will be used to represent an AutoMed oriented view of the data source.

  Returns:
    name of `Model` used for the `Schema` of new wrappers.

### getModelName

    public final java.lang.String getModelName()

  Find the name of the `Model` that will be used when a new wrapper is generated

  Returns:
    name of `Model` used for the `Schema` of new wrappers.

### getFeatures

    public final int getFeatures()

  Return the bitwise or of all the features in use for a wrapper. Note that features are only defined in the implementing wrapper factory.

### clearFeatures

    public final void clearFeatures()

  Clear all the features for this factory.

### setFeatures

    public void setFeatures(int features)
                     throws IntegrityException

  Allows certain features of the `Model` used for `Schema`s generated by this wrapper factory.

  Parameters:
    `features` - a bitwise `or' of the feature flags. By default no features are used.
  Throws:
    `IntegrityException` - if the factory is already being used for producing wrappers. You should create a new wrapper factory for your settings.

### getFeatureNames

    public java.lang.String[] getFeatureNames()

  Return the list of feature names provided by the wrapper factory. The order to of feature names is the same as the bit position in the methods. In particular you may use the list on `javax.swing.JList.setListData()`

### setFeatures

    public void setFeatures(int[] features)
                     throws IntegrityException

  Allows certain features of the `Model` used for `Schema`s generated by this wrapper factory.

  Parameters:
    `features` - an array of integers containing the bit position of the feature to set. Note that is you create a `JList` from the `featureNames` of the factory, then you may called this method with the value of `javax.swing.JList.getSelectedIndices()`
  Throws:
    `IntegrityException` - if the factory is already being used for producing wrappers. You should create a new wrapper factory for your settings.

### getModel

    public abstract Model getModel()

  Return the source oriented `Model` used to represent the `Schema` of the datasource. For some wrappers, this may be the same as AutoMed oriented `Model` returned by `getAutoMedModel()`

### getAutoMedModel

    public abstract Model getAutoMedModel()

  Return the AutoMed oriented `Model` used to represent the `Schema` of the datasource.

### populateSchema

    protected abstract void populateSchema(AutoMedWrapper wrapper)
                                    throws DataSourceException

  Read the metadata from the wrapper connection, and store in existing Schema within the wrapper. To be called by `AutoMedWrapper` instances as part of the wrapper creation process.

    `DataSourceException`

### createAutoMedSchema

    public abstract Schema createAutoMedSchema(AutoMedWrapper wrapper,
                                               java.lang.String schemaName)
                                        throws IntegrityException,
                                               NotFoundException

  Create an AutoMed oriented schema from the source oriented schema.

  Parameters:
    `wrapper` - A wrapper containing the source oriented `Schema` from which the AutoMed oriented Schema should be produced.
    `schemaName` - name of the new AutoMed construct oriented schema that is to be created from the source oriented schema. This schema must not yet exist.
  Throws:
    `IntegrityException` - if schemaName already exists.
    `NotFoundException` - if you have not previously wrapped the datasource as a source oriented schema, using either `#AutoMedWrapper.getSchema(String)` or `#AutoMedWrapper.selectNewAutoMedWrapper`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD