@@ -0,0 +1,1830 @@
+package google.database;%0A%0Aimport java.util.List;%0Aimport java.util.Optional;%0A%0Aimport google.dao.DaoException;%0Aimport google.model.Result;%0A%0Apublic interface DbService %7B%0A%0A%09/**%0A%09 * This method saves the given result in the database.%0A%09 * %0A%09 * @param result%0A%09 *            %7B@link Result%7D object to be saved.%0A%09 * %0A%09 * @throws DaoException%0A%09 *             When a problem with the database occurred.%0A%09 */%0A%09void saveResult(Result result);%0A%0A%09/**%0A%09 * This method gets all results from the database.%0A%09 * %0A%09 * @return A list of all results stored in the database or an empty list when no%0A%09 *         results were found.%0A%09 * %0A%09 * @throws DaoException%0A%09 *             When a problem with the database occurred.%0A%09 */%0A%09List%3CResult%3E findAllResults();%0A%0A%09/**%0A%09 * This method finds a result corresponding to the given query.%0A%09 * %0A%09 * @param query%0A%09 *            Query to be found.%0A%09 * %0A%09 * @return %7B@link Optional%7D of the found result or an empty optional if no%0A%09 *         result was found.%0A%09 * %0A%09 * @throws DaoException%0A%09 *             When a problem with the database occurred.%0A%09 */%0A%09Optional%3CResult%3E findResult(String query);%0A%0A%09/**%0A%09 * This method cleans the database.%0A%09 * %0A%09 * @throws DaoException%0A%09 *             When a problem with the database occurred.%0A%09 */%0A%09void deleteAllResults();%0A%0A%09/**%0A%09 * This method removes all results corresponding to the given list of queries.%0A%09 * %0A%09 * @param resultsToRemove%0A%09 *            A list of queries.%0A%09 * %0A%09 * @throws DaoException%0A%09 *             When a problem with the database occurred.%0A%09 */%0A%09void deleteResults(List%3CString%3E resultsToRemove);%0A%0A%09/**%0A%09 * This method removes a result corresponding to the given query.%0A%09 * %0A%09 * @param query%0A%09 *            Query to be deleted.%0A%09 * %0A%09 * @throws DaoException%0A%09 *             When a problem with the database occurred.%0A%09 */%0A%09void deleteResult(String query);%0A%0A%7D%0A

Add a dbService interface.