This section explains how to use specialized message validation features and Projects available with the SWIFT OTD Library.
The SWIFT OTD Library accomplishes validation operations via Java-based Collaboration Definitions packaged with the library. These Collaboration Definitions have the following validation features provided to enhance their use:
Message Format Validation Rules (MFVRs): Set of functions that accurately test the semantic validity of a given subset of the SWIFT messages.
BICDirService (Bank Identifier Code Directory Service) Lookup: A set of methods that provide search and validation functionality for SWIFT”s BIC codes and ISO currency and country codes. The information used to look up and validate is provided by SWIFT.
BICPlusIBAN Validation: A set of methods that provide search and validation functionality for SWIFT”s BIC and IBAN codes. The SWIFT OTD Library implements the suggested validation rules provided by SWIFT. Please see BICPlusIBAN Directory Technical Specifications from SWIFT for more information.
These validation features share the following use characteristics:
Each available method and function is fully incorporated into and used by the appropriate SWIFT message OTD.
You can modify the validation rules for your system if desired. Customize the Collaboration’s validation rules by checking the Collaboration out (from Version Control) and modify the Validation Collaboration code. The sample implementation and instructions are provided in the Validation Collaboration as Java comments.
Validation methods and functions have no dependencies outside SWIFT data files and the individual OTD.
Installing the OTD library allows eGate and any eWay you use with the library to provide full support for these features. The rest of this section provides a summary of how these features operate with the SWIFT OTD Library.
In addition to components described under Basic Validation Features, the SWIFT OTD Library also contains the following basic components:
SWIFT OTDs (2001, 2002, 2003, 2005, 2006, 2007, and 2008): OTDs in the SWIFT OTD Library that represent standard SWIFT message types. See Increasing the heap size from the heapSize.bat file for details. The validation features are only available with the 2003, 2005, 2006, 2007, and 2008 OTD libraries.
MT Funds OTDs: Specialized OTDs that allow you to automate the specialized funds operations. This category contains FIN-based OTDs.
Validation Collaboration Definitions: Validation eGate components provided for each SWIFT message type. See Validation Collaboration Definitions for details.
Sample Projects: Sample Projects have been provided as examples of validation implementation. See SWIFT Projects for details.
The SWIFT OTD Library now provides two additional OTD API methods, validate() and validateMFVR(), that can be invoked by a Collaboration to validate SWIFT 2003, 2005, 2006, 2007 and 2008 OTDs directly in the Collaboration. (see In Collaboration Validation Methods). This is an alternative to using the Validation Collaboration Definitions.
Validation Collaboration Definitions are provided for many key SWIFT message types. These Collaboration Definitions, when combined with eGate Services, become Java-based Collaborations that verify the syntax of the SWIFT messages.
This verification is done by parsing the data into a structure that conforms to the SWIFT standard specifications. The validation functions use these Collaborations to access specific data that is then verified according the algorithms of the MFVR specifications.
For lists of these Collaboration Definitions, see Message Validation Rules.
You can combine the library’s validation features in any way desired, to meet your specific needs. The SWIFT OTD Library packages a prebuilt implementation that takes SWIFT messages from a JMS Queue or Topic and validates them individually, then writes the results to a specified JMS Queue or Topic. One set contains valid messages, and the other contains the invalid ones, along with messages indicating the errors generated.
The validation Collaboration Definitions are part of the OTD Library and packaged with validation Project examples you can import into eGate.
Each validation Collaboration Definition has only the applicable tests for a specific OTD/message type, but they all operate according to the same general format, as follows:
The Service first tests a message to make sure it is syntactically correct, by parsing it into the OTD.
If the message fails, the message and its parser error are sent to an error Queue. If the message is valid, all applicable MFVR functions are applied to the message.
Any and all errors produced from these tests are accumulated, and the combined errors, as well as the message, are written to an error Queue for later processing. As long as no error is fatal, all applicable tests are applied.
Again any and all errors produced from these tests are accumulated, and the combined errors and message are written to the error Queue for later processing.
If no errors are found in a message, it is sent to a Queue for valid messages.
For an explanation of using these Collaboration Definitions and the validation Project examples, see SWIFT Projects.
The SWIFT OTD Library provides a set of run-time methods that allow you to manipulate OTD data in a variety of ways. The following methods are the most frequently used with validation operations:
set(): Allows you to set data on a parent node using a byte array or a string as a parameter.
value(): Lets you get the string value of data in a node at any tree level.
getLastSuccessInfo(): Returns a string that represents information about the last node in the tree that was successfully parsed.
command(): Allows you to pass flags as parameters, which set levels that determine the quantity of debug information you receive (see Setting the Debug Level for details).
marshalToString() and unmarshalFromString(): Returns string data from or accepts string data to a desired node.
In addition, the library has methods that allow you to perform basic but necessary operations with the OTDs. See Table 11.
Table 11 Basic OTD Methods
Method |
Description |
---|---|
add() |
Adds a repetition to a given child node. |
append() |
Adds given data at the end of existing data. |
copy() |
Copies given data at a specified point. |
count() |
Gives the count of node repetitions. |
delete() |
Erases data at a specified point. |
get() |
Retrieves data from a node. |
has() |
Checks whether a specified child node is present. |
insert() |
Inserts given data at a specified point. |
length() |
Returns the length of data contained in an object. |
marshal() |
Serializes internal data into an output stream. |
remove() |
Removes a given child node repetition. |
reset() |
Clears out any data held by an OTD. |
size() |
Returns the current number of repetitions for the current child node. |
unmarshal() |
Parses given input data into an internal data tree. |
To help in your use of the SWIFT OTD Library and its features, the library includes a Javadoc. You can see this document for complete details on all of these methods. See Table 13 for more information on this document and how to use it.