]> git.mxchange.org Git - pizzaservice-swing.git/blob - src/org/mxchange/pizzaapplication/application/PizzaApplication.java
Initial import
[pizzaservice-swing.git] / src / org / mxchange / pizzaapplication / application / PizzaApplication.java
1 /*
2  * Copyright (C) 2015 Roland Haeder
3  *
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.
8  *
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.
13  *
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/>.
16  */
17 package org.mxchange.pizzaapplication.application;
18
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;
29
30 /**
31  *
32  * @author Roland Haeder
33  */
34 public interface PizzaApplication extends Application {
35         /**
36          * Some "getter" for a linked list of only available products
37          * 
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?
44          */
45         public Deque<Product> getAvailableProducts () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
46
47         /**
48          * Some "getter" for a linked list of all products
49          *
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?
56          */
57         public Deque<Product> getAllProducts () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
58
59         /**
60          * Some "getter" for a linked list of all categories
61          *
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?
68          */
69         public Deque<Category> getAllCategories () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
70
71         /**
72          * Initializes this instance with given ServletContext
73          *
74          * @throws java.sql.SQLException If an SQL error occurs
75          * @throws java.io.IOException If an IO error occurs
76          */
77         public void init () throws SQLException, IOException;
78
79         /**
80          * Some "getter" for a an array of only available products
81          * 
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?
88          */
89         public Iterator<Product> getAvailableProductsIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
90
91         /**
92          * Some "getter" for a an array of all products
93          *
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?
100          */
101         public Iterator<Product> getAllProductsIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
102
103         /**
104          * Some "getter" for a an array of all categories
105          *
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?
112          */
113         public Iterator<Category> getAllCategoriesIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
114
115         /**
116          * Generates a link for category's parent category. If none is given, the method will return only a small
117          * note.
118          *
119          * @param category Category instance
120          * @return HTML link for category's parent category
121          * @deprecated Old lost code
122          */
123         @Deprecated
124         public String generateLinkForParent (final Category category);
125
126         /**
127          * Checks if given Product instance is available and returns a printable
128          * (human-readable) string.
129          * 
130          * @param product Product instance to check
131          * @return Human-readable version of product availability
132          * @deprecated Old lost code
133          */
134         @Deprecated
135         public String getPrintableProductAvailability (final Product product);
136
137         /**
138          * Returns a printable (human-readable) string of product's category
139          * 
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
148          */
149         @Deprecated
150         public String getPrintableProductCategory (final Product product) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
151
152         /**
153          * Adds given category data from request to database
154          *
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?
162          */
163         public void doAdminAddCategory (final Category category) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, CategoryTitleAlreadyUsedException;
164
165         /**
166          * Adds given product data from request to database
167          *
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
175          */
176         public void doAdminAddProduct (final Product product) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, ProductTitleAlreadyUsedException;
177
178         /**
179          * Handles admin product form requests
180          *
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
188          */
189         @Deprecated
190         public void doAdminHandleProductForms () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, ProductTitleAlreadyUsedException;
191
192         /**
193          * Handles admin category form requests
194          * 
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
201          * @deprecated 
202          */
203         @Deprecated
204         public void doAdminHandleCategoryForms () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, CategoryTitleAlreadyUsedException;
205 }