beautypg.com

Structured record implementation – IBM WebSphere Adapters User Manual

Page 168

background image

Extend WBIMetadataType if your adapter needs a simple wrapper object around a
payload object, similar to the IBM WebSphere Adapter for Flat Files and the IBM
WebSphere Adapter 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 directly if you need to deal with
a more complex object structure.

To extend WBIMetadataType, implement the following methods:

v

public abstract String getDefaultNamespace();

This method returns a default namespace for your adapter.

v

public 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:

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">

My Adapter
My Adapter

My vendor
My Version
1.1

mypackage.myadapter.MetadataBuild

mypackage.myadapter.MetadataEdit

mypackage.myadapter.MetadataType

Structured record implementation

StructuredRecord 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

WebSphere Adapters: WebSphere Adapter Toolkit User Guide