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