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.UserStatusLockedException;
25 import org.mxchange.jusercore.exceptions.UserStatusUnconfirmedException;
28 * An interface for administrative user beans
30 * @author Roland Haeder<roland@mxchange.org>
33 public interface AdminUserSessionBeanRemote extends Serializable {
36 * Locks given user account with given reason
38 * @param user User account to be locked, must be status CONFIRMED
39 * @param userLockReason Lock reason
40 * @param baseUrl Base URL for all URLs
42 * @throws UserStatusLockedException The account is already locked
43 * @throws UserStatusUnconfirmedException The account is not confirmed
44 * @throws UserNotFoundException The user account is not found
46 void lockUserAccount (final User user, final String userLockReason, final String baseUrl) throws UserStatusLockedException, UserStatusUnconfirmedException, UserNotFoundException;
49 * Creates the user instance and links it with the set contact instance
51 * @param user User instance to
53 * @return Updated user instance
55 * @throws UserNameAlreadyRegisteredException When the user name is already
57 * @throws EmailAddressAlreadyRegisteredException When the email address is
60 User linkUser (final User user) throws UserNameAlreadyRegisteredException, EmailAddressAlreadyRegisteredException;
63 * Adds given user to database, if not found by user name or email address.
65 * @param user User instance to add
67 * @return Updated user instance
69 * @throws UserNameAlreadyRegisteredException When the user name is already
71 * @throws EmailAddressAlreadyRegisteredException When the email address is
74 User addUser (final User user) throws UserNameAlreadyRegisteredException, EmailAddressAlreadyRegisteredException;