]> git.mxchange.org Git - pizzaservice-war.git/blob - src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionController.java
Cleanups:
[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 org.mxchange.jusercore.events.login.UserLoggedInEvent;
21 import org.mxchange.jusercore.events.registration.UserRegisteredEvent;
22 import org.mxchange.jusercore.model.user.User;
23 import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
24
25 /**
26  * An interface for user beans
27  * <p>
28  * @author Roland Haeder<roland@mxchange.org>
29  */
30 public interface PizzaUserWebSessionController extends Serializable {
31
32         /**
33          * Minimum password length
34          */
35         public static final Integer MINIMUM_PASSWORD_LENGTH = 5;
36
37         /**
38          * Event observer for new user registrations
39          * <p>
40          * @param event User registration event
41          */
42         void afterRegistrationEvent (final UserRegisteredEvent event);
43
44         /**
45          * Event observer for logged-in user
46          * <p>
47          * @param event Event instance
48          */
49         void afterUserLogin (final UserLoggedInEvent event);
50
51         /**
52          * Creates an instance from all properties
53          * <p>
54          * @return A user instance
55          */
56         User createUserInstance ();
57
58         /**
59          * Getter for user id
60          * <p>
61          * @return User id
62          */
63         Long getUserId ();
64
65         /**
66          * Setter for user id
67          * <p>
68          * @param userId User id
69          */
70         void setUserId (final Long userId);
71
72         /**
73          * Getter for user name
74          * <p>
75          * @return User name
76          */
77         String getUserName ();
78
79         /**
80          * Setter for user name
81          * <p>
82          * @param userName User name
83          */
84         void setUserName (final String userName);
85
86         /**
87          * Getter for unencrypted user password
88          * <p>
89          * @return Unencrypted user password
90          */
91         String getUserPassword ();
92
93         /**
94          * Setter for unencrypted user password
95          * <p>
96          * @param userPassword Unencrypted user password
97          */
98         void setUserPassword (final String userPassword);
99
100         /**
101          * Getter for unencrypted user password repeated
102          * <p>
103          * @return Unencrypted user password repeated
104          */
105         String getUserPasswordRepeat ();
106
107         /**
108          * Setter for unencrypted user password repeated
109          * <p>
110          * @param userPasswordRepeat Unencrypted user password repeated
111          */
112         void setUserPasswordRepeat (final String userPasswordRepeat);
113
114         /**
115          * Getter for user profile mode
116          * <p>
117          * @return User profile mode
118          */
119         ProfileMode getUserProfileMode ();
120
121         /**
122          * Setter for user profile mode
123          * <p>
124          * @param userProfileMode User profile mode
125          */
126         void setUserProfileMode (final ProfileMode userProfileMode);
127
128         /**
129          * Checks whether all required personal data is set
130          * <p>
131          * @return Whether the required personal data is set
132          */
133         boolean isRequiredPersonalDataSet ();
134
135         /**
136          * Checks whether all required personal data is set for changing them
137          * <p>
138          * @return Whether the required personal data is set
139          */
140         boolean isRequiredChangePersonalDataSet ();
141
142         /**
143          * Checks whether same passwords has been entered
144          * <p>
145          * @return Whether same passwords has been entered
146          */
147         boolean isSamePasswordEntered ();
148
149         /**
150          * Checks if the user id is empty
151          * <p>
152          * @return Whether the user id is empty
153          */
154         boolean isUserIdEmpty ();
155
156         /**
157          * Changes logged-in user's personal data if the current password matches
158          * and TAC + privacy statement has been accepted.
159          * <p>
160          * @return New target page
161          */
162         String doChangePersonalData ();
163
164 }