]> git.mxchange.org Git - jjobs-war.git/blob - src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestController.java
Contiuned with editing user data/rewrites:
[jjobs-war.git] / src / java / org / mxchange / jjobs / beans / user / JobsAdminUserWebRequestController.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.user;
18
19 import java.io.Serializable;
20 import java.util.List;
21 import org.mxchange.jusercore.events.user.update.UpdatedUserPersonalDataEvent;
22 import org.mxchange.jusercore.exceptions.UserNotFoundException;
23 import org.mxchange.jusercore.model.user.User;
24
25 /**
26  * An interface for user beans
27  * <p>
28  * @author Roland Haeder<roland@mxchange.org>
29  */
30 public interface JobsAdminUserWebRequestController extends Serializable {
31
32         /**
33          * Listens to fired event when user updated personal data
34          * <p>
35          * @param event Event being fired
36          */
37         void afterUserUpdatedPersonalData (final UpdatedUserPersonalDataEvent event);
38
39         /**
40          * Tries to lookup user by given id number. If the user is not found or the
41          * account status is not CONFIRMED proper exceptions are thrown.
42          * <p>
43          * @param userId User id
44          * <p>
45          * @return User instance
46          * <p>
47          * @throws UserNotFoundException If the user is not found
48          */
49         User lookupUserById (final Long userId) throws UserNotFoundException;
50
51         /**
52          * All users
53          * <p>
54          * @return A list of all public user profiles
55          */
56         List<User> allUsers ();
57
58         /**
59          * Checks whether users are registered
60          * <p>
61          * @return Whether users are registered
62          */
63         boolean hasUsers ();
64
65         /**
66          * Adds user instance to database by preparing a complete user instance and
67          * sending it to the EJB. The data set in the controller is being verified,
68          * e.g. if the user name or email address is not used yet.
69          */
70         void addUser ();
71
72         /**
73          * Edits cuirrently loaded user's data in database.
74          */
75         void editUserData();
76
77         /**
78          * Getter for user name
79          * <p>
80          * @return User name
81          */
82         String getUserName ();
83
84         /**
85          * Setter for user name
86          * <p>
87          * @param userName User name
88          */
89         void setUserName (final String userName);
90
91         /**
92          * Getter for unencrypted user password
93          * <p>
94          * @return Unencrypted user password
95          */
96         String getUserPassword ();
97
98         /**
99          * Setter for unencrypted user password
100          * <p>
101          * @param userPassword Unencrypted user password
102          */
103         void setUserPassword (final String userPassword);
104
105         /**
106          * Getter for unencrypted user password repeated
107          * <p>
108          * @return Unencrypted user password repeated
109          */
110         String getUserPasswordRepeat ();
111
112         /**
113          * Setter for unencrypted user password repeated
114          * <p>
115          * @param userPasswordRepeat Unencrypted user password repeated
116          */
117         void setUserPasswordRepeat (final String userPasswordRepeat);
118
119 }