]> git.mxchange.org Git - pizzaservice-war.git/blob - src/java/org/mxchange/pizzaapplication/beans/controller/PizzaBean.java
Added old method back + marked some others as deprecated
[pizzaservice-war.git] / src / java / org / mxchange / pizzaapplication / beans / controller / PizzaBean.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.beans.controller;
18
19 import java.util.Deque;
20 import java.util.Iterator;
21 import javax.faces.FacesException;
22 import javax.servlet.ServletException;
23 import javax.servlet.ServletRequest;
24 import javax.servlet.http.HttpSession;
25 import org.mxchange.jshop.beans.FrameworkBean;
26 import org.mxchange.jshop.category.Category;
27 import org.mxchange.jshop.exceptions.CategoryTitleAlreadyUsedException;
28 import org.mxchange.jshop.exceptions.ProductTitleAlreadyUsedException;
29 import org.mxchange.jshop.item.AddableBasketItem;
30 import org.mxchange.jshop.product.Product;
31
32 /**
33  *
34  * @author Roland Haeder
35  */
36 public interface PizzaBean extends FrameworkBean {
37         /**
38          * Initializes this instance
39          * 
40          * @throws FacesException If something was wrong
41          */
42         public void init () throws FacesException;
43
44         /**
45          * Some "getter" for an iterator of only available products
46          * 
47          * @return Only available products
48          * @throws javax.servlet.ServletException If anything went wrong
49          */
50         public Iterator<Product> getAvailableProductsIterator () throws ServletException;
51
52         /**
53          * Some "getter" for an iterator of all products
54          *
55          * @return All products
56          * @throws javax.servlet.ServletException If anything went wrong
57          */
58         public Iterator<Product> getAllProductsIterator () throws ServletException;
59
60         /**
61          * Some "getter" for an iterator of all categories
62          *
63          * @return All categories
64          * @throws javax.servlet.ServletException If anything went wrong
65          */
66         public Iterator<Category> getAllCategoriesIterator () throws ServletException;
67
68         /**
69          * Some "getter" for a linked list of only available products
70          * 
71          * @return Only available products
72          * @throws javax.servlet.ServletException If anything went wrong
73          */
74         public Deque<Product> getAvailableProducts () throws ServletException;
75
76         /**
77          * Some "getter" for a linked list of all products
78          *
79          * @return All products
80          * @throws javax.servlet.ServletException If anything went wrong
81          */
82         public Deque<Product> getAllProducts () throws ServletException;
83
84         /**
85          * Some "getter" for a linked list of all categories
86          *
87          * @return All categories
88          * @throws javax.servlet.ServletException If anything went wrong
89          */
90         public Deque<Category> getAllCategories () throws ServletException;
91
92         /**
93          * Generates a link for category's parent category. If none is given, the method will return only a small
94          * note.
95          *
96          * @param category Category instance
97          * @return HTML link for category's parent category
98          * @deprecated Old lost code
99          */
100         @Deprecated
101         public String generateLinkForParent (final Category category);
102
103         /**
104          * Checks if given Product instance is available and returns a printable
105          * (human-readable) string.
106          * 
107          * @param product Product instance to check
108          * @return Human-readable version of product availability
109          * @deprecated Old lost code
110          */
111         @Deprecated
112         public String getPrintableProduktAvailability (final Product product);
113
114         /**
115          * Returns a printable (human-readable) string of product's category
116          * 
117          * @param product Product instance to check
118          * @return Human-readable version of product availability
119          * @throws javax.servlet.ServletException If something unexpected happened
120          * @deprecated Old lost code
121          */
122         @Deprecated
123         public String getPrintableProduktCategory (final Product product) throws ServletException;
124
125         /**
126          * Adds given category data from request to database
127          *
128          * @param request Request instance
129          * @throws javax.servlet.ServletException If something unexpected happened
130          * @throws org.mxchange.jshop.exceptions.CategoryTitleAlreadyUsedException If the given title is already used
131          */
132         public void doAdminAddCategory (final ServletRequest request) throws ServletException, CategoryTitleAlreadyUsedException;
133
134         /**
135          * Adds given product data from request to database
136          *
137          * @param request Request instance
138          * @throws javax.servlet.ServletException If something unexpected happened
139          * @throws org.mxchange.jshop.exceptions.ProductTitleAlreadyUsedException If the given product title is already used
140          */
141         public void doAdminAddProduct (final ServletRequest request) throws ServletException, ProductTitleAlreadyUsedException;
142
143         /**
144          * Handles admin product form requests
145          *
146          * @throws ServletException If something unexpected happened
147          */
148         public void doAdminHandleProductForms () throws ServletException;
149
150         /**
151          * Handles admin category form requests
152          * 
153          * @throws ServletException If something unexpected happened
154          */
155         public void doAdminHandleCategoryForms () throws ServletException;
156
157         /**
158          * Some "getter" for a product from given item
159          * @param item Item instance
160          * @return A Product instance
161          * @throws javax.servlet.ServletException If something bad happens
162          */
163         public Product getProduct (final AddableBasketItem item) throws ServletException;
164 }