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 General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (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 General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package org.mxchange.jusercore.model.user;
19 import java.io.Serializable;
20 import javax.ejb.Remote;
21 import org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException;
22 import org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException;
23 import org.mxchange.jusercore.exceptions.UserNotFoundException;
24 import org.mxchange.jusercore.exceptions.UserStatusConfirmedException;
25 import org.mxchange.jusercore.exceptions.UserStatusLockedException;
26 import org.mxchange.jusercore.exceptions.UserStatusUnconfirmedException;
29 * An interface for administrative user beans
31 * @author Roland Häder<roland@mxchange.org>
34 public interface AdminUserSessionBeanRemote extends Serializable {
37 * Deletes given user instance
39 * @param user User instance to delete
40 * @param userDeleteReason Delete reason
42 * @throws UserNotFoundException If the user account is not found
44 void deleteUser (final User user, final String userDeleteReason) throws UserNotFoundException;
47 * Locks given user account with given reason
49 * @param user User account to be locked, must be status CONFIRMED
50 * @param userLockReason Lock reason
51 * @param baseUrl Base URL for all URLs
53 * @return Updated (and detached) user instance
55 * @throws UserStatusLockedException The account is already locked
56 * @throws UserStatusUnconfirmedException The account is not confirmed
57 * @throws UserNotFoundException The user account is not found
59 User lockUserAccount (final User user, final String userLockReason, final String baseUrl) throws UserStatusLockedException, UserStatusUnconfirmedException, UserNotFoundException;
62 * Unlocks given user account
64 * @param user User account to be unlocked, must be status LOCKED
65 * @param baseUrl Base URL for all URLs
67 * @return Updated (and detached) user instance
69 * @throws UserStatusConfirmedException The account is already locked
70 * @throws UserStatusUnconfirmedException The account is not confirmed
71 * @throws UserNotFoundException The user account is not found
73 User unlockUserAccount (final User user, final String baseUrl) throws UserStatusConfirmedException, UserStatusUnconfirmedException, UserNotFoundException;
76 * Creates the user instance and links it with the set contact instance
78 * @param user User instance to
80 * @return Updated user instance
82 * @throws UserNameAlreadyRegisteredException When the user name is already
84 * @throws EmailAddressAlreadyRegisteredException When the email address is
87 User linkUser (final User user) throws UserNameAlreadyRegisteredException, EmailAddressAlreadyRegisteredException;
90 * Adds given user to database, if not found by user name or email address.
92 * @param user User instance to add
94 * @return Updated user instance
96 * @throws UserNameAlreadyRegisteredException When the user name is already
98 * @throws EmailAddressAlreadyRegisteredException When the email address is
101 User addUser (final User user) throws UserNameAlreadyRegisteredException, EmailAddressAlreadyRegisteredException;