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.lang.reflect.InvocationTargetException;
21 import java.sql.SQLException;
22 import java.util.Deque;
23 import java.util.Iterator;
24 import org.mxchange.jcore.application.Application;
25 import org.mxchange.jshop.category.Category;
26 import org.mxchange.jshop.exceptions.CategoryTitleAlreadyUsedException;
27 import org.mxchange.jshop.exceptions.ProductTitleAlreadyUsedException;
28 import org.mxchange.jshop.product.Product;
32 * @author Roland Haeder
34 public interface PizzaApplication extends Application {
36 * Some "getter" for a linked list of only available products
38 * @return Only available products
39 * @throws java.io.IOException If an IO error occurs
40 * @throws java.sql.SQLException If an SQL error occurs
41 * @throws java.lang.NoSuchMethodException If a method was not found
42 * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly
43 * @throws java.lang.reflect.InvocationTargetException If something else happens?
45 public Deque<Product> getAvailableProducts () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
48 * Some "getter" for a linked list of all products
50 * @return All products
51 * @throws java.io.IOException If an IO error occurs
52 * @throws java.sql.SQLException If an SQL error occurs
53 * @throws java.lang.NoSuchMethodException If a method was not found
54 * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly
55 * @throws java.lang.reflect.InvocationTargetException If something else happens?
57 public Deque<Product> getAllProducts () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
60 * Some "getter" for a linked list of all categories
62 * @return All categories
63 * @throws java.io.IOException If an IO error occurs
64 * @throws java.sql.SQLException If an SQL error occurs
65 * @throws java.lang.NoSuchMethodException If a method was not found
66 * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly
67 * @throws java.lang.reflect.InvocationTargetException If something else happens?
69 public Deque<Category> getAllCategories () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
72 * Initializes this instance with given ServletContext
74 * @throws java.sql.SQLException If an SQL error occurs
75 * @throws java.io.IOException If an IO error occurs
77 public void init () throws SQLException, IOException;
80 * Some "getter" for a an array of only available products
82 * @return Only available products
83 * @throws java.io.IOException If an IO error occurs
84 * @throws java.sql.SQLException If an SQL error occurs
85 * @throws java.lang.NoSuchMethodException If a method was not found
86 * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly
87 * @throws java.lang.reflect.InvocationTargetException If something else happens?
89 public Iterator<Product> getAvailableProductsIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
92 * Some "getter" for a an array of all products
94 * @return All products
95 * @throws java.io.IOException If an IO error occurs
96 * @throws java.sql.SQLException If an SQL error occurs
97 * @throws java.lang.NoSuchMethodException If a method was not found
98 * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly
99 * @throws java.lang.reflect.InvocationTargetException If something else happens?
101 public Iterator<Product> getAllProductsIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
104 * Some "getter" for a an array of all categories
106 * @return All categories
107 * @throws java.io.IOException If an IO error occurs
108 * @throws java.sql.SQLException If an SQL error occurs
109 * @throws java.lang.NoSuchMethodException If a method was not found
110 * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly
111 * @throws java.lang.reflect.InvocationTargetException If something else happens?
113 public Iterator<Category> getAllCategoriesIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
116 * Generates a link for category's parent category. If none is given, the method will return only a small
119 * @param category Category instance
120 * @return HTML link for category's parent category
121 * @deprecated Old lost code
124 public String generateLinkForParent (final Category category);
127 * Checks if given Product instance is available and returns a printable
128 * (human-readable) string.
130 * @param product Product instance to check
131 * @return Human-readable version of product availability
132 * @deprecated Old lost code
135 public String getPrintableProductAvailability (final Product product);
138 * Returns a printable (human-readable) string of product's category
140 * @param product Product instance to check
141 * @return Human-readable version of product availability
142 * @throws java.io.IOException If an IO error occurs
143 * @throws java.sql.SQLException If an SQL error occurs
144 * @throws java.lang.NoSuchMethodException If a method was not found
145 * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly
146 * @throws java.lang.reflect.InvocationTargetException If something else happens?
147 * @deprecated Old lost code
150 public String getPrintableProductCategory (final Product product) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
153 * Adds given category data from request to database
155 * @param category Category instance
156 * @throws org.mxchange.jshop.exceptions.CategoryTitleAlreadyUsedException The category's title is already used
157 * @throws java.io.IOException If an IO error occurs
158 * @throws java.sql.SQLException If an SQL error occurs
159 * @throws java.lang.NoSuchMethodException If a method was not found
160 * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly
161 * @throws java.lang.reflect.InvocationTargetException If something else happens?
163 public void doAdminAddCategory (final Category category) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, CategoryTitleAlreadyUsedException;
166 * Adds given product data from request to database
168 * @param product Product instance
169 * @throws java.io.IOException If an IO error occurs
170 * @throws java.sql.SQLException If an SQL error occurs
171 * @throws java.lang.NoSuchMethodException If a method was not found
172 * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly
173 * @throws java.lang.reflect.InvocationTargetException If something else happens?
174 * @throws org.mxchange.jshop.exceptions.ProductTitleAlreadyUsedException If the product's title is already used
176 public void doAdminAddProduct (final Product product) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, ProductTitleAlreadyUsedException;
179 * Handles admin product form requests
181 * @throws java.io.IOException If an IO error occurs
182 * @throws java.sql.SQLException If an SQL error occurs
183 * @throws java.lang.NoSuchMethodException If a method was not found
184 * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly
185 * @throws java.lang.reflect.InvocationTargetException If something else happens?
186 * @throws org.mxchange.jshop.exceptions.ProductTitleAlreadyUsedException If the product's title is already used
187 * @deprecated Old lost code
190 public void doAdminHandleProductForms () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, ProductTitleAlreadyUsedException;
193 * Handles admin category form requests
195 * @throws java.io.IOException If an IO error occurs
196 * @throws java.sql.SQLException If an SQL error occurs
197 * @throws java.lang.NoSuchMethodException If a method was not found
198 * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly
199 * @throws java.lang.reflect.InvocationTargetException If something else happens?
200 * @throws org.mxchange.jshop.exceptions.CategoryTitleAlreadyUsedException The category's title is already used
204 public void doAdminHandleCategoryForms () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, CategoryTitleAlreadyUsedException;