Extend WBIMetadataType if your adapter needs a simple wrapper object around a
payload object, similar to the IBM WebSphereAdapter for Flat Files and the IBM
WebSphereAdapter for FTP. The WBIMetadataType interface allows you to select a
payload type, and optionally generate a business graph structure in addition to a
plain wrapper. Implement MetadataType interface directlyif you need to deal with
a more complex object structure.
Toextend WBIMetadataType, implement the following methods:
vpublic abstract String getDefaultNamespace();
This method returns a default namespace for your adapter.
vpublic abstract SchemaDefinition[] getSchemaDefinitions();
This method returns the generated schema definitions, based on the payload.
The following helper methods enable you to do this:
–getImportedSchemaLocationString();
This helper method returns the relative location of the selected schema.
–getImportedSchema()
This helper method returns the Qname of the selected schema.
–getNamespace()
This helper method returns the namespace that the user has entered.
Discovery-service.xml
For the tool to detect and use your adapter, you need a discovery-service.xml file
in yor “meta-in” folder.
Here is an example of the discovery-service.xml file:
<?xml version="1.0" encoding="utf-8"?>
<emd:discoveryService xmlns:emd="commonj.connector"
xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/j2ee_1_4.xsd">
<j2ee:description>My Adapter</j2ee:description>
<j2ee:display-name>My Adapter</j2ee:display-name>
<emd:vendor-name xsi:type="j2ee:xsdStringType">My vendor </emd:vendor-name>
<emd:version xsi:type="j2ee:xsdStringType">My Version</emd:version>
<emd:spec-version>1.1</emd:spec-version>
<emd:metadataBuild-class xsi:type="j2ee:fully-qualified-classType">
mypackage.myadapter.MetadataBuild</emd:metadataBuild-class>
<emd:metadataEdit-class xsi:type="j2ee:fully-qualified-classType">
mypackage.myadapter.MetadataEdit</emd:metadataEdit-class>
<emd:metadataType-class xsi:type="j2ee:fully-qualified-classType">
mypackage.myadapter.MetadataType</emd:metadataType-class>
<emd:application-specific-schema>
</emd:application-specific-schema></emd:discoveryService>
Structured record implementationStructuredRecord class needs to be implemented by adapters when the data
exchanged with backend application can be well defined. Extend foundation class
com.ibm.j2ca.base.WBIStructuredRecord and implement the associated methods.
162 WebSphereAdapters: WebSphereAdapter Toolkit User Guide