commonj.connector.metadata.discovery.connection
Interface ConnectionConfiguration

All Known Subinterfaces:
InboundConnectionConfiguration, OutboundConnectionConfiguration

public interface ConnectionConfiguration

A configuration object representing properties of the connection. The interface presents two views of the properties, a unified view with all the properties and the per bean view where properties are presented in groups corresponding to the resource adapter beans, ResourceAdatper, ActivationSpec and ManagedConnectionFactory.

The providers of the metadata discovery service implement subinterfaces of the ConnectionConfiguration specialized for the inbound or outbound configuratin.

Since:
1.0
See Also:
InboundConnectionConfiguration, OutboundConnectionConfiguration

Method Summary
 boolean applyResourceAdapterProperties(PropertyGroup propertyValues)
          Apply values to properties of the Resource Adapter.
 boolean applyUnifiedProperties(PropertyGroup propertyValues)
          Apply values to the unified properties defining this connection.
 PropertyGroup createResourceAdapterProperties()
          Creates a new instance of the properties associated with the ResourceAdapter JavaBean needed to support connections represented by this configuration.
 PropertyGroup createUnifiedProperties()
          Get all the properties that define the connection represented by this configuration.
 ConnectionType getConnectionType()
          Gets the ConnectionType object associated with this configuration.
 String getDescription()
          A description of the connection configuration.
 String getName()
          Returns the name associated with this instance of the connection configuration.
 void setDescription(String description)
          A description of the connection configuration.
 void setName(String name)
          Sets the name associated with this connection configuration.
 

Method Detail

getName

String getName()
Returns the name associated with this instance of the connection configuration.

Returns:
String The name associated with the configuration. The return value must not be null.

setName

void setName(String name)
Sets the name associated with this connection configuration. For the purpose of persisting the connection configuration, the name must be unique among all configurations within the scope of adapter type and connection type. When the ConnectionConfiguration is persisted the name must not be null. The setter allows to change the default value when the connection is persisted. The value is persisted in the current locale and later retrieved using current locale of the tooling environment.

The setter method allows to associate user specifid name with the configuration.

Parameters:
name - The name to be associated with the connection configuration. The argument must not be null.

getConnectionType

ConnectionType getConnectionType()
Gets the ConnectionType object associated with this configuration. The ConnectionType will be a concrete implementation of either InboundConnectionType or OutboundConnectionType interfaces that created this configuration and for which the configuration had been saved.

Returns:
ConnectionType The type of connection for which this configuration had been saved
See Also:
OutboundConnectionType.createOutboundConnectionConfiguration(), InboundConnectionType.createInboundConnectionConfiguration()

createResourceAdapterProperties

PropertyGroup createResourceAdapterProperties()
Creates a new instance of the properties associated with the ResourceAdapter JavaBean needed to support connections represented by this configuration. This method presents configuration properties in the per bean view.

The value settings of the properties returned must match any values currently applied via a previous call to applyResourceAdapterProperties(commonj.connector.metadata.discovery.properties.PropertyGroup).

Returns:
PropertyGroup A property group representing properties of the ResourceAdapter Java Bean. The return value must not be null.

applyResourceAdapterProperties

boolean applyResourceAdapterProperties(PropertyGroup propertyValues)
Apply values to properties of the Resource Adapter.

Parameters:
propertyValues - A property group containing values of properties to be set on the ResourceAdapter Java Bean. The PropertyGroup should have been created using getResourceAdapterProperties(). The argument must not be null unless ResourceAdapter Java Bean has no properties.
Returns:
Returns true if the applied property values change the connection configuration such that a restart of any associated live connections would be required for the changes to take effect. Returns false if the changes can be applied to a live connection without requiring a re-start.

createUnifiedProperties

PropertyGroup createUnifiedProperties()
Get all the properties that define the connection represented by this configuration. The number, name, and types of the properties in this group are dictated and defined by the connection type for this configuration. This method presents configuration properties in the unified view.

Returns:
PropertyGroup A property group representing all the properties defining connection. The return value must not be null unless ResourceAdapter Java Bean and either ManagedConnectionFactory Java Bean or ActivationSpec Java Bean have no properties.

applyUnifiedProperties

boolean applyUnifiedProperties(PropertyGroup propertyValues)
Apply values to the unified properties defining this connection. Each specific ConnectionConfiguration implemenation determines objects to which the unified properties are mapped.

Parameters:
propertyValues - A property group containing values of all properties to be set on beans representing this connection. The PropertyGroup should have been created using getUnifiedProperties(). The argument must not be null.
Returns:
Returns true if the applied property values change the connection configuration such that a restart of any associated live connections would be required for the changes to take effect. Returns false if the changes can be applied to a live connection without requiring a re-start.
See Also:
InboundConnectionConfiguration, OutboundConnectionConfiguration

getDescription

String getDescription()
A description of the connection configuration.

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

Returns:
description A description of the connection configuration.
See Also:
ResourceBundle, MessageFormat

setDescription

void setDescription(String description)
A description of the connection configuration. The setter allows to change the default value when the connection is persisted. The value is persisted in the current locale and later retrieved using current locale of the tooling environment.

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

Parameters:
description - A description of the connection configuration.
See Also:
ResourceBundle, MessageFormat