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
          Deprecated. use CONNECTION_STATE_PROPERTY_ID
static int CONNECTED_STATE
          When the connection profile is in this state, active connections to the server exist.
static java.lang.String CONNECTION_PROFILE_PROPERTY_SET
          Property set ID for common connection profile properties
static java.lang.String CONNECTION_STATE_PROPERTY_ID
          Property ID for "connection" state.
static java.lang.String DESCRIPTION_PROPERTY_ID
          Property ID for profile description.
static int DISCONNECTED_STATE
          When the connection profile is in this state, no active connections to the server exist.
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.
static int WORKING_OFFLINE_STATE
          When the connection profile is in this state, no active connections to the server exist.
 
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.
 boolean canWorkOffline()
           
 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.
 IStatus connectWithoutJob()
          This method blocks until all registered connect listeners have been notified 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.  
 int getConnectionState()
           
 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()
          Deprecated. Use getConnectionState()
 void removeConnectListener(IConnectListener listener)
          Deprecated. use IManagedConnection.removeConnectionListener()
 void removePropertySetListener(IPropertySetListener listener)
           
 IStatus saveWorkOfflineData()
          Saves the state of the connection profile for working in an offline mode.
 void saveWorkOfflineData(IJobChangeListener listener)
          Saves the state of the connection profile for working in an offline mode.
 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.
 boolean supportsWorkOfflineMode()
           
 IStatus workOffline()
          This method blocks until all registered connect listeners that support working offline have been notified to restore offline data.
 void workOffline(IJobChangeListener listener)
          This method returns immediately after spawning a Job which notifies all registered connect listeners that support working offline have been notified to restore offline data.
 

Field Detail

CONNECTION_PROFILE_PROPERTY_SET

static final java.lang.String CONNECTION_PROFILE_PROPERTY_SET
Property set ID for common connection profile properties


CONNECTED_PROPERTY_ID

static final java.lang.String CONNECTED_PROPERTY_ID
Deprecated. use CONNECTION_STATE_PROPERTY_ID
Property ID for boolean "connected" state.

See Also:
Constant Field Values

CONNECTION_STATE_PROPERTY_ID

static final java.lang.String CONNECTION_STATE_PROPERTY_ID
Property ID for "connection" state.

See Also:
Constant Field Values

NAME_PROPERTY_ID

static final java.lang.String NAME_PROPERTY_ID
Property ID for profile name.

See Also:
Constant Field Values

DESCRIPTION_PROPERTY_ID

static final java.lang.String DESCRIPTION_PROPERTY_ID
Property ID for profile description.

See Also:
Constant Field Values

AUTO_CONNECT_PROPERTY_ID

static final java.lang.String AUTO_CONNECT_PROPERTY_ID
Property ID for profile auto-connect.

See Also:
Constant Field Values

INSTANCE_ID_PROPERTY_ID

static final java.lang.String INSTANCE_ID_PROPERTY_ID
Property ID for profile instance ID.

See Also:
Constant Field Values

DISCONNECTED_STATE

static final int DISCONNECTED_STATE
When the connection profile is in this state, no active connections to the server exist.

See Also:
Constant Field Values

CONNECTED_STATE

static final int CONNECTED_STATE
When the connection profile is in this state, active connections to the server exist.

See Also:
Constant Field Values

WORKING_OFFLINE_STATE

static final int WORKING_OFFLINE_STATE
When the connection profile is in this state, no active connections to the server exist. However, cached server data has been loaded into memory and is available for use.

See Also:
Constant Field Values
Method Detail

getName

java.lang.String getName()
Returns:
the name of this connection profile

getDescription

java.lang.String getDescription()
Returns:
the description of this connection profile

isAutoConnect

boolean isAutoConnect()
Returns:
whether it's autoconnect or not

getInstanceID

java.lang.String getInstanceID()
Returns:
the static ID for this connection profile

getParentProfile

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

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

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

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

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

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

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

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

boolean isConnected()
Deprecated. Use getConnectionState()

Returns:
true if consumers should create connections to this profile

getConnectionState

int getConnectionState()
Returns:
the connection state of this profile. May be one of: DISCONNECTED_STATE, CONNECTED_STATE, WORKING_OFFLINE_STATE

connect

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

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.

connectWithoutJob

IStatus connectWithoutJob()
This method blocks until all registered connect listeners have been notified to open connections. Unlike connect(), this method will not spawn a job or display connection errors.

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

disconnect

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

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.

workOffline

IStatus workOffline()
This method blocks until all registered connect listeners that support working offline have been notified to restore offline data.

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

workOffline

void workOffline(IJobChangeListener listener)
This method returns immediately after spawning a Job which notifies all registered connect listeners that support working offline have been notified to restore offline data. 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 operation was successful.

Parameters:
listener - a job listener that can be used to notify the caller of the state of the job spawned to restore offline data. Can be null.

supportsWorkOfflineMode

boolean supportsWorkOfflineMode()
Returns:
true if one or more connection factories associated with this connection profile's provider support working offline.

canWorkOffline

boolean canWorkOffline()
Returns:
true if this connection profile supports working offline and data has been saved for working offline.

saveWorkOfflineData

IStatus saveWorkOfflineData()
Saves the state of the connection profile for working in an offline mode. If the connection profile does not support working in an offline mode, no exception is thrown and the method will return immediately.


saveWorkOfflineData

void saveWorkOfflineData(IJobChangeListener listener)
Saves the state of the connection profile for working in an offline mode. Same as saveWorkOfflineData() except that it returns immediately, without waiting for the save offline data job to complete.


addConnectListener

void addConnectListener(IConnectListener listener)
Deprecated. use IManagedConnection.removeConnectionListener()

Add a connect listener to this profile.

Parameters:
listener -

removeConnectListener

void removeConnectListener(IConnectListener listener)
Deprecated. use IManagedConnection.removeConnectionListener()

Remove a connect listener from this profile.

Parameters:
listener -

getManagedConnection

IManagedConnection getManagedConnection(java.lang.String type)
Parameters:
type - the ID of the connection factory responsible for creating the connection
Returns:
the managed connection

addPropertySetListener

void addPropertySetListener(IPropertySetListener listener)
Add property listener to this profile. Property events sent:

Parameters:
listener -

removePropertySetListener

void removePropertySetListener(IPropertySetListener listener)
Parameters:
listener -

getProviderName

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

java.lang.String getProviderId()
This method is a shortcut for getProvider().getProviderId().

Returns:
the id of the provider managing this profile

getCategory

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

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

getConfigurationType

IConfigurationType getConfigurationType()
Deprecated. 

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

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

getProfileExtensions

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

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

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

IConnectionProfileProvider getProvider()
Returns the provider responsible for managing this connection profile.

Returns:
the provider managing this connection profile


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