]> git.mxchange.org Git - pizzaservice-war.git/blob - src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestController.java
9d787b11ed074ba7443521c82d07f1d67dad6a9b
[pizzaservice-war.git] / src / java / org / mxchange / pizzaapplication / beans / user / PizzaAdminUserWebRequestController.java
1 /*
2  * Copyright (C) 2016 Roland Haeder
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Affero General Public License as
6  * published by the Free Software Foundation, either version 3 of the
7  * License, or (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 Affero General Public License for more details.
13  *
14  * You should have received a copy of the GNU Affero General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17 package org.mxchange.pizzaapplication.beans.user;
18
19 import java.io.Serializable;
20 import java.util.List;
21 import org.mxchange.jusercore.events.user.update.UpdatedUserPersonalDataEvent;
22 import org.mxchange.jusercore.exceptions.UserNotFoundException;
23 import org.mxchange.jusercore.model.user.User;
24
25 /**
26  * An interface for user beans
27  * <p>
28  * @author Roland Haeder<roland@mxchange.org>
29  */
30 public interface PizzaAdminUserWebRequestController extends Serializable {
31
32         /**
33          * Listens to fired event when user updated personal data
34          * <p>
35          * @param event Event being fired
36          */
37         void afterUserUpdatedPersonalData (final UpdatedUserPersonalDataEvent event);
38
39         /**
40          * Tries to lookup user by given id number. If the user is not found or the
41          * account status is not CONFIRMED proper exceptions are thrown.
42          * <p>
43          * @param userId User id
44          * <p>
45          * @return User instance
46          * <p>
47          * @throws UserNotFoundException If the user is not found
48          */
49         User lookupUserById (final Long userId) throws UserNotFoundException;
50
51         /**
52          * All users
53          * <p>
54          * @return A list of all public user profiles
55          */
56         List<User> allUsers ();
57
58         /**
59          * Checks whether users are registered
60          * <p>
61          * @return Whether users are registered
62          */
63         boolean hasUsers ();
64
65         /**
66          * Adds user instance to database by preparing a complete user instance and
67          * sending it to the EJB. The data set in the controller is being verified,
68          * e.g. if the user name or email address is not used yet.
69          * <p>
70          * @return Redirect outcome
71          */
72         String addUser ();
73
74         /**
75          * Edits cuirrently loaded user's data in database.
76          * <p>
77          * @return Redirect outcome
78          */
79         String changeUserData ();
80
81         /**
82          * Getter for user name
83          * <p>
84          * @return User name
85          */
86         String getUserName ();
87
88         /**
89          * Setter for user name
90          * <p>
91          * @param userName User name
92          */
93         void setUserName (final String userName);
94
95         /**
96          * Getter for unencrypted user password
97          * <p>
98          * @return Unencrypted user password
99          */
100         String getUserPassword ();
101
102         /**
103          * Setter for unencrypted user password
104          * <p>
105          * @param userPassword Unencrypted user password
106          */
107         void setUserPassword (final String userPassword);
108
109         /**
110          * Getter for unencrypted user password repeated
111          * <p>
112          * @return Unencrypted user password repeated
113          */
114         String getUserPasswordRepeat ();
115
116         /**
117          * Setter for unencrypted user password repeated
118          * <p>
119          * @param userPasswordRepeat Unencrypted user password repeated
120          */
121         void setUserPasswordRepeat (final String userPasswordRepeat);
122
123 }