]> git.mxchange.org Git - jjobs-war.git/blob - src/java/org/mxchange/jjobs/beans/login/JobsUserLoginWebSessionController.java
Continued a bit: (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.model.user.User;
23 import org.mxchange.jusercore.model.user.password_history.PasswordHistory;
24
25 /**
26  * An interface for registration web controllers
27  * <p>
28  * @author Roland Haeder<roland@mxchange.org>
29  */
30 @Local
31 public interface JobsUserLoginWebSessionController extends Serializable {
32
33         /**
34          * Getter for template type
35          * <p>
36          * @return Template type
37          */
38         String getTemplateType ();
39
40         /**
41          * Setter for template type
42          * <p>
43          * @param templateType Template type
44          */
45         void setTemplateType (final String templateType);
46
47         /**
48          * Logins the user, if the account is found, confirmed and unlocked.
49          * <p>
50          * @return Redirect target
51          */
52         String doLogin ();
53
54         /**
55          * Getter for logged-in user instance
56          * <p>
57          * @return Logged-in user instance
58          */
59         User getLoggedInUser ();
60
61         /**
62          * Setter for logged-in user instance
63          * <p>
64          * @param loggedInUser Logged-in user instance
65          */
66         void setLoggedInUser (final User loggedInUser);
67
68         /**
69          * Checks whether the user is logged-in
70          * <p>
71          * @return Whether the user is logged-in
72          */
73         boolean isUserLoggedIn ();
74
75         /**
76          * Checks whether the user needs to change password
77          * <p>
78          * @return Whether the user needs to change password
79          */
80         boolean ifUserMustChangePassword ();
81
82         /**
83          * Whether the currently logged-in user is invisible
84          * <p>
85          * @return Whether the currently logged-in user is invisible
86          */
87         boolean isInvisible ();
88
89         /**
90          * Setter for current password (clear text)
91          * <p>
92          * @param currentPassword Current password
93          */
94         void setCurrentPassword (final String currentPassword);
95
96         /**
97          * Getter for current password (clear text)
98          * <p>
99          * @return Current password
100          */
101         String getCurrentPassword ();
102
103         /**
104          * Checks whether the (previously entered) current password matches with
105          * from the user instance.
106          * <p>
107          * @return If current password matches
108          */
109         boolean ifCurrentPasswordMatches ();
110
111         /**
112          * Getter for user's password history
113          * <p>
114          * @return User's password history
115          */
116         List<PasswordHistory> getUserPasswordHistory ();
117
118 }