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