2 * Copyright (C) 2016 Roland Haeder
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.
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.
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/>.
17 package org.mxchange.addressbook.beans.user;
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;
26 * An interface for user beans
28 * @author Roland Haeder<roland@mxchange.org>
30 public interface AddressbookUserWebSessionController extends Serializable {
33 * Minimum password length
35 public static final Integer MINIMUM_PASSWORD_LENGTH = 5;
38 * Event observer for new user registrations
40 * @param event User registration event
42 void afterRegistrationEvent (final UserRegisteredEvent event);
45 * Event observer for logged-in user
47 * @param event Event instance
49 void afterUserLogin (final UserLoggedInEvent event);
52 * Creates an instance from all properties
54 * @return A user instance
56 User createUserInstance ();
68 * @param userId User id
70 void setUserId (final Long userId);
73 * Getter for user name
77 String getUserName ();
80 * Setter for user name
82 * @param userName User name
84 void setUserName (final String userName);
87 * Getter for unencrypted user password
89 * @return Unencrypted user password
91 String getUserPassword ();
94 * Setter for unencrypted user password
96 * @param userPassword Unencrypted user password
98 void setUserPassword (final String userPassword);
101 * Getter for unencrypted user password repeated
103 * @return Unencrypted user password repeated
105 String getUserPasswordRepeat ();
108 * Setter for unencrypted user password repeated
110 * @param userPasswordRepeat Unencrypted user password repeated
112 void setUserPasswordRepeat (final String userPasswordRepeat);
115 * Getter for user profile mode
117 * @return User profile mode
119 ProfileMode getUserProfileMode ();
122 * Setter for user profile mode
124 * @param userProfileMode User profile mode
126 void setUserProfileMode (final ProfileMode userProfileMode);
129 * Checks whether all required personal data is set
131 * @return Whether the required personal data is set
133 boolean isRequiredPersonalDataSet ();
136 * Checks whether all required personal data is set for changing them
138 * @return Whether the required personal data is set
140 boolean isRequiredChangePersonalDataSet ();
143 * Checks whether same passwords has been entered
145 * @return Whether same passwords has been entered
147 boolean isSamePasswordEntered ();
150 * Checks if the user id is empty
152 * @return Whether the user id is empty
154 boolean isUserIdEmpty ();
157 * Changes logged-in user's personal data if the current password matches
158 * and TAC + privacy statement has been accepted.
160 * @return New target page
162 String doChangePersonalData ();