## org.eclipse.datatools.connectivity
Interface IConnectionProfile

public interface IConnectionProfile

The interface used when working with an instance of a connection profile.

Author:
  rcernich Created on Jan 14, 2004

Field Summary
`static java.lang.String` `AUTO_CONNECT_PROPERTY_ID` Property ID for profile auto-connect.
`static java.lang.String` `CONNECTED_PROPERTY_ID` Property ID for "connected" state.
`static java.lang.String` `CONNECTION_PROFILE_PROPERTY_SET` Property set ID for common connection profile properties
`static java.lang.String` `DESCRIPTION_PROPERTY_ID` Property ID for profile description.
`static java.lang.String` `INSTANCE_ID_PROPERTY_ID` Property ID for profile instance ID.
`static java.lang.String` `NAME_PROPERTY_ID` Property ID for profile name.

Method Summary
`void` `addConnectListener(IConnectListener listener)` Deprecated. use IManagedConnection.removeConnectionListener()
`void` `addPropertySetListener(IPropertySetListener listener)` Add property listener to this profile.
`boolean` `arePropertiesComplete()` Returns true if all property sets associated with this profile are complete; false if more information is required (e.g.
`boolean` `arePropertiesComplete(java.lang.String type)` Returns true if the specified property set type associated with this profile is complete; false if more information is required (e.g.
`IStatus` `connect()` This method blocks until all registered connect listeners have been notified to open connections.
`void` `connect(IJobChangeListener listener)` This method returns immediately after spawning a Job which notifies all registered connect listeners to open connections.
`IConnection` `createConnection(java.lang.String factory)` This method is a shortcut for getProvider()getConnectionFactory(factoryId).createConnection(this).
`IConnection` `createConnection(java.lang.String factoryId, java.lang.String uid, java.lang.String pwd)` This method is a shortcut for getProvider()getConnectionFactory(factoryId).createConnection(this,uid,pwd).
`IStatus` `disconnect()` This method blocks until all registered connect listeners have been notified to close connections.
`void` `disconnect(IJobChangeListener listener)` This method returns immediately after spawning a Job which notifies all registered connect listeners to close connections.
`java.util.Properties` `getBaseProperties()` This method returns the properties managed by the base connection profile extension.
`ICategory` `getCategory()` This method is a shortcut for getProvider().getCategory().
`IConfigurationType` `getConfigurationType()` Deprecated.
`java.lang.String` `getDescription()`
`java.lang.String` `getInstanceID()`
`IManagedConnection` `getManagedConnection(java.lang.String type)`
`java.lang.String` `getName()`
`IConnectionProfile` `getParentProfile()` This method returns the connection profile that this connection profile derives from.
`java.util.Map` `getProfileExtensions()` This method is a shortcut for getProvider().getProfileExtensions().
`java.util.Properties` `getProperties(java.lang.String type)` This method returns the properties associated with a connection profile profile extension.
`IConnectionProfileProvider` `getProvider()` Returns the provider responsible for managing this connection profile.
`java.lang.String` `getProviderId()` This method is a shortcut for getProvider().getProviderId().
`java.lang.String` `getProviderName()` This method is a shortcut for getProvider().getName().
`boolean` `isAutoConnect()`
`boolean` `isConnected()`
`void` `removeConnectListener(IConnectListener listener)` Deprecated. use IManagedConnection.removeConnectionListener()
`void` `removePropertySetListener(IPropertySetListener listener)`
`void` `setBaseProperties(java.util.Properties props)` This method sets the properties managed by the base connection profile extension.
`void` `setConnected(boolean connected)` Deprecated. Use one of the connect() methods instead. This method now delegates to connect().
`void` `setProperties(java.lang.String type, java.util.Properties props)` This method sets the properties managed by a specific profile extension.

Field Detail

### CONNECTION_PROFILE_PROPERTY_SET

    public static final java.lang.String CONNECTION_PROFILE_PROPERTY_SET

  Property set ID for common connection profile properties

### CONNECTED_PROPERTY_ID

    public static final java.lang.String CONNECTED_PROPERTY_ID

  Property ID for "connected" state.

  See Also:
    Constant Field Values

### NAME_PROPERTY_ID

    public static final java.lang.String NAME_PROPERTY_ID

  Property ID for profile name.

  See Also:
    Constant Field Values

### DESCRIPTION_PROPERTY_ID

    public static final java.lang.String DESCRIPTION_PROPERTY_ID

  Property ID for profile description.

  See Also:
    Constant Field Values

### AUTO_CONNECT_PROPERTY_ID

    public static final java.lang.String AUTO_CONNECT_PROPERTY_ID

  Property ID for profile auto-connect.

  See Also:
    Constant Field Values

### INSTANCE_ID_PROPERTY_ID

    public static final java.lang.String INSTANCE_ID_PROPERTY_ID

  Property ID for profile instance ID.

  See Also:
    Constant Field Values

Method Detail

### getName

    public java.lang.String getName()

  Returns:
    the name of this connection profile

### getDescription

    public java.lang.String getDescription()

  Returns:
    the description of this connection profile

### isAutoConnect

    public boolean isAutoConnect()

  Returns:
    whether it's autoconnect or not

### getInstanceID

    public java.lang.String getInstanceID()

  Returns:
    the static ID for this connection profile

### getParentProfile

    public IConnectionProfile getParentProfile()

  This method returns the connection profile that this connection profile derives from. For example, a JMS queue session may depend on an instance of a JNDI connection profile.

  Returns:
    the connection profile this connection profile is derived from.

### getBaseProperties

    public java.util.Properties getBaseProperties()

  This method returns the properties managed by the base connection profile extension.

  Returns:
    a properties object containing properties defined by the base connection profile extension.

### setBaseProperties

    public void setBaseProperties(java.util.Properties props)

  This method sets the properties managed by the base connection profile extension.

  Parameters:
    `props` - the properties to set as the base properties.

### getProperties

    public java.util.Properties getProperties(java.lang.String type)

  This method returns the properties associated with a connection profile profile extension. The type specified must match the id of a profile extension or the base profile.

  Parameters:
    `type` - the type of properties.
  Returns:
    the properties managed by the specified profile extension.

### setProperties

    public void setProperties(java.lang.String type,
                              java.util.Properties props)

  This method sets the properties managed by a specific profile extension. The type specified must match the id of a profile extension or the base profile.

  Parameters:
    `type` - the type of properties.
    `props` - the properties to set.

### arePropertiesComplete

    public boolean arePropertiesComplete()

  Returns true if all property sets associated with this profile are complete; false if more information is required (e.g. authentication information is missing). This call is not intended to verify that the information will allow for a successful connection, just that the information is complete enough to make an attempt.

  Returns:
    true if the property set is complete; false if additional information must be specified.

### arePropertiesComplete

    public boolean arePropertiesComplete(java.lang.String type)

  Returns true if the specified property set type associated with this profile is complete; false if more information is required (e.g. authentication information is missing). This call is not intended to verify that the information will allow for a successful connection, just that the information is complete enough to make an attempt.

  Parameters:
    `type` - the type of properties
  Returns:
    true if the property set is complete; false if additional information must be specified.

### setConnected

    public void setConnected(boolean connected)

  Deprecated. Use one of the connect() methods instead. This method now delegates to connect().

  Sets the connected state for this profile. The connected state is used by content extensions and other consumers of the framework as a hint indicating that they should create a connection to the profile.

  Parameters:
    `connected` - the connected state.

### isConnected

    public boolean isConnected()

  Returns:
    true if consumers should create connections to this profile

### connect

    public IStatus connect()

  This method blocks until all registered connect listeners have been notified to open connections.

  Returns:
    the status of the connect operation. Status.OK_STATUS if all went well.

### connect

    public void connect(IJobChangeListener listener)

  This method returns immediately after spawning a Job which notifies all registered connect listeners to open connections. The caller can pass in a job listener so it can be notified of the status of the job. The status returned by the job upon completion can be used to determine whether or not the connect operation was successful.

  Parameters:
    `listener` - a job listener that can be used to notify the caller of the state of the job spawned to open the connections. Can be null.

### disconnect

    public IStatus disconnect()

  This method blocks until all registered connect listeners have been notified to close connections.

  Returns:
    the status of the disconnect operation. Status.OK_STATUS if all went well.

### disconnect

    public void disconnect(IJobChangeListener listener)

  This method returns immediately after spawning a Job which notifies all registered connect listeners to close connections. The caller can pass in a job listener so it can be notified of the status of the job. The status returned by the job upon completion can be used to determine whether or not the disconnect operation was successful.

  Parameters:
    `listener` - a job listener that can be used to notify the caller of the state of the job spawned to close the connections. Can be null.

### addConnectListener

    public void addConnectListener(IConnectListener listener)

  Deprecated. use IManagedConnection.removeConnectionListener()

  Add a connect listener to this profile.

  Parameters:
    `listener` -

### removeConnectListener

    public void removeConnectListener(IConnectListener listener)

  Deprecated. use IManagedConnection.removeConnectionListener()

  Remove a connect listener from this profile.

  Parameters:
    `listener` -

### getManagedConnection

    public IManagedConnection getManagedConnection(java.lang.String type)

  Parameters:
    `type` - the ID of the connection factory responsible for creating the connection
  Returns:
    the managed connection

### addPropertySetListener

    public void addPropertySetListener(IPropertySetListener listener)

  Add property listener to this profile. Property events sent:

  Parameters:
    `listener` -

### removePropertySetListener

    public void removePropertySetListener(IPropertySetListener listener)

  Parameters:
    `listener` -

### getProviderName

    public java.lang.String getProviderName()

  This method is a shortcut for getProvider().getName().

  Returns:
    the name of the provider managing this profile
  See Also:
    `IConnectionProfileProvider.getConfigurationType()`

### getProviderId

    public java.lang.String getProviderId()

  This method is a shortcut for getProvider().getProviderId().

  Returns:
    the id of the provider managing this profile

### getCategory

    public ICategory getCategory()

  This method is a shortcut for getProvider().getCategory().

  Returns:
    the category this connection profile belongs to.
  See Also:
    `IConnectionProfileProvider.getCategory()`

### getConfigurationType

    public IConfigurationType getConfigurationType()

  Deprecated.

  This method is a shortcut for getProvider().getConfigurationType().

  Returns:
    the configuration type of this connection profile.
  See Also:
    `IConnectionProfileProvider.getConfigurationType()`

### getProfileExtensions

    public java.util.Map getProfileExtensions()

  This method is a shortcut for getProvider().getProfileExtensions().

  Returns:
    a list of profile extensions supporting this profile
  See Also:
    `IConnectionProfileProvider.getProfileExtensions()`

### createConnection

    public IConnection createConnection(java.lang.String factory)

  This method is a shortcut for getProvider()getConnectionFactory(factoryId).createConnection(this).

  Parameters:
    `factory` - the connection factory id
  Returns:
    a connection if successful; otherwise null
  See Also:
    `IConnectionFactory.createConnection(IConnectionProfile)`

### createConnection

    public IConnection createConnection(java.lang.String factoryId,
                                        java.lang.String uid,
                                        java.lang.String pwd)

  This method is a shortcut for getProvider()getConnectionFactory(factoryId).createConnection(this,uid,pwd).

  Parameters:
    `factoryId` - the connection factory id
    `uid` - the user id
    `pwd` - the user's password
  Returns:
    a connection if successful; otherwise null
  See Also:
    `IConnectionFactory.createConnection(IConnectionProfile,String,String)`

### getProvider

    public IConnectionProfileProvider getProvider()

  Returns the provider responsible for managing this connection profile.

  Returns:
    the provider managing this connection profile

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