2 * Copyright (C) 2015 Roland Haeder
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package org.mxchange.pizzaapplication.application;
19 import java.io.IOException;
20 import java.sql.SQLException;
21 import java.util.Deque;
22 import java.util.Iterator;
23 import org.mxchange.jcore.application.Application;
24 import org.mxchange.jshopcore.exceptions.CategoryTitleAlreadyUsedException;
25 import org.mxchange.jshopcore.exceptions.ProductTitleAlreadyUsedException;
26 import org.mxchange.jshopcore.model.category.Category;
27 import org.mxchange.jshopcore.model.product.Product;
31 * @author Roland Haeder<roland@mxchange.org>
33 public interface PizzaApplication extends Application {
36 * Adds given category data from request to database
38 * @param category Category instance
39 * @throws org.mxchange.jshopcore.exceptions.CategoryTitleAlreadyUsedException If the category's title has been used
41 public void doAdminAddCategory (final Category category) throws CategoryTitleAlreadyUsedException;
44 * Adds given product data from request to database
46 * @param product Product instance
47 * @throws org.mxchange.jshopcore.exceptions.ProductTitleAlreadyUsedException If the * product's title has been used
49 public void doAdminAddProduct (final Product product) throws ProductTitleAlreadyUsedException;
52 * Some "getter" for a linked list of all categories
54 * @return All categories
56 public Deque<Category> getAllCategories ();
59 * Some "getter" for a an array of all categories
61 * @return All categories
63 public Iterator<Category> getAllCategoriesIterator ();
66 * Some "getter" for a linked list of all products
68 * @return All products
70 public Deque<Product> getAllProducts ();
73 * Some "getter" for a an array of all products
75 * @return All products
77 public Iterator<Product> getAllProductsIterator ();
80 * Some "getter" for a linked list of only available products
82 * @return Only available products
84 public Deque<Product> getAvailableProducts ();
87 * Some "getter" for a an array of only available products
89 * @return Only available products
91 public Iterator<Product> getAvailableProductsIterator ();
94 * Initializes this instance with given ServletContext
96 * @throws java.sql.SQLException If an SQL error occurs
97 * @throws java.io.IOException If an IO error occurs
99 public void init () throws SQLException, IOException;