]> git.mxchange.org Git - juser-login-lib.git/blob - src/org/mxchange/jusercore/model/user/UserSessionBeanRemote.java
added business method addUser()
[juser-login-lib.git] / src / org / mxchange / jusercore / model / user / UserSessionBeanRemote.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 java.util.List;
21 import javax.ejb.Remote;
22 import org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException;
23 import org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException;
24
25 /**
26  * An interface for user beans
27  * <p>
28  * @author Roland Haeder<roland@mxchange.org>
29  */
30 @Remote
31 public interface UserSessionBeanRemote extends Serializable {
32
33         /**
34          * Adds given user to database, if not found by user name or email address.
35          * <p>
36          * @param user User instance to add
37          * <p>
38          * @return Updated user instance
39          * @throws org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException When the user name is already used
40          * @throws org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException When the email address is already used
41          */
42         User addUser (final User user) throws UserNameAlreadyRegisteredException, EmailAddressAlreadyRegisteredException;
43
44         /**
45          * Returns a list of all users. This is mostly suitable for administrative
46          * interfaces.
47          * <p>
48          * @return A list of all users
49          */
50         List<User> allUsers ();
51
52         /**
53          * Returns a list with all public and member-visible users. Members are
54          * logged-in users. ;-)
55          * <p>
56          * @return A list of public and member-visible users
57          */
58         List<User> allMemberPublicVisibleUsers ();
59
60         /**
61          * Returns a list of all public user profiles
62          * <p>
63          * @return A list of all public user profiles
64          */
65         List<User> allPublicUsers ();
66
67         /**
68          * Fills given user instance with all available data
69          * <p>
70          * @param user Initial User instance
71          * <p>
72          * @return Prepared User instance
73          */
74         User fillUserData (final User user);
75
76         /**
77          * Some "getter" for a full user name list
78          * <p>
79          * @return User name list
80          */
81         List<String> getUserNameList ();
82
83         /**
84          * Some "getter" for a full email address list
85          * <p>
86          * @return User name list
87          */
88         List<String> getEmailAddressList ();
89
90         /**
91          * Checks if given user id exists
92          * <p>
93          * @param userId User id to check
94          * <p>
95          * @return Whether the user id exists
96          */
97         boolean ifUserIdExists (final Long userId);
98
99         /**
100          * Checks if given user exists
101          * <p>
102          * @param user User to check
103          * <p>
104          * @return Whether the user exists
105          */
106         boolean ifUserExists (final User user);
107
108         /**
109          * Checks if the the given user's name is already registered
110          * <p>
111          * @param user User instance
112          * <p>
113          * @return Whether the user is already registered
114          */
115         boolean isUserNameReqistered (final User user);
116
117         /**
118          * Checks if the the given user's email address is already registered
119          * <p>
120          * @param user User instance
121          * <p>
122          * @return Whether the user is already registered
123          */
124         boolean isEmailAddressReqistered (final User user);
125
126         /**
127          * Updates given user instance in database
128          * <p>
129          * @param user User instance to update
130          */
131         void updateUserPersonalData (final User user);
132
133 }