IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.bc.fx.impl
Class RatesProviderImpl

java.lang.Object
  extended by com.ibm.btt.bc.fx.AbstractRatesProvider
      extended by com.ibm.btt.bc.fx.impl.RatesProviderImpl
All Implemented Interfaces:
RatesProvider

public class RatesProviderImpl
extends AbstractRatesProvider

This class provides the logic for retrieving the appropriate Foreign Exchange conversion rates. Note that this class does not actually access the database. Instead, it calls the getRate method of the RatesRepository class to retrieve the data it needs.


Constructor Summary
RatesProviderImpl()
           
 
Method Summary
 java.util.Set<java.lang.String> getAllSupportedCurrencies()
          Returns all supported currency codes in a Set.
 java.lang.String getBasicMonetaryItem()
          Returns the basic monetary item of foreign exchange.
 java.util.Set<java.lang.String> getDefinedMonetaryItems()
          Returns all defined monetary item types.
(package private)  java.math.BigDecimal getDirectRate(RatesQueryRequest request, boolean isBuy, int scale)
          Return the conversion rate between the source currency and the destination currency if a direct conversion exists between the two.
 java.math.BigDecimal getRate(RatesQueryRequest request, boolean isBuy)
          Returns the rate at which the financial institution buys or sells the destination currency.
 void setBasicMonetaryItem(java.lang.String basicMonetoryItem)
          Sets the basic monetary item of foreign exchange.
 
Methods inherited from class com.ibm.btt.bc.fx.AbstractRatesProvider
getConversionCurrency, getRatesRepository, setConversionCurrency, setRatesRepository
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RatesProviderImpl

public RatesProviderImpl()
Method Detail

getDirectRate

java.math.BigDecimal getDirectRate(RatesQueryRequest request,
                                   boolean isBuy,
                                   int scale)
                             throws ForeignExchangeException
Return the conversion rate between the source currency and the destination currency if a direct conversion exists between the two.

Parameters:
request - the rates repository instance of the rates provider
isBuy - specifying wheather the requested rate is a buy rate
Returns:
the direct rate between the source currency and the destination currency
Throws:
ForeignExchangeException

getRate

public java.math.BigDecimal getRate(RatesQueryRequest request,
                                    boolean isBuy)
                             throws ForeignExchangeException
Description copied from interface: RatesProvider
Returns the rate at which the financial institution buys or sells the destination currency.

Parameters:
request - the RatesQueryRequest instance specifying the information of the query
isBuy - true if the requested rate is a buy rate, otherwise it should be false
Returns:
the rate at which the financial institution buys or sells the destination currency.
Throws:
ForeignExchangeException - occurs if there is an error accessing the rate

getBasicMonetaryItem

public java.lang.String getBasicMonetaryItem()
Returns the basic monetary item of foreign exchange.

Returns:
the basic monetary item of foreign exchange

setBasicMonetaryItem

public void setBasicMonetaryItem(java.lang.String basicMonetoryItem)
Sets the basic monetary item of foreign exchange.

Parameters:
basicMonetoryItem - the basic monetary item of foreign exchange

getAllSupportedCurrencies

public java.util.Set<java.lang.String> getAllSupportedCurrencies()
                                                          throws ForeignExchangeException
Description copied from interface: RatesProvider
Returns all supported currency codes in a Set.

Returns:
the Set containing all supported currency codes
Throws:
ForeignExchangeException - occurs if there is an error accessing the Set

getDefinedMonetaryItems

public java.util.Set<java.lang.String> getDefinedMonetaryItems()
                                                        throws ForeignExchangeException
Description copied from interface: RatesProvider
Returns all defined monetary item types.

Returns:
the Set containing all supported monetary item types
Throws:
ForeignExchangeException - occurs if there is an error accessing the Set

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2009