Package org.apache.solr.schema
Interface ExchangeRateProvider
- 
- All Known Implementing Classes:
- FileExchangeRateProvider,- OpenExchangeRatesOrgProvider
 
 public interface ExchangeRateProviderInterface for providing pluggable exchange rate providers to @CurrencyField
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description doublegetExchangeRate(String sourceCurrencyCode, String targetCurrencyCode)Get the exchange rate between the two given currenciesvoidinform(org.apache.lucene.util.ResourceLoader loader)Passes a ResourceLoader, used to read config files from e.g.voidinit(Map<String,String> args)Initializes the provider by passing in a set of key/value configs as a map.Set<String>listAvailableCurrencies()List all configured currency codes which are valid as source/target for this Providerbooleanreload()Ask the currency provider to explicitly reload/refresh its configuration.
 
- 
- 
- 
Method Detail- 
getExchangeRatedouble getExchangeRate(String sourceCurrencyCode, String targetCurrencyCode) throws org.apache.solr.common.SolrException Get the exchange rate between the two given currencies- Returns:
- the exchange rate as a double
- Throws:
- org.apache.solr.common.SolrException- if the rate is not defined in the provider
 
 - 
listAvailableCurrenciesSet<String> listAvailableCurrencies() List all configured currency codes which are valid as source/target for this Provider- Returns:
- a Set of ISO 4217 currency code strings
 
 - 
reloadboolean reload() throws org.apache.solr.common.SolrExceptionAsk the currency provider to explicitly reload/refresh its configuration. If this does not make sense for a particular provider, simply do nothing- Returns:
- true if reload of rates succeeded, else false
- Throws:
- org.apache.solr.common.SolrException- if there is a problem reloading
 
 - 
initvoid init(Map<String,String> args) Initializes the provider by passing in a set of key/value configs as a map. Note that the map also contains other fieldType parameters, so make sure to avoid name clashes.Important: Custom config params must be removed from the map before returning - Parameters:
- args- a @Map of key/value config params to initialize the provider
 
 - 
informvoid inform(org.apache.lucene.util.ResourceLoader loader) throws org.apache.solr.common.SolrExceptionPasses a ResourceLoader, used to read config files from e.g. ZooKeeper. Implementations not needing resource loader can implement this as NOOP.Typically called after init - Parameters:
- loader- a @ResourceLoader instance
- Throws:
- org.apache.solr.common.SolrException
 
 
- 
 
-