beautypg.com

IBM WebSphere Adapters User Manual

Page 153

background image

Constructor

The constructor takes MetadataConnection as an argument. The constructor can
also return properties from MetadataConnection that were used to start the
discovery service; for example, prefix, directory name, and those properties that
populate the MetadataObject nodes in the tree.

public TwineBallMetadataTree(WBIMetadataConnectionImpl connection,

LogUtils logUtils)

throws MetadataException {

super(connection);
this.connection = connection;
this.logUtils = logUtils;
try {

cciConnection = (TwineBallConnection) connection.getEISConnection();
twineBallConnection = cciConnection.getEISConnection();
WBIOutboundConnectionConfigurationImpl conf =

(WBIOutboundConnectionConfigurationImpl)

connection.getConnectionCofiguration();

PropertyGroup propertyGroup = conf.getAppliedProperties();
TwineBallManagedConnection managedConnection =

(TwineBallManagedConnection) cciConnection.getManagedConnection();

} catch (ResourceException e) {

throw new MetadataException(e.getMessage(), e);

}

}

createMetadataSelection

The createMetadataSelection() method returns an instance of the specific
MetadataSelection

class. The enterprise metadata discovery implementation

extends WBIMetadataSelectionImpl and returns an instance of that class in this
method.

public MetadataSelection createMetaDataSelection() {

return new TwineBallMetadataSelection();

}

createFilterProperties

The createFilterProperties() method returns a property group instance that is
used to perform filtering for nodes of the tree. This filter is used for displaying top
level nodes on the tree only.

public PropertyGroup createFilterProperties() {

WBIPropertyGroupImpl propertyGroup = null;
try {

propertyGroup = new WBIPropertyGroupImpl

(Constants.SELECTION_PROPERTIES);

propertyGroup.setDisplayName

(WBIMetadataDiscoveryImpl.getPropertyName
(Constants.SELECTIONPROPERTIES));

propertyGroup.setDescription

(WBIMetadataDiscoveryImpl.getPropertyDescription
(Constants.SELECTIONPROPERTIES));

WBISingleValuedPropertyImpl typeProp = new WBISingleValuedPropertyImpl

(Constants.SERVICETYPE, String.class);

String[] values = { Constants.INBOUND, Constants.OUTBOUND };
typeProp.setValidValues(values);
typeProp.setDefaultValue(Constants.OUTBOUND);
typeProp.setDisplayName

(WBIMetadataDiscoveryImpl.getPropertyName
(Constants.SERVICETYPE));

typeProp.setDescription

(WBIMetadataDiscoveryImpl.getPropertyDescription

WebSphere Adapter development overview

147