]> git.mxchange.org Git - juser-activity-lib.git/blob - src/org/mxchange/jusercore/model/user/AdminUserSessionBeanRemote.java
5062d8b9599cd42d0c5a7c9b4437397d0e53d796
[juser-activity-lib.git] / src / org / mxchange / jusercore / model / user / AdminUserSessionBeanRemote.java
1 /*
2  * Copyright (C) 2016 Roland Haeder
3  *
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.
8  *
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.
13  *
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/>.
16  */
17 package org.mxchange.jusercore.model.user;
18
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;
26
27 /**
28  * An interface for administrative user beans
29  * <p>
30  * @author Roland Haeder<roland@mxchange.org>
31  */
32 @Remote
33 public interface AdminUserSessionBeanRemote extends Serializable {
34
35         /**
36          * Locks given user account with given reason
37          * <p>
38          * @param user User account to be locked, must be status CONFIRMED
39          * @param userLockReason Lock reason
40          * <p>
41          * @throws UserStatusLockedException The account is already locked
42          * @throws UserStatusUnconfirmedException The account is not confirmed
43          * @throws UserNotFoundException The user account is not found
44          */
45         void lockUserAccount (final User user, final String userLockReason) throws UserStatusLockedException, UserStatusUnconfirmedException, UserNotFoundException;
46
47         /**
48          * Creates the user instance and links it with the set contact instance
49          * <p>
50          * @param user User instance to
51          * <p>
52          * @return Updated user instance
53          * <p>
54          * @throws UserNameAlreadyRegisteredException When the user name is already
55          * used
56          * @throws EmailAddressAlreadyRegisteredException When the email address is
57          * already used
58          */
59         User linkUser (final User user) throws UserNameAlreadyRegisteredException, EmailAddressAlreadyRegisteredException;
60
61         /**
62          * Adds given user to database, if not found by user name or email address.
63          * <p>
64          * @param user User instance to add
65          * <p>
66          * @return Updated user instance
67          * <p>
68          * @throws UserNameAlreadyRegisteredException When the user name is already
69          * used
70          * @throws EmailAddressAlreadyRegisteredException When the email address is
71          * already used
72          */
73         User addUser (final User user) throws UserNameAlreadyRegisteredException, EmailAddressAlreadyRegisteredException;
74
75 }