commonj.connector.metadata.discovery.connection
Interface ConnectionType

All Known Subinterfaces:
InboundConnectionType, OutboundConnectionType

public interface ConnectionType

Represents a unique type of connection, either inbound or outbound, supported by an adapter type. A connection type has a unique ID (within its containing adapter type) and a set of properties that define the information needed to establish a connection of this type.

The providers of the metadata discovery service implement subinterfaces of the ConnectionType specialized for the inbound or outbound connection type.

Since:
1.0

Method Summary
 AdapterType getAdapterType()
          Gets the type of the adapter that contains this connection.
 ConnectionPersistence getConnectionPersistence()
          Get the ConnectionPersistence instance that should be used for storing and retrieving connection configuration for this connection type.
 String getDescription()
          Gets a description of the connection type.
 String getDisplayName()
          Gets a display name that a tool environment can display to users to represent this connection type.
 String getId()
          Gets the unique Id for this connection type.
 boolean isConnectionConfigurationComplete(ConnectionConfiguration connectionConfiguration)
          Verify that given connection configuration is complete, in other word can be reasonably assumed to contain all the information needed to execute the service.
 void synchronizeFromPropertyGroupToResourceAdapter(PropertyGroup pg, ResourceAdapter bean)
          Synchronizes from the PropertyGroup to the ResourceAdapter JavaBean.
 void synchronizeFromResourceAdapterToPropertyGroup(ResourceAdapter bean, PropertyGroup pg)
          Synchronizes from the ResourceAdapter JavaBean to the PropertyGroup.
 

Method Detail

getId

String getId()
Gets the unique Id for this connection type. The returned Id is unique only within the set of connection types (inbound or outbound) defined by the containing adapter type.

Returns:
The unique identifier of the connection type identifier. The implementation must not return null.

getAdapterType

AdapterType getAdapterType()
Gets the type of the adapter that contains this connection.

Returns:
AdapterType The adapter type defining this connection type. The implementation must not return null.

getDisplayName

String getDisplayName()
Gets a display name that a tool environment can display to users to represent this connection type.

This is a locale specific object that must be separated to a ResourceBundle, translated, and retrieved using the locale of the tool environment.

Returns:
The display name of the connection type
See Also:
ResourceBundle, MessageFormat

getDescription

String getDescription()
Gets a description of the connection type. The description might describe the communications protocol used or other pertinent information.

This is a locale specific object that must be separated to a ResourceBundle, translated, and retrieved using the locale of the tool environment.

Returns:
The description of the connection type.
See Also:
ResourceBundle, MessageFormat

getConnectionPersistence

ConnectionPersistence getConnectionPersistence()
                                               throws MetadataException
Get the ConnectionPersistence instance that should be used for storing and retrieving connection configuration for this connection type. The implementation of the ConnectionPersistence is optional for the Metadata Discovery service implementation and if it is not supported, the method should return null.

If the returned instance is not null, the caller must use the returned instance for all persistence operations related to this connection type.

The instance of the ConnectionPersistence is not limited to have the scope of Connection Type which created it. lt may be appropriate for connection cofigurations from other connection types or even adapter types. It is however guaranteed to be appropriate for the ConnectionType from which it was created.

Returns:
ConnectionPersistence An instance of the connection persistence or null if persistence is not supported by the discovery service.
Throws:
MetadataException - The tools should ask the user which persistence mechanism to use.

isConnectionConfigurationComplete

boolean isConnectionConfigurationComplete(ConnectionConfiguration connectionConfiguration)
Verify that given connection configuration is complete, in other word can be reasonably assumed to contain all the information needed to execute the service.

Parameters:
connectionConfiguration - Connection configuration returned from the discovery, the argument must not be null
Returns:
true if configuration is complete, false otherwise

synchronizeFromResourceAdapterToPropertyGroup

void synchronizeFromResourceAdapterToPropertyGroup(ResourceAdapter bean,
                                                   PropertyGroup pg)
                                                   throws MetadataException
Synchronizes from the ResourceAdapter JavaBean to the PropertyGroup.

Parameters:
bean - The source ResourceAdapter JavaBean.
pg - The target PropertyGroup.
Throws:
MetadataException - if any error occured.
See Also:
PropertyGroup

synchronizeFromPropertyGroupToResourceAdapter

void synchronizeFromPropertyGroupToResourceAdapter(PropertyGroup pg,
                                                   ResourceAdapter bean)
                                                   throws MetadataException
Synchronizes from the PropertyGroup to the ResourceAdapter JavaBean.

Parameters:
pg - The source PropertyGroup which has user interface updates.
bean - The target outbound ResourceAdapter JavaBean.
Throws:
MetadataException - if any error occured.
See Also:
PropertyGroup