## org.eclipse.datatools.sqltools.core
Interface IControlConnectionManager

    public interface IControlConnectionManager

This interface is for manage all control connections. You should get a refrence to this interface through: `dmpplugin.getControlConnectionManager()`

It's not intended to be implemented by clients.

Author:
  Yang Liu, Hui Cao

Method Summary
`void` `addControlConnectionListener(IControlConnectionListener listener)` Adds an IControlConnectionListener to receive the control connection update events
`void` `addResourceDisposeListener(java.lang.String profileName, IResourceDisposeListener resourceDisposeListener)` Adds a resource dispose listener, the specified method will be called when the profile is closing
`void` `fireDispose(java.lang.String profileName)` Disposes the resources of the given profile
`IControlConnection` `getControlConnection(DatabaseIdentifier databaseIdentifier)` Checks whether there is a controlconnection exists for the specified database identifier.
`IControlConnection[]` `getControlConnections()` Retrieves all controlconnections registered in this control connection manager
`java.util.HashSet` `getControlConnections(ServerIdentifier serverIdentifier)` Returns the control connections set for the given server identifier
`IControlConnection[]` `getControlConnections(java.lang.String profileName)` Checks whether there are control connections exist for the specified connection profile.
`IControlConnection` `getOrCreateControlConnection(DatabaseIdentifier databaseIdentifier)` Gets an controlconnection given the profile.
`java.util.Map` `getServerConnectionMap()` Returns the map from server ids to control connections
`java.util.HashSet` `getSkippedConnections(ServerIdentifier serverIdentifier)` Returns the skipped connections of the specified server
`boolean` `hasControlConnection()` Whether there's registered control connection
`void` `registerSkippedConnection(ServerIdentifier serverIdentifier, int connid)` Registers the given connection id as a skipped connection for the specified server
`void` `removeControlConnectionListener(IControlConnectionListener listener)` Removes an IControlConnectionListener from receiving the control connection update events
`void` `removeResourceDisposeListener(java.lang.String profileName)` Removes the given listener
`void` `shutdown()` Shuts down this control connection manager.
`void` `unregisterSkippedConnection(ServerIdentifier serverIdentifier, int connid)` Unregisters the given connection id as a skipped connection for the specified server

Method Detail

### getOrCreateControlConnection

    IControlConnection getOrCreateControlConnection(DatabaseIdentifier databaseIdentifier)
                                                    throws java.sql.SQLException,
                                                           NoSuchProfileException

  Gets an controlconnection given the profile. If not exist, may create one.

  Parameters:
    `databaseIdentifier` - database identifier
  Returns:
    IControlConnection object keyed by databaseIdentifier
  Throws:
    `java.sql.SQLException`
    `NoSuchProfileException`

### getControlConnection

    IControlConnection getControlConnection(DatabaseIdentifier databaseIdentifier)

  Checks whether there is a controlconnection exists for the specified database identifier. If yes, return the controlconnection, otherwise try to find another control connection associated with the same connection profile, if failed again, return null

  Parameters:
    `databaseIdentifier` - the database identifier
  Returns:
    the corresponding control connection

### getControlConnections

    IControlConnection[] getControlConnections()

  Retrieves all controlconnections registered in this control connection manager

  Returns:
    all registered control connections

### getControlConnections

    IControlConnection[] getControlConnections(java.lang.String profileName)

  Checks whether there are control connections exist for the specified connection profile. If yes, return the control connection array, otherwise return null

  Parameters:
    `profileName` - the connection profile name
  Returns:
    the corresponding control connections

### addControlConnectionListener

    void addControlConnectionListener(IControlConnectionListener listener)

  Adds an IControlConnectionListener to receive the control connection update events

  Parameters:
    `listener` - the event listener

### removeControlConnectionListener

    void removeControlConnectionListener(IControlConnectionListener listener)

  Removes an IControlConnectionListener from receiving the control connection update events

  Parameters:
    `listener` - the event listener

### hasControlConnection

    boolean hasControlConnection()

  Whether there's registered control connection

  Returns:
    true if so; false otherwize

### shutdown

    void shutdown()

  Shuts down this control connection manager. It will dispose all control connections

### getSkippedConnections

    java.util.HashSet getSkippedConnections(ServerIdentifier serverIdentifier)

  Returns the skipped connections of the specified server

  Parameters:
    `serverIdentifier` - the server
  Returns:
    the skipped connections of the specified server

### registerSkippedConnection

    void registerSkippedConnection(ServerIdentifier serverIdentifier,
                                   int connid)

  Registers the given connection id as a skipped connection for the specified server

  Parameters:
    `serverIdentifier` - the server
    `connid` - the skipped connection id

### unregisterSkippedConnection

    void unregisterSkippedConnection(ServerIdentifier serverIdentifier,
                                     int connid)

  Unregisters the given connection id as a skipped connection for the specified server

  Parameters:
    `serverIdentifier` - the server
    `connid` - the skipped connection id

### getControlConnections

    java.util.HashSet getControlConnections(ServerIdentifier serverIdentifier)

  Returns the control connections set for the given server identifier

  Returns:

### getServerConnectionMap

    java.util.Map getServerConnectionMap()

  Returns the map from server ids to control connections

  Returns:

### addResourceDisposeListener

    void addResourceDisposeListener(java.lang.String profileName,
                                    IResourceDisposeListener resourceDisposeListener)

  Adds a resource dispose listener, the specified method will be called when the profile is closing

  Parameters:
    `resourceDisposeListener` -

### removeResourceDisposeListener

    void removeResourceDisposeListener(java.lang.String profileName)

  Removes the given listener

  Parameters:
    `profileName` -

### fireDispose

    void fireDispose(java.lang.String profileName)

  Disposes the resources of the given profile

  Parameters:
    `profileName` -

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