2 * Copyright (C) 2016 - 2020 Free Software Foundation
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.jfinancials.beans.user.list;
19 import java.io.Serializable;
20 import java.util.List;
21 import org.mxchange.jusercore.exceptions.UserEmailAddressNotFoundException;
22 import org.mxchange.jusercore.exceptions.UserNotFoundException;
23 import org.mxchange.jusercore.model.user.User;
26 * An interface for user beans
28 * @author Roland Häder<roland@mxchange.org>
30 public interface FinancialsUserListWebViewController extends Serializable {
33 * Returns a user instance by given primary key. If not found, a proper
34 * exception is thrown.
36 * @param userId User id
38 * @return User instance
40 * @throws UserNotFoundException If the user is not found
42 User findUserById (final Long userId) throws UserNotFoundException;
47 * @return A list of all public user profiles
49 List<User> getAllUsers ();
52 * Checks if given user id exists
54 * @param userId User id to check
56 * @return Whether the user id exists
58 boolean ifUserIdExists (final Long userId);
61 * Checks whether given user instance name is used
63 * @param user User instance name to check
65 * @return Whether it is already used
67 boolean isUserNameRegistered (final User user);
70 * Tries to lookup user by given id number. If the user is not found or the
71 * account status is not CONFIRMED proper exceptions are thrown.
73 * @param userId User id
75 * @return User instance
77 * @throws UserNotFoundException If the user is not found
79 User lookupUserById (final Long userId) throws UserNotFoundException;
82 * Tries to lookup user by given email address. If the user is not found a
83 * proper exceptions is thrown.
85 * @param emailAddress Email address
87 * @return User instance
89 * @throws UserEmailAddressNotFoundException If the user's email address is
92 User lookupUserByEmailAddress (final String emailAddress) throws UserEmailAddressNotFoundException;