2 * Copyright (C) 2016, 2017 Roland Häder
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.pizzaapplication.beans.user.login;
19 import java.io.Serializable;
20 import java.util.List;
21 import javax.ejb.Local;
22 import org.mxchange.jusercore.model.user.User;
23 import org.mxchange.jusercore.model.user.password_history.PasswordHistory;
26 * An interface for registration web controllers
28 * @author Roland Häder<roland@mxchange.org>
31 public interface PizzaUserLoginWebSessionController extends Serializable {
34 * Checks whether given clear-text password is in user's password history.
36 * @param userPassword Clear-text password
38 * @return Whether clear-text password is in user's password history
40 boolean isPasswordInHistory (final String userPassword);
43 * Getter for base template type
45 * @return Template type
47 String getBaseTemplatePathName ();
50 * Setter for base template type
52 * @param baseTemplatePathName Template type
54 void setBaseTemplatePathName (final String baseTemplatePathName);
57 * Logout for administrator area. If a logged-in user instance exists, it is
58 * being logged-out, too.
60 * @return Outcome (should be redirected)
62 String doAdminLogout ();
65 * Logins the user, if the account is found, confirmed and unlocked.
67 * @return Redirect target
69 String doUserLogin ();
72 * Logout for current user by invalidating the current session.
74 * @return Outcome (should be redirected)
76 String doUserLogout ();
79 * Getter for logged-in user instance
81 * @return Logged-in user instance
83 User getLoggedInUser ();
86 * Setter for logged-in user instance
88 * @param loggedInUser Logged-in user instance
90 void setLoggedInUser (final User loggedInUser);
93 * Checks whether the user is logged-in
95 * @return Whether the user is logged-in
97 boolean isUserLoggedIn ();
100 * Checks whether the user needs to change password
102 * @return Whether the user needs to change password
104 boolean ifUserMustChangePassword ();
107 * Whether the currently logged-in user is invisible
109 * @return Whether the currently logged-in user is invisible
111 boolean isInvisible ();
114 * Setter for current password (clear text)
116 * @param userCurrentPassword Current password
118 void setUserCurrentPassword (final String userCurrentPassword);
121 * Getter for current password (clear text)
123 * @return Current password
125 String getUserCurrentPassword ();
128 * Checks whether the (previously entered) current password matches with
129 * from the user instance.
131 * @return If current password matches
133 boolean ifCurrentPasswordMatches ();
136 * Getter for user's password history
138 * @return User's password history
140 List<PasswordHistory> getUserPasswordHistory ();