]> git.mxchange.org Git - pizzaservice-swing.git/blob - src/org/mxchange/pizzaapplication/application/PizzaApplication.java
Updated author (email address) + jars + implemented very basic basket
[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.sql.SQLException;
21 import java.util.Deque;
22 import java.util.Iterator;
23 import org.mxchange.jcore.application.Application;
24 import org.mxchange.jshopcore.exceptions.CategoryTitleAlreadyUsedException;
25 import org.mxchange.jshopcore.exceptions.ProductTitleAlreadyUsedException;
26 import org.mxchange.jshopcore.model.category.Category;
27 import org.mxchange.jshopcore.model.product.Product;
28
29 /**
30  *
31  * @author Roland Haeder<roland@mxchange.org>
32  */
33 public interface PizzaApplication extends Application {
34         /**
35          * Some "getter" for a linked list of only available products
36          * 
37          * @return Only available products
38          */
39         public Deque<Product> getAvailableProducts ();
40
41         /**
42          * Some "getter" for a linked list of all products
43          *
44          * @return All products
45          */
46         public Deque<Product> getAllProducts ();
47
48         /**
49          * Some "getter" for a linked list of all categories
50          *
51          * @return All categories
52          */
53         public Deque<Category> getAllCategories ();
54
55         /**
56          * Initializes this instance with given ServletContext
57          *
58          * @throws java.sql.SQLException If an SQL error occurs
59          * @throws java.io.IOException If an IO error occurs
60          */
61         public void init () throws SQLException, IOException;
62
63         /**
64          * Some "getter" for a an array of only available products
65          * 
66          * @return Only available products
67          */
68         public Iterator<Product> getAvailableProductsIterator ();
69
70         /**
71          * Some "getter" for a an array of all products
72          *
73          * @return All products
74          */
75         public Iterator<Product> getAllProductsIterator ();
76
77         /**
78          * Some "getter" for a an array of all categories
79          *
80          * @return All categories
81          */
82         public Iterator<Category> getAllCategoriesIterator ();
83
84         /**
85          * Adds given category data from request to database
86          *
87          * @param category Category instance
88          * @throws org.mxchange.jshopcore.exceptions.CategoryTitleAlreadyUsedException If the category's title has been used
89          */
90         public void doAdminAddCategory (final Category category) throws CategoryTitleAlreadyUsedException;
91
92         /**
93          * Adds given product data from request to database
94          *
95          * @param product Product instance
96          * @throws org.mxchange.jshopcore.exceptions.ProductTitleAlreadyUsedException If the product's title has been used
97          */
98         public void doAdminAddProduct (final Product product) throws ProductTitleAlreadyUsedException;
99 }