|
IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.btt.bc.fx.impl.ForeignExchangeImpl
public class ForeignExchangeImpl
This class is responsible for performing all foreign exchange calculations.
Constructor Summary | |
---|---|
ForeignExchangeImpl()
|
Method Summary | |
---|---|
java.math.BigDecimal |
convert(java.lang.String fromCurrency,
java.lang.String toCurrency,
java.lang.String fromMonetaryItem,
java.lang.String toMonetaryItem,
java.math.BigDecimal fromAmount)
Converts an amount in the source currency to another currency. |
java.math.BigDecimal |
convertReverse(java.lang.String fromCurrency,
java.lang.String toCurrency,
java.lang.String fromMonetaryItem,
java.lang.String toMonetaryItem,
java.math.BigDecimal toAmount)
Converts the source currency to the specified amount in the destination currency. |
java.lang.String[] |
getAllSupportedCurrencies()
Returns all supported currency codes in a Set. |
java.math.BigDecimal |
getBuyRate(java.lang.String toCurrency,
java.lang.String fromMonetaryItem,
java.lang.String toMonetaryItem)
Returns the rate at which the financial institution buys the specified currency against the home currency. |
java.math.BigDecimal |
getBuyRate(java.lang.String fromCurrency,
java.lang.String toCurrency,
java.lang.String fromMonetaryItem,
java.lang.String toMonetaryItem)
Returns the rate at which the financial institution buys the specified currency. |
java.lang.String[] |
getDefinedMonetaryItems()
Returns all defined monetary item types. |
java.lang.String |
getHomeCurrency()
Returns the home currency property of the financial institution. |
long |
getRatesCacheRefreshInterval()
Returns the interval to refresh the rates cache. |
RatesProvider |
getRatesProvider()
Returns the rates provider instance of the ForeignExchangeEngine. |
java.math.BigDecimal |
getSellRate(java.lang.String toCurrency,
java.lang.String fromMonetaryItem,
java.lang.String toMonetaryItem)
Returns the rate at which the financial institution sells the specified currency against the home currency. |
java.math.BigDecimal |
getSellRate(java.lang.String fromCurrency,
java.lang.String toCurrency,
java.lang.String fromMonetaryItem,
java.lang.String toMonetaryItem)
Returns the rate at which the financial institution sells the specified currency. |
void |
initialize()
|
void |
setCurrencyResource(CurrencyResource currencyResource)
Sets the CurrencyResource instance. |
void |
setHomeCurrency(java.lang.String homeCurrency)
Sets the home currency property of the financial institution. |
void |
setRatesCacheRefreshInterval(java.lang.Long ratesCacheRefreshInterval)
Sets the interval to refresh the rates cache. |
void |
setRatesProvider(RatesProvider ratesProvider)
Sets the rates provider instance of the ForeignExchangeEngine. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ForeignExchangeImpl()
Method Detail |
---|
public void initialize() throws ForeignExchangeException
ForeignExchangeException
public java.lang.String getHomeCurrency()
getHomeCurrency
in interface ForeignExchange
public void setHomeCurrency(java.lang.String homeCurrency)
homeCurrency
- the character code of the home currencypublic long getRatesCacheRefreshInterval()
public void setRatesCacheRefreshInterval(java.lang.Long ratesCacheRefreshInterval)
ratesCacheRefreshInterval
- the interval in millisecondpublic java.math.BigDecimal getBuyRate(java.lang.String fromCurrency, java.lang.String toCurrency, java.lang.String fromMonetaryItem, java.lang.String toMonetaryItem) throws ForeignExchangeException
getBuyRate
in interface ForeignExchange
request
- the RatesQueryRequest identifying the request data
ForeignExchangeException
- occurs if there is an error accessing the buy rate.public java.math.BigDecimal getSellRate(java.lang.String fromCurrency, java.lang.String toCurrency, java.lang.String fromMonetaryItem, java.lang.String toMonetaryItem) throws ForeignExchangeException
getSellRate
in interface ForeignExchange
request
- the RatesQueryRequest identifying the request data
ForeignExchangeException
- occurs if there is an error accessing the sell rate.public java.lang.String[] getAllSupportedCurrencies() throws ForeignExchangeException
ForeignExchange
getAllSupportedCurrencies
in interface ForeignExchange
ForeignExchangeException
- occurs if there is an error accessing the Setpublic java.lang.String[] getDefinedMonetaryItems() throws ForeignExchangeException
ForeignExchange
getDefinedMonetaryItems
in interface ForeignExchange
ForeignExchangeException
- occurs if there is an error accessing the Setpublic RatesProvider getRatesProvider()
public void setRatesProvider(RatesProvider ratesProvider)
ratesProvider
- the rates provider instance of the ForeignExchangeEnginepublic java.math.BigDecimal convert(java.lang.String fromCurrency, java.lang.String toCurrency, java.lang.String fromMonetaryItem, java.lang.String toMonetaryItem, java.math.BigDecimal fromAmount) throws ForeignExchangeException
ForeignExchange
convert
in interface ForeignExchange
fromCurrency
- the String character code of the source currencytoCurrency
- the String character code of the destination currencyfromMonetaryItem
- the type of monetary item of the source currencytoMonetaryItem
- the type of monetary item of the destination currencyfromAmount
- the amount of money in the source currency
ForeignExchangeException
- occurs if there is an error converting the currenciespublic java.math.BigDecimal convertReverse(java.lang.String fromCurrency, java.lang.String toCurrency, java.lang.String fromMonetaryItem, java.lang.String toMonetaryItem, java.math.BigDecimal toAmount) throws ForeignExchangeException
ForeignExchange
convertReverse
in interface ForeignExchange
fromCurrency
- the String character code of the source currencytoCurrency
- the String character code of the destination currencyfromMonetaryItem
- the type of monetary item of the source currencytoMonetaryItem
- the type of monetary item of the destination currencytoAmount
- the amount of money in the destination currency
ForeignExchangeException
- occurs if there is an error converting the currenciespublic java.math.BigDecimal getBuyRate(java.lang.String toCurrency, java.lang.String fromMonetaryItem, java.lang.String toMonetaryItem) throws ForeignExchangeException
ForeignExchange
getBuyRate
in interface ForeignExchange
toCurrency
- the String character code of the currency being boughtfromMonetaryItem
- the type of monetary item of the source currencytoMonetaryItem
- the type of monetary item of the destination currency
ForeignExchangeException
- occurs if there is an error accessing the ratespublic java.math.BigDecimal getSellRate(java.lang.String toCurrency, java.lang.String fromMonetaryItem, java.lang.String toMonetaryItem) throws ForeignExchangeException
ForeignExchange
getSellRate
in interface ForeignExchange
toCurrency
- the String character code of the destination currencyfromMonetaryItem
- the type of monetary item of the source currencytoMonetaryItem
- the type of monetary item of the destination currency
ForeignExchangeException
- occurs if there is an error accessing the ratespublic void setCurrencyResource(CurrencyResource currencyResource)
currencyResource
- the CurrencyResource instance
|
IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |