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