IBM WebSphere Adapters Network Card User Manual


 
How to support fault handling:
Understand the following concepts for implementing fault handling into your
adapter.
Before you define faults, review adapter processing to determine which error
conditions can be categorized as faults, rather than as exceptions. You will likely be
able to apply at least one of the faults provided in the Adapter Foundation Classes.
Some unique conditions might be categorized as faults, but fault classes in the
Adapter Foundation Classes might not be provided for the conditions. Error
conditions from which you can recover might be candidates for fault handling. IT
exceptions, such as one time configuration issues (wrong password, incorrect
directory permissions, and so on) are not candidates for fault handling.
When naming a fault, ensure that the name describes the condition and is
independent of the technology or adapter you are using. For example, the fault
class name for an SAP IDoc record not found condition should be
RecordNotFoundFault, not SAPIDOCRecordNotfoundFault. Additionally, you might
not need to define new faults if the same semantic meaning can apply to multiple
conditions (for example, RecordNotFoundFault, FileNotFoundFault, and
ObjectNotfoundFault).
Implementing faults:
As part of the external service discovery process, you generate fault business
objects and create the method that copies them to your outbound module.
The following examples show these fault exceptions:
v DuplicateRecord
v MatchesExceedLimit
Note: To implement fault handling in the adapter, add getXMLListFunctions
method and getBFFunctions method in the extension to
WBIOutboundFunctionDescriptionImpl.
Modifying getXMLListFunctions method
Modifying getXMLListFunctions involves the following changes:
v Adding a line to invoke a new method.
v Creating the new method or add some lines to an existing method to specify the
faults
v Completing the stub to implement the FaultDataDescription class
The following example shows the first two changes:
private void getXMLListFunctions(ArrayList functionDescriptions, PropertyGroup pg,
String relativePath, JDEXMLListMetadataObject metadataObj,
WBIMetadataImportConfigurationImpl spec) throws MetadataException{
...
while(iterator.hasNext()) {
String operation = JDEESDConstants.RETRIEVEALL; /* this is only operation
supported for XML Lists */
WBIOutboundFunctionDescriptionImpl funcDesc = new WBIOutboundFunctionDescriptionImpl();
JDEXMLListQueryDataDescription queryDataDesc =(JDEXMLListQueryDataDescription)iterator.next();
//Added for Faults
addFaultsToXMLListDataDescriptionBasedOnOperationName(funcDesc,operation);
WebSphere Adapter development overview 169