## org.eclipse.datatools.connectivity.oda.design.ui.designsession
Class DesignSessionUtil

    java.lang.Object
      DesignSessionUtilBase
          org.eclipse.datatools.connectivity.oda.design.ui.designsession.DesignSessionUtil

public class DesignSessionUtil
extends DesignSessionUtilBase

An utility class to help an ODA host designer or an ODA driver's customized designer to manipulate ODA Design API objects during an ODA design session.

See Also:
  Serialized Form

Method Summary
`static ElementNullability` `convertParameterNullability(int parameterNullability)` Converts the value of an ODA runtime parameter nullability to corresponding value used in an ODA design-time element definition.
`static ElementNullability` `convertResultColumnNullability(int columnNullability)` Converts the value of an ODA runtime result set column nullability to corresponding value used in an ODA design-time element definition.
`static Properties` `createDataSetNonPublicProperties(java.lang.String odaDataSourceId, java.lang.String odaDataSetId, java.util.Properties utilProps)` Creates an ODA design property collection for those given data set properties that are not defined in an ODA runtime extension manifest.
`static Properties` `createDataSetPublicProperties(java.lang.String odaDataSourceId, java.lang.String odaDataSetId, java.util.Properties utilProps)` Creates an ODA design property collection for the data set public properties defined in an ODA runtime extension manifest.
`static Properties` `createDataSourceNonPublicProperties(java.lang.String odaDataSourceId, java.util.Properties utilProps)` Creates an ODA design property collection for those given data source properties that are not defined in an ODA runtime extension manifest.
`static Properties` `createDataSourcePublicProperties(java.lang.String odaDataSourceId, java.util.Properties utilProps)` Creates an ODA design property collection for the data source public properties defined in an ODA runtime extension manifest.
`static OdaDesignSession` `createNewDataSetRequestSession(java.lang.String newDataSetName, java.lang.String odaDataSetId, DataSourceDesign dataSourceDesign)` Creates a new OdaDesignSession instance with a session request that contains a new data set design of the specified name and odaDataSetId, associated with the specified data source design instance.
`static Properties` `createNonPublicProperties(Property[] publicPropDefns, java.util.Properties utilProps)` Convert given Properties collection that are not defined as public properties in an ODA runtime extension manifest, into an ODA design property collection.
`static Properties` `createPublicProperties(Property[] publicPropDefns, java.util.Properties utilProps)` Convert specified public properties defined in an ODA runtime extension manifest, and corresponding values specified in the given Properties collection into an ODA design property collection.
`static IConnectionProfile` `getLinkedProfile(DataSourceDesign dataSourceDesign)` Returns the connection profile instance externally referenced, i.e.
`static java.util.Map` `getProfileIdentifiers(java.lang.String odaDataSourceId, java.io.File storageFile)` Returns a collection of identifiers of all connection profile instances for the given ODA data source extension type.
`static boolean` `hasValidOdaDesignUIExtension(java.lang.String odaDataSourceId)` Indicates whether the given ODA data source type has implemented a valid `org.eclipse.datatools.connectivity.oda.design.ui.dataSource` extension point.
`static DataSetParameters` `toDataSetParametersDesign(IParameterMetaData pmd)` Converts the contents of an ODA runtime parameters meta data to an ODA design-time DataSetParameters instance.
`static DataSetParameters` `toDataSetParametersDesign(IParameterMetaData pmd, ParameterMode defaultMode)` Converts the contents of an ODA runtime parameters meta data to an ODA design-time DataSetParameters instance.
`static ElementNullability` `toElementNullability(int odaNullability)` Deprecated. As of 3.0.5, replaced by `convertResultColumnNullability( int )`.
`static ParameterMode` `toParameterModeDesign(int runtimeParamMode)` Converts the specified ODA runtime parameter mode value to corresponding ODA design-time parameter mode value.
`static ParameterMode` `toParameterModeDesign(int runtimeParamMode, ParameterMode defaultMode)` Converts the specified ODA runtime parameter mode value to corresponding ODA design-time parameter mode value.
`static ResultSetColumns` `toResultSetColumnsDesign(IResultSetMetaData md)` Converts the contents of an ODA runtime result set meta data to an ODA design-time ResultSetColumns instance.

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

Method Detail

### createDataSourcePublicProperties

    public static Properties createDataSourcePublicProperties(java.lang.String odaDataSourceId,
                                                              java.util.Properties utilProps)
                                                       throws OdaException

  Creates an ODA design property collection for the data source public properties defined in an ODA runtime extension manifest. Their corresponding values are specified in the given Properties collection.

  Parameters:
    `odaDataSourceId` - an ODA extension data source element ID
    `utilProps` - java.util.properties, such as those collected from a connection profile
  Returns:
    ODA design public property collection for inclusion in an OdaDesignSession's Data Source Design
  Throws:
    `OdaException`

### createDataSetPublicProperties

    public static Properties createDataSetPublicProperties(java.lang.String odaDataSourceId,
                                                           java.lang.String odaDataSetId,
                                                           java.util.Properties utilProps)
                                                    throws OdaException

  Creates an ODA design property collection for the data set public properties defined in an ODA runtime extension manifest. Their corresponding values are specified in the given Properties collection.

  Parameters:
    `odaDataSourceId` - an ODA extension data source element ID
    `odaDataSetId` - an ODA extension data set element id; may be null if the associated data source extension supports only one type of data set
    `utilProps` - collection of property name and value pairs
  Returns:
    ODA design public property collection for inclusion in an OdaDesignSession's Data Set Design
  Throws:
    `OdaException`

### createPublicProperties

    public static Properties createPublicProperties(Property[] publicPropDefns,
                                                    java.util.Properties utilProps)

  Convert specified public properties defined in an ODA runtime extension manifest, and corresponding values specified in the given Properties collection into an ODA design property collection.

  Parameters:
    `publicPropDefns` - public properties defined in an ODA runtime extension manifest
    `utilProps` - collection of property name and value pairs
  Returns:
    converted collection of ODA design public properties

### createDataSourceNonPublicProperties

    public static Properties createDataSourceNonPublicProperties(java.lang.String odaDataSourceId,
                                                                 java.util.Properties utilProps)
                                                          throws OdaException

  Creates an ODA design property collection for those given data source properties that are not defined in an ODA runtime extension manifest. These are properties that are not publicly defined. Their corresponding values are collected from the given property collection.

  Parameters:
    `odaDataSourceId` - an ODA extension data source element ID
    `utilProps` - a java.util.Properties collection, such as those collected from a connection profile
  Returns:
    ODA design non-public property collection for inclusion in an OdaDesignSession's Data Source Design
  Throws:
    `OdaException`

### createDataSetNonPublicProperties

    public static Properties createDataSetNonPublicProperties(java.lang.String odaDataSourceId,
                                                              java.lang.String odaDataSetId,
                                                              java.util.Properties utilProps)
                                                       throws OdaException

  Creates an ODA design property collection for those given data set properties that are not defined in an ODA runtime extension manifest. These are properties that are not publicly defined. Their corresponding values are collected from the given property collection.

  Parameters:
    `odaDataSourceId` - an ODA extension data source element ID
    `odaDataSetId` - an ODA extension data set element id; may be null if the associated data source extension supports only one type of data set
    `utilProps` - a java.util.Properties collection, such as those collected from a connection profile
  Returns:
    ODA design non-public property collection for inclusion in an OdaDesignSession's Data Source Design
  Throws:
    `OdaException`

### createNonPublicProperties

    public static Properties createNonPublicProperties(Property[] publicPropDefns,
                                                       java.util.Properties utilProps)

  Convert given Properties collection that are not defined as public properties in an ODA runtime extension manifest, into an ODA design property collection.

  Parameters:
    `publicPropDefns` - public properties defined in an ODA runtime extension manifest
    `utilProps` - a java.util.Properties collection, such as those collected from a connection profile
  Returns:
    converted collection of ODA design non-public properties

### createNewDataSetRequestSession

    public static OdaDesignSession createNewDataSetRequestSession(java.lang.String newDataSetName,
                                                                  java.lang.String odaDataSetId,
                                                                  DataSourceDesign dataSourceDesign)
                                                           throws OdaException

  Creates a new OdaDesignSession instance with a session request that contains a new data set design of the specified name and odaDataSetId, associated with the specified data source design instance.

  Parameters:
    `newDataSetName` - a unique name that identifies a data set design instance
    `odaDataSetId` - an ODA data set element id; may be null if the associated data source extension supports only one type of data set
    `dataSourceDesign` - the associated data source design instance
  Returns:
    a new OdaDesignSession instance with a session request of the specified design attributes
  Throws:
    `OdaException` - if specified arguments are invalid

### getLinkedProfile

    public static IConnectionProfile getLinkedProfile(DataSourceDesign dataSourceDesign)
                                               throws OdaException

  Returns the connection profile instance externally referenced, i.e. linked, by the given data source design.

  Parameters:
    `dataSourceDesign` -
  Returns:
    linked connection profile instance, or null if no external profile is referenced
  Throws:
    `OdaException` - if referenced connection profile is not found

### hasValidOdaDesignUIExtension

    public static boolean hasValidOdaDesignUIExtension(java.lang.String odaDataSourceId)

  Indicates whether the given ODA data source type has implemented a valid `org.eclipse.datatools.connectivity.oda.design.ui.dataSource` extension point.

  Parameters:
    `odaDataSourceId` - an ODA data source extension type's element id
  Returns:
    true if specified ODA data source has implemented a valid ODA designer extension; false otherwise

### getProfileIdentifiers

    public static java.util.Map getProfileIdentifiers(java.lang.String odaDataSourceId,
                                                      java.io.File storageFile)
                                               throws OdaException

  Returns a collection of identifiers of all connection profile instances for the given ODA data source extension type. The profile instances are searched in the given profile storage file. It also caches the matching profiles for subsequent use.

  Parameters:
    `odaDataSourceId` - an ODA data source extension type's element id
    `storageFile` - a file that stores profile instances; may be null, which means to use the default DTP profiles storage file
  Returns:
    a `Map` containing the instance Id and display name of all existing profiles of the given odaDataSourceId. The connection profiles' instance Id and display name are stored as the key and value strings in the returned `Map` instance. Returns an empty collection if there are no matching connection profiles found in given storageFile.
  Throws:
    `OdaException` - if error in reading from given storageFile, or in processing the found profiles

### toResultSetColumnsDesign

    public static ResultSetColumns toResultSetColumnsDesign(IResultSetMetaData md)
                                                     throws OdaException

  Converts the contents of an ODA runtime result set meta data to an ODA design-time ResultSetColumns instance. This may be used by an ODA custom page to populate a data set design instance with its result set meta data definition.

  Parameters:
    `md` - ODA runtime result set meta data instance
  Returns:
    the converted ResultSetColumns instance
  Throws:
    `OdaException`

### toDataSetParametersDesign

    public static DataSetParameters toDataSetParametersDesign(IParameterMetaData pmd)
                                                       throws OdaException

  Converts the contents of an ODA runtime parameters meta data to an ODA design-time DataSetParameters instance. This may be used by an ODA custom page to populate a data set design instance with its parameter meta data definitions.

  Parameters:
    `pmd` - ODA runtime parameters meta data instance
  Returns:
    the converted DataSetParameters instance
  Throws:
    `OdaException`

### toDataSetParametersDesign

    public static DataSetParameters toDataSetParametersDesign(IParameterMetaData pmd,
                                                              ParameterMode defaultMode)
                                                       throws OdaException

  Converts the contents of an ODA runtime parameters meta data to an ODA design-time DataSetParameters instance. This may be used by an ODA custom page to populate a data set design instance with its parameter meta data definitions.

  Parameters:
    `pmd` - ODA runtime parameters meta data instance
    `defaultMode` - default design-time parameter mode to apply if a parameter's mode is not recognized; may be null for no default value
  Returns:
    the converted DataSetParameters instance
  Throws:
    `OdaException`

### toParameterModeDesign

    public static ParameterMode toParameterModeDesign(int runtimeParamMode)

  Converts the specified ODA runtime parameter mode value to corresponding ODA design-time parameter mode value.

  Parameters:
    `runtimeParamMode` - an ODA runtime parameter mode value
  Returns:
    the corresponding ODA design-time parameter mode value

### toParameterModeDesign

    public static ParameterMode toParameterModeDesign(int runtimeParamMode,
                                                      ParameterMode defaultMode)

  Converts the specified ODA runtime parameter mode value to corresponding ODA design-time parameter mode value.

  Parameters:
    `runtimeParamMode` - an ODA runtime parameter mode value
    `defaultMode` - default design-time parameter mode to apply if specified runtimeParamMode is not recognized; may be null for no default value
  Returns:
    the corresponding ODA design-time parameter mode value

### toElementNullability

    public static ElementNullability toElementNullability(int odaNullability)

  Deprecated. As of 3.0.5, replaced by `convertResultColumnNullability( int )`.

  Converts the value of an ODA runtime (result set column) nullability to corresponding value used in an ODA design-time definition.

  Parameters:
    `odaNullability` - an ODA runtime nullability constant
  Returns:
    corresponding constant for use in an ODA design-time definition

### convertResultColumnNullability

    public static ElementNullability convertResultColumnNullability(int columnNullability)

  Converts the value of an ODA runtime result set column nullability to corresponding value used in an ODA design-time element definition.

  Parameters:
    `columnNullability` - an ODA IResultSetMetaData nullability constant
  Returns:
    corresponding constant for use in an ODA design-time definition

### convertParameterNullability

    public static ElementNullability convertParameterNullability(int parameterNullability)

  Converts the value of an ODA runtime parameter nullability to corresponding value used in an ODA design-time element definition.

  Parameters:
    `parameterNullability` - an ODA IParameterMetaData nullability constant
  Returns:
    corresponding constant for use in an ODA design-time definition

Copyright © 2006 Actuate, IBM Corporation, Sybase, Inc. and others. All rights reserved.