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