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 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 Haeder<roland@mxchange.org>
34 public interface AdminUserSessionBeanRemote extends Serializable {
37 * Locks given user account with given reason
39 * @param user User account to be locked, must be status CONFIRMED
40 * @param userLockReason Lock reason
41 * @param baseUrl Base URL for all URLs
43 * @return Updated (and detached) user instance
45 * @throws UserStatusLockedException The account is already locked
46 * @throws UserStatusUnconfirmedException The account is not confirmed
47 * @throws UserNotFoundException The user account is not found
49 User lockUserAccount (final User user, final String userLockReason, final String baseUrl) throws UserStatusLockedException, UserStatusUnconfirmedException, UserNotFoundException;
52 * Unlocks given user account
54 * @param user User account to be unlocked, must be status LOCKED
55 * @param baseUrl Base URL for all URLs
57 * @return Updated (and detached) user instance
59 * @throws UserStatusConfirmedException The account is already locked
60 * @throws UserStatusUnconfirmedException The account is not confirmed
61 * @throws UserNotFoundException The user account is not found
63 User unlockUserAccount (final User user, final String baseUrl) throws UserStatusConfirmedException, UserStatusUnconfirmedException, UserNotFoundException;
66 * Creates the user instance and links it with the set contact instance
68 * @param user User instance to
70 * @return Updated user instance
72 * @throws UserNameAlreadyRegisteredException When the user name is already
74 * @throws EmailAddressAlreadyRegisteredException When the email address is
77 User linkUser (final User user) throws UserNameAlreadyRegisteredException, EmailAddressAlreadyRegisteredException;
80 * Adds given user to database, if not found by user name or email address.
82 * @param user User instance to add
84 * @return Updated user instance
86 * @throws UserNameAlreadyRegisteredException When the user name is already
88 * @throws EmailAddressAlreadyRegisteredException When the email address is
91 User addUser (final User user) throws UserNameAlreadyRegisteredException, EmailAddressAlreadyRegisteredException;