Package org.javamoney.moneta.convert.ecb
Class ECBCurrentRateProvider
java.lang.Object
org.javamoney.moneta.spi.AbstractRateProvider
org.javamoney.moneta.convert.ecb.ECBCurrentRateProvider
- All Implemented Interfaces:
ExchangeRateProvider,LoaderService.Listener
This class implements an
ExchangeRateProvider that loads data from
the European Central Bank data feed (XML). It loads the current exchange
rates. The provider loads all data up to 1999 into its
historic data cache.- Author:
- Anatole Tresch, Werner Keil, otaviojava
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CurrencyUnitBase currency of the loaded rates is always EUR.protected CountDownLatchprotected Stringprotected final Map<LocalDate,Map<String, ExchangeRate>> Historic exchange rates, rate timestamp as UTC long.protected final StringFields inherited from class org.javamoney.moneta.spi.AbstractRateProvider
log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected LoadDataInformationGets the default data loading configuration.getExchangeRate(ConversionQuery conversionQuery) voidnewDataLoaded(String resourceId, InputStream is) toString()Methods inherited from class org.javamoney.moneta.spi.AbstractRateProvider
divide, divide, getContext, getCurrencyConversion, getExchangeContext, getQueryDates, getScale, multiplyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface javax.money.convert.ExchangeRateProvider
getCurrencyConversion, getCurrencyConversion, getExchangeRate, getExchangeRate, getReversed, isAvailable, isAvailable, isAvailable
-
Field Details
-
BASE_CURRENCY
Base currency of the loaded rates is always EUR. -
rates
Historic exchange rates, rate timestamp as UTC long. -
loadState
-
loadLock
-
remoteResource
-
-
Constructor Details
-
ECBCurrentRateProvider
public ECBCurrentRateProvider()
-
-
Method Details
-
getDataId
-
getDefaultLoadData
Gets the default data loading configuration. This configuration is used if no other is provided.- Returns:
- the configuration
-
newDataLoaded
- Specified by:
newDataLoadedin interfaceLoaderService.Listener
-
getExchangeRate
- Specified by:
getExchangeRatein interfaceExchangeRateProvider- Specified by:
getExchangeRatein classAbstractRateProvider
-
toString
-