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 Affero General Public License as
6 * published by the Free Software Foundation, either version 3 of the
7 * License, or (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 Affero General Public License for more details.
14 * You should have received a copy of the GNU Affero General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package org.mxchange.jjobs.beans.user;
19 import java.io.Serializable;
20 import java.util.Date;
21 import java.util.List;
22 import org.mxchange.jcontacts.contact.gender.Gender;
23 import org.mxchange.jcountry.data.Country;
24 import org.mxchange.jphone.phonenumbers.smsprovider.SmsProvider;
25 import org.mxchange.jusercore.events.login.UserLoggedInEvent;
26 import org.mxchange.jusercore.events.registration.UserRegisteredEvent;
27 import org.mxchange.jusercore.exceptions.UserNotFoundException;
28 import org.mxchange.jusercore.model.user.User;
29 import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
32 * An interface for user beans
34 * @author Roland Haeder<roland@mxchange.org>
36 public interface JobsUserWebSessionController extends Serializable {
39 * Tries to lookup user by given id number. If the user is not found or the
40 * account status is not CONFIRMED proper exceptions are thrown.
42 * @param userId User id
44 * @return User instance
46 * @throws UserNotFoundException If the user is not found
48 User lookupUserById (final Long userId) throws UserNotFoundException;
51 * Event observer for new user registrations
53 * @param event User registration event
55 void afterRegistrationEvent (final UserRegisteredEvent event);
58 * Event observer for logged-in user
60 * @param event Event instance
62 void afterUserLogin (final UserLoggedInEvent event);
65 * All public user profiles
67 * @return A list of all public user profiles
69 List<User> allVisibleUsers ();
72 * Creates an instance from all properties
74 * @return A user instance
76 User createUserInstance ();
79 * Getter for birth day
86 * Setter for birth day
88 * @param birthday Birth day
90 void setBirthday (final Date birthday);
93 * Getter for ellphone number's carrier
95 * @return Cellphone number's carrier
97 SmsProvider getCellphoneCarrier ();
100 * Setter for cellphone number's carrier prefix
102 * @param cellphoneCarrier Cellphone number's carrier prefix
104 void setCellphoneCarrier (final SmsProvider cellphoneCarrier);
107 * Getter for ellphone number
109 * @return Cellphone number
111 Long getCellphoneNumber ();
114 * Setter for ellphone number
116 * @param cellphoneNumber Cellphone number
118 void setCellphoneNumber (final Long cellphoneNumber);
130 * @param city the city to set
132 void setCity (final String city);
135 * Getter for comments
139 String getComment ();
144 * @param comment Comments
146 void setComment (final String comment);
149 * Getter for country instance
151 * @return Country instance
153 Country getCountry ();
156 * Setter for country instance
158 * @param country Country instance
160 void setCountry (final Country country);
163 * Getter for email address
165 * @return Email address
167 String getEmailAddress ();
170 * Setter for email address
172 * @param emailAddress Email address
174 void setEmailAddress (final String emailAddress);
177 * Getter for email address, repeated
179 * @return the emailAddress, repeated
181 String getEmailAddressRepeat ();
184 * Setter for email address repeated
186 * @param emailAddressRepeat the emailAddress to set
188 void setEmailAddressRepeat (final String emailAddressRepeat);
193 * @return the familyName
195 String getFamilyName ();
200 * @param familyName the familyName to set
202 void setFamilyName (final String familyName);
205 * Getter for fax number's area code
207 * @return Fax number's area code
209 Integer getFaxAreaCode ();
212 * Setter for fax number's area code
214 * @param faxAreaCode Fax number's area code
216 void setFaxAreaCode (final Integer faxAreaCode);
219 * Getter for fax's country instance
221 * @return Fax' country instance
223 Country getFaxCountry ();
226 * Setter for fax's country instance
228 * @param faxCountry Fax' country instance
230 void setFaxCountry (final Country faxCountry);
233 * Getter for fax number
237 Long getFaxNumber ();
240 * Setter for fax number
242 * @param faxNumber Fax number
244 void setFaxNumber (final Long faxNumber);
249 * @return the first name
251 String getFirstName ();
256 * @param firstName the first name to set
258 void setFirstName (final String firstName);
261 * Gender of the contact
268 * Gender of the contact
270 * @param gender the gender to set
272 void setGender (final Gender gender);
277 * @return the houseNumber
279 Short getHouseNumber ();
284 * @param houseNumber the houseNumber to set
286 void setHouseNumber (final Short houseNumber);
289 * Getter for phone number's area code
291 * @return Phone number's area code
293 Integer getPhoneAreaCode ();
296 * Setter for phone number's area code
298 * @param phoneAreaCode Phone number's area code
300 void setPhoneAreaCode (final Integer phoneAreaCode);
303 * Getter for phone number's country instance
305 * @return Phone number's country instance
307 Country getPhoneCountry ();
310 * Setter for phone number's country instance
312 * @param phoneCountry Phone number's country instance
314 void setPhoneCountry (final Country phoneCountry);
317 * Getter for phone number
319 * @return Phone number
321 Long getPhoneNumber ();
324 * Setter for phone number
326 * @param phoneNumber Phone number
328 void setPhoneNumber (final Long phoneNumber);
340 * @param street the street to set
342 void setStreet (final String street);
354 * @param userId User id
356 void setUserId (final Long userId);
359 * Getter for user name
363 String getUserName ();
366 * Setter for user name
368 * @param userName User name
370 void setUserName (final String userName);
373 * Getter for unencrypted user password
375 * @return Unencrypted user password
377 String getUserPassword ();
380 * Setter for unencrypted user password
382 * @param userPassword Unencrypted user password
384 void setUserPassword (final String userPassword);
387 * Getter for unencrypted user password repeated
389 * @return Unencrypted user password repeated
391 String getUserPasswordRepeat ();
394 * Setter for unencrypted user password repeated
396 * @param userPasswordRepeat Unencrypted user password repeated
398 void setUserPasswordRepeat (final String userPasswordRepeat);
401 * Getter for user profile mode
403 * @return User profile mode
405 ProfileMode getUserProfileMode ();
408 * Setter for user profile mode
410 * @param userProfileMode User profile mode
412 void setUserProfileMode (final ProfileMode userProfileMode);
417 * @return the zipCode
419 Integer getZipCode ();
424 * @param zipCode the zipCode to set
426 void setZipCode (final Integer zipCode);
429 * Checks whether user instance's email address is used
431 * @param user User instance's email address to check
433 * @return Whether it is already used
435 boolean isEmailAddressRegistered (final User user);
438 * Checks whether all required personal data is set
440 * @return Whether the required personal data is set
442 boolean isRequiredPersonalDataSet ();
445 * Checks whether all required personal data is set for changing them
447 * @return Whether the required personal data is set
449 boolean isRequiredChangePersonalDataSet ();
452 * Checks whether same email addresses have been entered
454 * @return Whether same email addresses have been entered
456 boolean isSameEmailAddressEntered ();
459 * Checks whether same passwords has been entered
461 * @return Whether same passwords has been entered
463 boolean isSamePasswordEntered ();
466 * Checks whether given user instance's name is used
468 * @param user User instance's name to check
470 * @return Whether it is already used
472 boolean isUserNameRegistered (final User user);
475 * Checks whether a public user account is registered. This means that at
476 * least one user profile has its flag "public user profile" enabled.
478 * @return Whether at least one user has a public profile
480 boolean isVisibleUserFound ();
483 * Checks if the user id is empty
485 * @return Whether the user id is empty
487 boolean isUserIdEmpty ();
490 * Changes logged-in user's personal data if the current password matches
491 * and TAC + privacy statement has been accepted.
493 * @return New target page
495 String doChangePersonalData ();