]> git.mxchange.org Git - juser-activity-lib.git/blob - src/org/mxchange/jusercore/model/user/AdminUserSessionBeanRemote.java
2b2ccec04ed49d5c193618a62fa6a652381b2e95
[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.UserStatusConfirmedException;
25 import org.mxchange.jusercore.exceptions.UserStatusLockedException;
26 import org.mxchange.jusercore.exceptions.UserStatusUnconfirmedException;
27
28 /**
29  * An interface for administrative user beans
30  * <p>
31  * @author Roland Haeder<roland@mxchange.org>
32  */
33 @Remote
34 public interface AdminUserSessionBeanRemote extends Serializable {
35
36         /**
37          * Locks given user account with given reason
38          * <p>
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
42          * <p>
43          * @return Updated (and detached) user instance
44          * <p>
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
48          */
49         User lockUserAccount (final User user, final String userLockReason, final String baseUrl) throws UserStatusLockedException, UserStatusUnconfirmedException, UserNotFoundException;
50
51         /**
52          * Unlocks given user account
53          * <p>
54          * @param user User account to be unlocked, must be status LOCKED
55          * @param baseUrl Base URL for all URLs
56          * <p>
57          * @return Updated (and detached) user instance
58          * <p>
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
62          */
63         User unlockUserAccount (final User user, final String baseUrl) throws UserStatusConfirmedException, UserStatusUnconfirmedException, UserNotFoundException;
64
65         /**
66          * Creates the user instance and links it with the set contact instance
67          * <p>
68          * @param user User instance to
69          * <p>
70          * @return Updated user instance
71          * <p>
72          * @throws UserNameAlreadyRegisteredException When the user name is already
73          * used
74          * @throws EmailAddressAlreadyRegisteredException When the email address is
75          * already used
76          */
77         User linkUser (final User user) throws UserNameAlreadyRegisteredException, EmailAddressAlreadyRegisteredException;
78
79         /**
80          * Adds given user to database, if not found by user name or email address.
81          * <p>
82          * @param user User instance to add
83          * <p>
84          * @return Updated user instance
85          * <p>
86          * @throws UserNameAlreadyRegisteredException When the user name is already
87          * used
88          * @throws EmailAddressAlreadyRegisteredException When the email address is
89          * already used
90          */
91         User addUser (final User user) throws UserNameAlreadyRegisteredException, EmailAddressAlreadyRegisteredException;
92
93 }