|
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.CachedRatesProvider
public class CachedRatesProvider
This class is a decorator with the mechanism used to cache exchange rates. This reduces the number of calls to the server to get these rates.
Constructor Summary | |
---|---|
CachedRatesProvider(RatesProvider ratesProvider,
long refreshInterval)
Constructs an instance of the CachedRatesProvider class with an given rates provider to be cached and the interval to refresh the cache. |
Method Summary | |
---|---|
java.util.Set<java.lang.String> |
getAllSupportedCurrencies()
Returns all supported currency codes in a Set. |
(package private) int |
getCachedRatesNum()
Returns the number of cached rates |
java.util.Set<java.lang.String> |
getDefinedMonetaryItems()
Returns all defined monetary item types. |
java.math.BigDecimal |
getRate(RatesQueryRequest request,
boolean isBuy)
Returns the rate at which the financial institution buys or sells the destination currency. |
long |
getRefreshInterval()
Returns the interval to refresh the rates cache. |
void |
setRefreshInterval(long refreshInterval)
Sets the interval to refresh the rates cache. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CachedRatesProvider(RatesProvider ratesProvider, long refreshInterval)
ratesProvider
- the given rates provider whose rates are to be cachedrefreshInterval
- the interval to refresh the cacheMethod Detail |
---|
public java.math.BigDecimal getRate(RatesQueryRequest request, boolean isBuy) throws ForeignExchangeException
RatesProvider
getRate
in interface RatesProvider
request
- the RatesQueryRequest instance specifying the information of
the queryisBuy
- true if the requested rate is a buy rate, otherwise it should
be false
ForeignExchangeException
- occurs if there is an error accessing the ratepublic long getRefreshInterval()
public void setRefreshInterval(long refreshInterval)
refreshInterval
- the interval measured in millisecondpublic java.util.Set<java.lang.String> getAllSupportedCurrencies() throws ForeignExchangeException
RatesProvider
getAllSupportedCurrencies
in interface RatesProvider
ForeignExchangeException
- occurs if there is an error accessing the Setpublic java.util.Set<java.lang.String> getDefinedMonetaryItems() throws ForeignExchangeException
RatesProvider
getDefinedMonetaryItems
in interface RatesProvider
ForeignExchangeException
- occurs if there is an error accessing the Setint getCachedRatesNum()
|
IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |