2 * Copyright (C) 2016 Roland Haeder
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.
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.
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/>.
17 package org.mxchange.jjobs.beans.user;
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;
27 * An interface for user beans
29 * @author Roland Haeder<roland@mxchange.org>
31 public interface JobsAdminUserWebRequestController extends Serializable {
34 * Listens to fired event when user updated personal data
36 * @param event Event being fired
38 void afterUserUpdatedPersonalData (final UpdatedUserPersonalDataEvent event);
41 * Checks whether the given contact is a user
43 * @param contact Contact to check
45 * @return Whether the contact is a user
47 boolean isContactFound (final Contact contact);
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.
53 * @param userId User id
55 * @return User instance
57 * @throws UserNotFoundException If the user is not found
59 User lookupUserById (final Long userId) throws UserNotFoundException;
64 * @return A list of all public user profiles
66 List<User> allUsers ();
69 * Checks whether users are registered
71 * @return Whether users are registered
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.
80 * @return Redirect outcome
85 * Edits cuirrently loaded user's data in database.
87 * @return Redirect outcome
89 String editUserData ();
92 * Getter for user name
96 String getUserName ();
99 * Setter for user name
101 * @param userName User name
103 void setUserName (final String userName);
106 * Getter for unencrypted user password
108 * @return Unencrypted user password
110 String getUserPassword ();
113 * Setter for unencrypted user password
115 * @param userPassword Unencrypted user password
117 void setUserPassword (final String userPassword);
120 * Getter for unencrypted user password repeated
122 * @return Unencrypted user password repeated
124 String getUserPasswordRepeat ();
127 * Setter for unencrypted user password repeated
129 * @param userPasswordRepeat Unencrypted user password repeated
131 void setUserPasswordRepeat (final String userPasswordRepeat);