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