public abstract class CachedOnlineAmountMoneyExchangeRateRetriever extends OnlineAmountMoneyExchangeRateRetriever
| Modifier and Type | Field and Description |
|---|---|
static long |
FILE_CACHE_EXPIRATION_MILLIS_DEFAULT |
| Constructor and Description |
|---|
CachedOnlineAmountMoneyExchangeRateRetriever(File fileCacheFile,
long fileCacheExpirationMillis,
String initialResultResourceName) |
CachedOnlineAmountMoneyExchangeRateRetriever(File fileCacheFile,
String initialResultResourceName) |
| Modifier and Type | Method and Description |
|---|---|
double |
fetchConversionRate(org.jscience.economics.money.Currency currency)
Doesn't cache since results are already cached in super class.
|
protected abstract org.apache.commons.lang3.tuple.Pair<Map<org.jscience.economics.money.Currency,Double>,org.jscience.economics.money.Currency> |
fetchResult()
Allows to retrieve the complete cache at once which makes sense for
subclasses which will retrieve a list of currency exchange rates rather
than a single result (probably all).
|
org.apache.commons.lang3.tuple.Pair<Map<org.jscience.economics.money.Currency,Double>,org.jscience.economics.money.Currency> |
getResult() |
Set<org.jscience.economics.money.Currency> |
getSupportedCurrencies()
Gets a set of supported currencies from the mechanism used for retrieval
of exchange rates.
|
protected abstract String |
getUrl() |
retrieveExchangeRatepublic static final long FILE_CACHE_EXPIRATION_MILLIS_DEFAULT
public CachedOnlineAmountMoneyExchangeRateRetriever(File fileCacheFile, String initialResultResourceName)
public org.apache.commons.lang3.tuple.Pair<Map<org.jscience.economics.money.Currency,Double>,org.jscience.economics.money.Currency> getResult() throws AmountMoneyExchangeRateRetrieverException
protected abstract org.apache.commons.lang3.tuple.Pair<Map<org.jscience.economics.money.Currency,Double>,org.jscience.economics.money.Currency> fetchResult() throws AmountMoneyExchangeRateRetrieverException, AmountMoneyExchangeRateRetrievalException
AmountMoneyExchangeRateRetrieverException - if an exception
unrelated to a network failure or missing network connection occuredAmountMoneyExchangeRateRetrievalException - if an exception related
to a network failure or missing network connection occuredpublic Set<org.jscience.economics.money.Currency> getSupportedCurrencies() throws AmountMoneyExchangeRateRetrieverException
AmountMoneyExchangeRateRetrieverAmountMoneyExchangeRateRetrieverException - if an exception
unrelated to a network failure or missing network connection occuredpublic double fetchConversionRate(org.jscience.economics.money.Currency currency)
throws AmountMoneyExchangeRateRetrieverException
fetchConversionRate in class OnlineAmountMoneyExchangeRateRetrievercurrency - the currency to fetch forAmountMoneyExchangeRateRetrieverException - if an exception
unrelated to a network failure or missing network connection occuredprotected abstract String getUrl()
Copyright © 2018. All rights reserved.