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.jjobs.beans.login;
19 import java.io.Serializable;
20 import java.util.List;
21 import javax.ejb.Local;
22 import org.mxchange.jusercore.events.user.password_change.UpdatedUserPasswordEvent;
23 import org.mxchange.jusercore.model.user.User;
24 import org.mxchange.jusercore.model.user.password_history.PasswordHistory;
27 * An interface for registration web controllers
29 * @author Roland Haeder<roland@mxchange.org>
32 public interface JobsUserLoginWebSessionController extends Serializable {
35 * Method being call after user's password has been updated (and history
36 * entry has been created).
38 * @param event Event being observed
40 void afterUserUpdatedPasswordEvent (final UpdatedUserPasswordEvent event);
43 * Checks whether given clear-text password is in user's password history.
45 * @param userPassword Clear-text password
47 * @return Whether clear-text password is in user's password history
49 boolean isPasswordInHistory (final String userPassword);
52 * Getter for base template type
54 * @return Template type
56 String getBaseTemplatePathName ();
59 * Setter for base template type
61 * @param baseTemplatePathName Template type
63 void setBaseTemplatePathName (final String baseTemplatePathName);
66 * Logout for administrator area. If a logged-in user instance exists, it is
67 * being logged-out, too.
69 * @return Outcome (should be redirected)
71 String doAdminLogout ();
74 * Logins the user, if the account is found, confirmed and unlocked.
76 * @return Redirect target
78 String doUserLogin ();
81 * Logout for current user by invalidating the current session.
83 * @return Outcome (should be redirected)
85 String doUserLogout ();
88 * Getter for logged-in user instance
90 * @return Logged-in user instance
92 User getLoggedInUser ();
95 * Setter for logged-in user instance
97 * @param loggedInUser Logged-in user instance
99 void setLoggedInUser (final User loggedInUser);
102 * Checks whether the user is logged-in
104 * @return Whether the user is logged-in
106 boolean isUserLoggedIn ();
109 * Checks whether the user needs to change password
111 * @return Whether the user needs to change password
113 boolean ifUserMustChangePassword ();
116 * Whether the currently logged-in user is invisible
118 * @return Whether the currently logged-in user is invisible
120 boolean isInvisible ();
123 * Setter for current password (clear text)
125 * @param currentPassword Current password
127 void setCurrentPassword (final String currentPassword);
130 * Getter for current password (clear text)
132 * @return Current password
134 String getCurrentPassword ();
137 * Checks whether the (previously entered) current password matches with
138 * from the user instance.
140 * @return If current password matches
142 boolean ifCurrentPasswordMatches ();
145 * Getter for user's password history
147 * @return User's password history
149 List<PasswordHistory> getUserPasswordHistory ();