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 int PROP_CONNECTED
          Property ID for isConnected()
static int PROP_DESCRIPTION
          Property ID for getDescription()
static int PROP_NAME
          Property ID for getName()
static int PROP_PROPERTIES
          Property ID for getBaseProperties() and getProperties()
 
Method Summary
 void addConnectListener(IConnectListener listener)
          Deprecated. use IManagedConnection.removeConnectionListener()
 void addPropertyListener(IPropertyListener listener)
          Add property listener to this profile.
 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()
          This method is a shortcut for getProvider().getConfigurationType().
 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 removePropertyListener(IPropertyListener 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

PROP_CONNECTED

public static final int PROP_CONNECTED
Property ID for isConnected()

See Also:
Constant Field Values

PROP_PROPERTIES

public static final int PROP_PROPERTIES
Property ID for getBaseProperties() and getProperties()

See Also:
Constant Field Values

PROP_NAME

public static final int PROP_NAME
Property ID for getName()

See Also:
Constant Field Values

PROP_DESCRIPTION

public static final int PROP_DESCRIPTION
Property ID for getDescription()

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.

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

addPropertyListener

public void addPropertyListener(IPropertyListener listener)
Add property listener to this profile. Property events sent:

Parameters:
listener -

removePropertyListener

public void removePropertyListener(IPropertyListener 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()
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.