commonj.connector.metadata.discovery.connection
Interface MetadataConnection


public interface MetadataConnection

A handle to a connection for use in metadata discovery functions. This connection is not for use in any runtime capacity. Instances of this interface must be obtained from a call to OutboundConnectionType.openMetadataConnection() method.

Since:
1.0
See Also:
OutboundConnectionType.openMetadataConnection(OutboundConnectionConfiguration)

Method Summary
 void close()
          Close this metadata connection.
 OutboundConnectionConfiguration getConnectionCofiguration()
          Get configuration properties used to create and initialize the metadata connection.
 OutboundConnectionType getConnectionType()
          Outbound ConnectionType that was used to create and open Metadata Connection.
 void setToolContext(ToolContext context)
          Sets the tool context to be used by the EMD service provider when executing.
 

Method Detail

getConnectionCofiguration

OutboundConnectionConfiguration getConnectionCofiguration()
Get configuration properties used to create and initialize the metadata connection. The configuration is only used to simplify keeping relationship between connection ond its configuration, for example for persisting the connection and must not be modified.

Returns:
OutboundConnectionConfiguration Read only configuration of the Metadata Connectoin. The returned value must not be null.

getConnectionType

OutboundConnectionType getConnectionType()
Outbound ConnectionType that was used to create and open Metadata Connection.

Returns:
OutboundConnectionType The type of the connection of this managed connection. The returned value must not be null.

close

void close()
           throws MetadataException
Close this metadata connection. Any use of the Metadata Connection after it had been closed is invalid.

Throws:
MetadataException - if an error occured during execution

setToolContext

void setToolContext(ToolContext context)
Sets the tool context to be used by the EMD service provider when executing. The context is used by the provider to report progress and to log and trace execution for any of the operations provided in its metadata import service implementations.

Tool environments are free to switch the applicable contexts as necessary. For example, a tool may perform the navigation of the MetadataTree in a UI Wizard, but do the creation of the ServiceDescription in a background process. In order to support this the tool must be able to switch the tool context appropriately so that the EMD service provider reports progress to the proper location.

EMD service providers are responsible for always using the current context. This must be done by always checking the last context, that was set using this method, before attempting to update any progress to the context.

Parameters:
context - A non null reference that allows services offered by the tool environment to be used by the discovery service during the execution of this method. See ToolContext for more details on the use of this context.
See Also:
ToolContext