org.eclipse.datatools.connectivity.oda.util.manifest
Class ManifestExplorer

java.lang.Object
  extended by org.eclipse.datatools.connectivity.oda.util.manifest.ManifestExplorer

public class ManifestExplorer
extends java.lang.Object

The Manifest Explorer is the entry point to explore and access the manifest of all the ODA plug-ins extensions that implement the org.eclipse.datatools.connectivity.oda.dataSource extension point. The ManifestExplorer singleton instance is retrieved using the getInstance() method.


Nested Class Summary
 class ManifestExplorer.Filter
          Filtering options for the manifest explorer to apply when retrieving a collection of ODA data source extension manifests.
 
Method Summary
static ManifestExplorer.Filter createFilter()
          Instantiates a new Filter object for the manifest explorer to apply when retrieving a collection of ODA data source extension manifests.
 java.util.Properties getDataSourceIdentifiers()
          Returns a collection of identifiers of all ODA data source extensions.
 java.util.Properties getDataSourceIdentifiers(ManifestExplorer.Filter dataSourceFilter)
          Returns a collection of identifiers of all ODA data source extensions that meet the specified filter criteria.
 int getDefaultOdaDataTypeCode(int nativeTypeCode, java.lang.String odaDataSourceId, java.lang.String dataSetType)
          Converts the specified native data type code to its default ODA data type code, based on the data type mapping defined by the specified ODA data source and data set types.
 ExtensionManifest getExtensionManifest(java.lang.String dataSourceId)
          Returns the extension configuration information found in the plugin manifest file of the data source extension that contains the specified data source element and implements the DTP ODA run-time extension point - org.eclipse.datatools.connectivity.oda.dataSource.
 ExtensionManifest getExtensionManifest(java.lang.String dataSourceId, java.lang.String extensionPoint)
          Returns the extension configuration information found in the plugin manifest file of the data source extension that contains the specified data source element and implements the specified ODA extension point.
 ExtensionManifest[] getExtensionManifests()
          Returns an array of DTP ODA dataSource extension configuration information found in corresponding plugin manifest file.
 ExtensionManifest[] getExtensionManifests(boolean includesAllExtensions)
          Deprecated. As of DTP 1.0, replaced by getExtensionManifests(String, org.eclipse.datatools.connectivity.oda.util.manifest.ManifestExplorer.Filter)
 ExtensionManifest[] getExtensionManifests(ManifestExplorer.Filter collectionFilter)
          Returns an array of DTP ODA dataSource extension configuration information of those extensions that implement the DTP ODA extension point and meet the filter criteria.
 ExtensionManifest[] getExtensionManifests(java.lang.String extensionPoint)
          Returns an array of ODA dataSource extension configuration information of those extensions that implement the specified extension point.
 ExtensionManifest[] getExtensionManifests(java.lang.String extensionPoint, boolean includesAllExtensions)
          Deprecated. As of DTP 1.0, replaced by getExtensionManifests(String, org.eclipse.datatools.connectivity.oda.util.manifest.ManifestExplorer.Filter)
 ExtensionManifest[] getExtensionManifests(java.lang.String extensionPoint, ManifestExplorer.Filter collectionFilter)
          Returns an array of ODA dataSource extension configuration information of those extensions that implement the specified extension point and meet the filter criteria.
static org.eclipse.core.runtime.IExtension[] getExtensions(java.lang.String extPoint)
           
static ManifestExplorer getInstance()
          Gets the ManifestExplorer instance to explore the manifest of the data source extensions.
 void refresh()
          Refresh the manifest explorer, and allows it to get the latest ODA extension manifests.
static void releaseInstance()
          Singleton instance release method.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ManifestExplorer getInstance()
Gets the ManifestExplorer instance to explore the manifest of the data source extensions.

Returns:
the ManifestExplorer instance.

releaseInstance

public static void releaseInstance()
Singleton instance release method.


refresh

public void refresh()
Refresh the manifest explorer, and allows it to get the latest ODA extension manifests.


getDataSourceIdentifiers

public java.util.Properties getDataSourceIdentifiers()
Returns a collection of identifiers of all ODA data source extensions. The extension's data source element ID and display name are stored as the key and value in the returned Properties instance. The returned collection includes all matching extensions, including those with no dataSet elements defined.

Returns:
a Properties containing the id and display name of all ODA data source extensions. May be an empty collection if no data source extensions are found.

getDataSourceIdentifiers

public java.util.Properties getDataSourceIdentifiers(ManifestExplorer.Filter dataSourceFilter)
Returns a collection of identifiers of all ODA data source extensions that meet the specified filter criteria. The extension's data source element ID and display name are stored as the key and value in the returned Properties instance.

Parameters:
collectionFilter - specifies the types of extension to exclude in the returned collection; may be null if no filtering is needed
Returns:
a Properties containing the id and display name of all ODA data source extensions that meet the specified filter criteria. May be an empty collection if no data source extensions are found.
Since:
3.1.2 (DTP 1.6)

getExtensionManifest

public ExtensionManifest getExtensionManifest(java.lang.String dataSourceId)
                                       throws OdaException
Returns the extension configuration information found in the plugin manifest file of the data source extension that contains the specified data source element and implements the DTP ODA run-time extension point - org.eclipse.datatools.connectivity.oda.dataSource.

Parameters:
dataSourceId - the unique id of the data source element in a data source extension.
Returns:
the extension manifest information
Throws:
OdaException - if the extension manifest is invalid.
java.lang.IllegalArgumentException - if no extension is found.

getExtensionManifest

public ExtensionManifest getExtensionManifest(java.lang.String dataSourceId,
                                              java.lang.String extensionPoint)
                                       throws OdaException
Returns the extension configuration information found in the plugin manifest file of the data source extension that contains the specified data source element and implements the specified ODA extension point.

Parameters:
dataSourceId - the unique id of the data source element in a data source extension.
extensionPoint - the id of the extension point to search
Returns:
the extension manifest information, or null if no extension configuration is found.
Throws:
OdaException - if the extension manifest is invalid.
java.lang.IllegalArgumentException - if no argument(s) are specified

getExtensionManifests

public ExtensionManifest[] getExtensionManifests()
Returns an array of DTP ODA dataSource extension configuration information found in corresponding plugin manifest file. Returns an empty array if there are no data source extensions found. Invalid data source extension definitions are ignored.

Returns:
an ExtensionManifest array containing the definition of all matching ODA data source extensions.

getExtensionManifests

public ExtensionManifest[] getExtensionManifests(ManifestExplorer.Filter collectionFilter)
Returns an array of DTP ODA dataSource extension configuration information of those extensions that implement the DTP ODA extension point and meet the filter criteria.

Parameters:
collectionFilter - specifies the types of extensions to exclude in the returned collection; may be null if no filtering is needed
Returns:
an ExtensionManifest array containing the definition of all matching ODA data source extensions.
Since:
3.1.2 (DTP 1.6)

getExtensionManifests

public ExtensionManifest[] getExtensionManifests(java.lang.String extensionPoint)
Returns an array of ODA dataSource extension configuration information of those extensions that implement the specified extension point. Returns an empty array if there are no data source extensions found. Invalid data source extension definitions are ignored.

Parameters:
extensionPoint - name of an ODA data source extension point
Returns:
an ExtensionManifest array containing the definition of all matching ODA data source extensions.

getExtensionManifests

public ExtensionManifest[] getExtensionManifests(boolean includesAllExtensions)
Deprecated. As of DTP 1.0, replaced by getExtensionManifests(String, org.eclipse.datatools.connectivity.oda.util.manifest.ManifestExplorer.Filter)

Returns an array of DTP ODA dataSource extension configuration information found in corresponding plugin manifest file. The argument specifies whether to include all matching extensions, regardless of whether it has defined no dataSet element, such as a driver adapter plugin.

Parameters:
includesAllExtensions - true to return all matching extensions, including those with no valid dataSet element defined; false to include only those matching extensions with at least one valid dataSet element defined
Returns:
an ExtensionManifest array containing the definition of all matching ODA data source extensions.

getExtensionManifests

public ExtensionManifest[] getExtensionManifests(java.lang.String extensionPoint,
                                                 boolean includesAllExtensions)
Deprecated. As of DTP 1.0, replaced by getExtensionManifests(String, org.eclipse.datatools.connectivity.oda.util.manifest.ManifestExplorer.Filter)

Returns an array of ODA dataSource extension configuration information of those extensions that implement the specified extension point. The argument specifies whether to include all matching extensions, regardless of whether it has defined no dataSet element, such as a driver adapter plugin.

Parameters:
extensionPoint - name of an ODA data source extension point
includesAllExtensions - true to return all matching extensions, including those with no valid dataSet element defined; false to include only those matching extensions with at least one valid dataSet element defined
Returns:
an ExtensionManifest array containing the definition of all matching ODA data source extensions.

getExtensionManifests

public ExtensionManifest[] getExtensionManifests(java.lang.String extensionPoint,
                                                 ManifestExplorer.Filter collectionFilter)
Returns an array of ODA dataSource extension configuration information of those extensions that implement the specified extension point and meet the filter criteria.

Parameters:
extensionPoint - name of an ODA data source extension point
collectionFilter - specifies the types of extensions to exclude in the returned collection; may be null if no filtering is needed
Returns:
an ExtensionManifest array containing the definition of all matching ODA data source extensions.
Since:
3.0.3

getExtensions

public static org.eclipse.core.runtime.IExtension[] getExtensions(java.lang.String extPoint)

getDefaultOdaDataTypeCode

public int getDefaultOdaDataTypeCode(int nativeTypeCode,
                                     java.lang.String odaDataSourceId,
                                     java.lang.String dataSetType)
Converts the specified native data type code to its default ODA data type code, based on the data type mapping defined by the specified ODA data source and data set types.

Parameters:
nativeTypeCode - native type code specific to the ODA data source
odaDataSourceId - the ODA data source element id
dataSetType - the type of data set
Returns:
the converted ODA data type code, or java.sql.Types.NULL if no valid mapping is found

createFilter

public static ManifestExplorer.Filter createFilter()
Instantiates a new Filter object for the manifest explorer to apply when retrieving a collection of ODA data source extension manifests.

Returns:
a new Filter object
Since:
3.0.3