]> git.mxchange.org Git - juser-lib.git/blob - src/org/mxchange/jusercore/model/user/AdminUserSessionBeanRemote.java
Continued:
[juser-lib.git] / src / org / mxchange / jusercore / model / user / AdminUserSessionBeanRemote.java
1 /*
2  * Copyright (C) 2016 - 2020 Free Software Foundation
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 Häder<roland@mxchange.org>
32  */
33 @Remote
34 public interface AdminUserSessionBeanRemote extends Serializable {
35
36         /**
37          * Deletes given user instance
38          * <p>
39          * @param user User instance to delete
40          * @param userDeleteReason Delete reason
41          * <p>
42          * @throws UserNotFoundException If the user account is not found
43          */
44         void deleteUser (final User user, final String userDeleteReason) throws UserNotFoundException;
45
46         /**
47          * Locks given user account with given reason
48          * <p>
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
52          * <p>
53          * @return Updated (and detached) user instance
54          * <p>
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
58          */
59         User lockUserAccount (final User user, final String userLockReason, final String baseUrl) throws UserStatusLockedException, UserStatusUnconfirmedException, UserNotFoundException;
60
61         /**
62          * Unlocks given user account
63          * <p>
64          * @param user User account to be unlocked, must be status LOCKED
65          * @param baseUrl Base URL for all URLs
66          * <p>
67          * @return Updated (and detached) user instance
68          * <p>
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
72          */
73         User unlockUserAccount (final User user, final String baseUrl) throws UserStatusConfirmedException, UserStatusUnconfirmedException, UserNotFoundException;
74
75         /**
76          * Creates the user instance and links it with the set contact instance
77          * <p>
78          * @param user User instance to
79          * <p>
80          * @return Updated user instance
81          * <p>
82          * @throws UserNameAlreadyRegisteredException When the user name is already
83          * used
84          * @throws EmailAddressAlreadyRegisteredException When the email address is
85          * already used
86          */
87         User linkUser (final User user) throws UserNameAlreadyRegisteredException, EmailAddressAlreadyRegisteredException;
88
89         /**
90          * Adds given user to database, if not found by user name or email address.
91          * <p>
92          * @param user User instance to add
93          * <p>
94          * @return Updated user instance
95          * <p>
96          * @throws UserNameAlreadyRegisteredException When the user name is already
97          * used
98          * @throws EmailAddressAlreadyRegisteredException When the email address is
99          * already used
100          */
101         User addUser (final User user) throws UserNameAlreadyRegisteredException, EmailAddressAlreadyRegisteredException;
102
103 }