]> git.mxchange.org Git - jjobs-war.git/blob - src/java/org/mxchange/jjobs/beans/login/JobsUserLoginWebSessionController.java
Please cherry-pick:
[jjobs-war.git] / src / java / org / mxchange / jjobs / beans / login / JobsUserLoginWebSessionController.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.jjobs.beans.login;
18
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;
25
26 /**
27  * An interface for registration web controllers
28  * <p>
29  * @author Roland Haeder<roland@mxchange.org>
30  */
31 @Local
32 public interface JobsUserLoginWebSessionController extends Serializable {
33
34         /**
35          * Method being call after user's password has been updated (and history
36          * entry has been created).
37          * <p>
38          * @param event Event being observed
39          */
40         void afterUserUpdatedPasswordEvent (final UpdatedUserPasswordEvent event);
41
42         /**
43          * Checks whether given clear-text password is in user's password history.
44          * <p>
45          * @param userPassword Clear-text password
46          * <p>
47          * @return Whether clear-text password is in user's password history
48          */
49         boolean isPasswordInHistory (final String userPassword);
50
51         /**
52          * Getter for base template type
53          * <p>
54          * @return Template type
55          */
56         String getBaseTemplatePathName ();
57
58         /**
59          * Setter for base template type
60          * <p>
61          * @param baseTemplatePathName Template type
62          */
63         void setBaseTemplatePathName (final String baseTemplatePathName);
64
65         /**
66          * Logout for administrator area. If a logged-in user instance exists, it is
67          * being logged-out, too.
68          * <p>
69          * @return Outcome (should be redirected)
70          */
71         String doAdminLogout ();
72
73         /**
74          * Logins the user, if the account is found, confirmed and unlocked.
75          * <p>
76          * @return Redirect target
77          */
78         String doUserLogin ();
79
80         /**
81          * Logout for current user by invalidating the current session.
82          * <p>
83          * @return Outcome (should be redirected)
84          */
85         String doUserLogout ();
86
87         /**
88          * Getter for logged-in user instance
89          * <p>
90          * @return Logged-in user instance
91          */
92         User getLoggedInUser ();
93
94         /**
95          * Setter for logged-in user instance
96          * <p>
97          * @param loggedInUser Logged-in user instance
98          */
99         void setLoggedInUser (final User loggedInUser);
100
101         /**
102          * Checks whether the user is logged-in
103          * <p>
104          * @return Whether the user is logged-in
105          */
106         boolean isUserLoggedIn ();
107
108         /**
109          * Checks whether the user needs to change password
110          * <p>
111          * @return Whether the user needs to change password
112          */
113         boolean ifUserMustChangePassword ();
114
115         /**
116          * Whether the currently logged-in user is invisible
117          * <p>
118          * @return Whether the currently logged-in user is invisible
119          */
120         boolean isInvisible ();
121
122         /**
123          * Setter for current password (clear text)
124          * <p>
125          * @param currentPassword Current password
126          */
127         void setCurrentPassword (final String currentPassword);
128
129         /**
130          * Getter for current password (clear text)
131          * <p>
132          * @return Current password
133          */
134         String getCurrentPassword ();
135
136         /**
137          * Checks whether the (previously entered) current password matches with
138          * from the user instance.
139          * <p>
140          * @return If current password matches
141          */
142         boolean ifCurrentPasswordMatches ();
143
144         /**
145          * Getter for user's password history
146          * <p>
147          * @return User's password history
148          */
149         List<PasswordHistory> getUserPasswordHistory ();
150
151 }