/*
 * The MIT License
 * 
 * Copyright (c) 2015 Petar Petrov
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package net.vexelon.bgrates.db;

import java.util.Date;
import java.util.List;

import net.vexelon.bgrates.db.models.ExchangeRates;

/**
 * Encapsulates the available read-write operations to and from an underlying
 * data source implementation.
 */
public interface DataSource {

	/**
	 * Fetches a list of dates for which exchange rates were downloaded and
	 * available in the underlying data source.
	 * 
	 * @return A {@link List} of {@link Date} objects or an empty {@link List},
	 *         if no dates are available.
	 * @throws DataSourceException
	 */
	List<Date> getAvailableRatesDates() throws DataSourceException;

	/**
	 * Fetches the latest exchange rates from the underlying data source.
	 * 
	 * @return {@link ExchangeRates} or <code>null</code>, if no rates are
	 *         available.
	 * @throws DataSourceException
	 */
	ExchangeRates getRates() throws DataSourceException;

	/**
	 * Fetches exchange rates for a given date.
	 * 
	 * @param date
	 * @return {@link ExchangeRates} or <code>null</code>, if no rates are
	 *         available for the given date.
	 * @throws DataSourceException
	 */
	ExchangeRates getRates(Date date) throws DataSourceException;

	/**
	 * Adds exchange rates data for given download {@link Date}.
	 * 
	 * @param date
	 * @param rates
	 * @throws DataSourceException
	 */
	void addRates(Date date, ExchangeRates rates) throws DataSourceException;

}

@@ -1253,29 +1253,28 @@
 .models.
-ExchangeRates
+CurrencyData
 ;%0A%0A/**%0A 
@@ -1859,37 +1859,28 @@
 turn %7B@link 
-ExchangeRates
+List
 %7D or %3Ccode%3En
@@ -1964,37 +1964,42 @@
 ption%0A%09 */%0A%09
-ExchangeRates
+List%3CCurrencyData%3E
  getRates() 
@@ -2117,29 +2117,20 @@
  %7B@link 
-ExchangeRates
+List
 %7D or %3Cco
@@ -2241,29 +2241,34 @@
 n%0A%09 */%0A%09
-ExchangeRates
+List%3CCurrencyData%3E
  getRate
@@ -2481,21 +2481,26 @@
 te, 
-ExchangeRates
+List%3CCurrencyData%3E
  rat

Update return values in DataSource