The BICDirService methods are static methods of a single Java class, the BICDir class. There is one method per each required lookup and validation. The BICDir methods are not dependent on any module other than SWIFT data files.
The BICDir class has the following lookup methods:
Look up BIC by Institution Name: Takes a string and returns a byte array of BICs (one element is possible). The signature is:
BIC[] getBIC(institutionName*); |
Look up BIC by Institution Name, City and Country: Takes three strings, an institution name, city, and country, and returns a byte array of BICs (one element is possible). The signature is:
BIC[] getBIC(institutionName*, city*, country*); |
Look up Institution Name by BIC: Takes a BIC string, either a BIC 8 or BIC11, and returns a byte array of institution names (one element is possible). The signature is:
institutionName[] getInstitutionName(BIC); |
Look up Currency Code by Country Code: Takes a string, a country code, and returns the currency code. The signature is:
currencyCode getCurrencyCode(countryCode); |
Look up Country Code by Currency Code: Takes a string, a currency code, and returns the country code. The signature is:
countryCode getCountryCode(currencyCode); |
The BICDir class has the following validation methods:
Validate BIC: Takes a string, either a BIC 8 or BIC11, and returns true or false. The signature is:
boolean validateBIC(BIC); |
Validate Currency Code: Takes a string, a currency code, and returns true or false. The signature is:
boolean validateCurrencyCode(currencyCode); |
Validate Country Code: Takes a string, a country code, and returns true or false. The signature is:
boolean validateCountryCode(countryCode); |
The purpose of the exceptions is to give you some indication of what error has occurred and how to rectify it.
These error messages are implemented using the log4j framework. STC.OTD.SWIFT.BICDirService is used as the logging category.
The message of BICDir exception takes the following general form:
“BICDirService Error [”XX“]– “ error-message
Where:
“”: Marks static text.
XX: Stands for a unique number assigned to each error message.
error-message: A descriptive narrative derived from the condition that caused the error, and a possible solution to rectify it.