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.addressbook.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 AddressbookAdminUserWebRequestController 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 * All public user profiles
43 * @return A list of all public user profiles
45 List<User> allVisibleUsers ();
48 * Returns a list of all selectable contacts for user creation. Contacts
49 * from already existing users are excluded in this list.
51 * @return A list of all selectable contacts
53 List<Contact> selectableContacts ();
56 * Updates list with given user
58 * @param user User to update
60 void updateList (final User user);
63 * Checks whether the given contact is a user
65 * @param contact Contact to check
67 * @return Whether the contact is a user
69 boolean isContactFound (final Contact contact);
72 * Checks whether a public user account is registered. This means that at
73 * least one user profile has its flag "public user profile" enabled.
75 * @return Whether at least one user has a public profile
77 boolean isVisibleUserFound ();
80 * Checks whether given user instance's name is used
82 * @param user User instance's name to check
84 * @return Whether it is already used
86 boolean isUserNameRegistered (final User user);
89 * Tries to lookup user by given id number. If the user is not found or the
90 * account status is not CONFIRMED proper exceptions are thrown.
92 * @param userId User id
94 * @return User instance
96 * @throws UserNotFoundException If the user is not found
98 User lookupUserById (final Long userId) throws UserNotFoundException;
103 * @return A list of all public user profiles
105 List<User> allUsers ();
108 * Checks whether users are registered
110 * @return Whether users are registered
115 * Adds user instance to database by preparing a complete user instance and
116 * sending it to the EJB. The data set in the controller is being verified,
117 * e.g. if the user name or email address is not used yet.
119 * @return Redirect outcome
124 * Edits cuirrently loaded user's data in database.
126 * @return Redirect outcome
128 String editUserData ();
131 * Getter for user name
135 String getUserName ();
138 * Setter for user name
140 * @param userName User name
142 void setUserName (final String userName);
145 * Getter for unencrypted user password
147 * @return Unencrypted user password
149 String getUserPassword ();
152 * Setter for unencrypted user password
154 * @param userPassword Unencrypted user password
156 void setUserPassword (final String userPassword);
159 * Getter for unencrypted user password repeated
161 * @return Unencrypted user password repeated
163 String getUserPasswordRepeat ();
166 * Setter for unencrypted user password repeated
168 * @param userPasswordRepeat Unencrypted user password repeated
170 void setUserPasswordRepeat (final String userPasswordRepeat);