]> git.mxchange.org Git - pizzaservice-war.git/blob - src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionController.java
Added redirect outcome + updated jar(s)
[pizzaservice-war.git] / src / java / org / mxchange / pizzaapplication / beans / user / PizzaUserWebSessionController.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.login.UserLoggedInEvent;
22 import org.mxchange.jusercore.events.registration.UserRegisteredEvent;
23 import org.mxchange.jusercore.exceptions.UserNotFoundException;
24 import org.mxchange.jusercore.model.user.User;
25 import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
26
27 /**
28  * An interface for user beans
29  * <p>
30  * @author Roland Haeder<roland@mxchange.org>
31  */
32 public interface PizzaUserWebSessionController extends Serializable {
33
34         /**
35          * Minimum password length
36          */
37         public static final Integer MINIMUM_PASSWORD_LENGTH = 5;
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          * Event observer for new user registrations
53          * <p>
54          * @param event User registration event
55          */
56         void afterRegistrationEvent (final UserRegisteredEvent event);
57
58         /**
59          * Event observer for logged-in user
60          * <p>
61          * @param event Event instance
62          */
63         void afterUserLogin (final UserLoggedInEvent event);
64
65         /**
66          * All public user profiles
67          * <p>
68          * @return A list of all public user profiles
69          */
70         List<User> allVisibleUsers ();
71
72         /**
73          * Creates an instance from all properties
74          * <p>
75          * @return A user instance
76          */
77         User createUserInstance ();
78
79         /**
80          * Getter for user id
81          * <p>
82          * @return User id
83          */
84         Long getUserId ();
85
86         /**
87          * Setter for user id
88          * <p>
89          * @param userId User id
90          */
91         void setUserId (final Long userId);
92
93         /**
94          * Getter for user name
95          * <p>
96          * @return User name
97          */
98         String getUserName ();
99
100         /**
101          * Setter for user name
102          * <p>
103          * @param userName User name
104          */
105         void setUserName (final String userName);
106
107         /**
108          * Getter for unencrypted user password
109          * <p>
110          * @return Unencrypted user password
111          */
112         String getUserPassword ();
113
114         /**
115          * Setter for unencrypted user password
116          * <p>
117          * @param userPassword Unencrypted user password
118          */
119         void setUserPassword (final String userPassword);
120
121         /**
122          * Getter for unencrypted user password repeated
123          * <p>
124          * @return Unencrypted user password repeated
125          */
126         String getUserPasswordRepeat ();
127
128         /**
129          * Setter for unencrypted user password repeated
130          * <p>
131          * @param userPasswordRepeat Unencrypted user password repeated
132          */
133         void setUserPasswordRepeat (final String userPasswordRepeat);
134
135         /**
136          * Getter for user profile mode
137          * <p>
138          * @return User profile mode
139          */
140         ProfileMode getUserProfileMode ();
141
142         /**
143          * Setter for user profile mode
144          * <p>
145          * @param userProfileMode User profile mode
146          */
147         void setUserProfileMode (final ProfileMode userProfileMode);
148
149         /**
150          * Checks whether all required personal data is set
151          * <p>
152          * @return Whether the required personal data is set
153          */
154         boolean isRequiredPersonalDataSet ();
155
156         /**
157          * Checks whether all required personal data is set for changing them
158          * <p>
159          * @return Whether the required personal data is set
160          */
161         boolean isRequiredChangePersonalDataSet ();
162
163         /**
164          * Checks whether same passwords has been entered
165          * <p>
166          * @return Whether same passwords has been entered
167          */
168         boolean isSamePasswordEntered ();
169
170         /**
171          * Checks whether given user instance's name is used
172          * <p>
173          * @param user User instance's name to check
174          * <p>
175          * @return Whether it is already used
176          */
177         boolean isUserNameRegistered (final User user);
178
179         /**
180          * Checks whether a public user account is registered. This means that at
181          * least one user profile has its flag "public user profile" enabled.
182          * <p>
183          * @return Whether at least one user has a public profile
184          */
185         boolean isVisibleUserFound ();
186
187         /**
188          * Checks if the user id is empty
189          * <p>
190          * @return Whether the user id is empty
191          */
192         boolean isUserIdEmpty ();
193
194         /**
195          * Changes logged-in user's personal data if the current password matches
196          * and TAC + privacy statement has been accepted.
197          * <p>
198          * @return New target page
199          */
200         String doChangePersonalData ();
201
202 }