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.pizzaapplication.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.mobileprovider.MobileProvider;
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 PizzaUserWebSessionController extends Serializable {
39 * Minimum password length
41 public static final Integer MINIMUM_PASSWORD_LENGTH = 5;
44 * Tries to lookup user by given id number. If the user is not found or the
45 * account status is not CONFIRMED proper exceptions are thrown.
47 * @param userId User id
49 * @return User instance
51 * @throws UserNotFoundException If the user is not found
53 User lookupUserById (final Long userId) throws UserNotFoundException;
56 * Event observer for new user registrations
58 * @param event User registration event
60 void afterRegistrationEvent (final UserRegisteredEvent event);
63 * Event observer for logged-in user
65 * @param event Event instance
67 void afterUserLogin (final UserLoggedInEvent event);
70 * All public user profiles
72 * @return A list of all public user profiles
74 List<User> allVisibleUsers ();
77 * Creates an instance from all properties
79 * @return A user instance
81 User createUserInstance ();
84 * Getter for birth day
91 * Setter for birth day
93 * @param birthday Birth day
95 void setBirthday (final Date birthday);
98 * Getter for ellphone number's carrier
100 * @return Cellphone number's carrier
102 MobileProvider getCellphoneCarrier ();
105 * Setter for cellphone number's carrier prefix
107 * @param cellphoneCarrier Cellphone number's carrier prefix
109 void setCellphoneCarrier (final MobileProvider cellphoneCarrier);
112 * Getter for ellphone number
114 * @return Cellphone number
116 Long getCellphoneNumber ();
119 * Setter for ellphone number
121 * @param cellphoneNumber Cellphone number
123 void setCellphoneNumber (final Long cellphoneNumber);
135 * @param city the city to set
137 void setCity (final String city);
140 * Getter for comments
144 String getComment ();
149 * @param comment Comments
151 void setComment (final String comment);
154 * Getter for country instance
156 * @return Country instance
158 Country getCountry ();
161 * Setter for country instance
163 * @param country Country instance
165 void setCountry (final Country country);
168 * Getter for email address
170 * @return Email address
172 String getEmailAddress ();
175 * Setter for email address
177 * @param emailAddress Email address
179 void setEmailAddress (final String emailAddress);
182 * Getter for email address 1 (changing)
184 * @return Email address
186 String getEmailAddress1 ();
189 * Setter for email address 1 (changing)
191 * @param emailAddress1 Email address 1
193 void setEmailAddress1 (final String emailAddress1);
196 * Getter for email address 2 (repeat changing)
198 * @return Email address 2
200 String getEmailAddress2 ();
203 * Setter for email address 2 (repeat changing)
205 * @param emailAddress2 Email address 2
207 void setEmailAddress2 (final String emailAddress2);
210 * Getter for email address, repeated
212 * @return the emailAddress, repeated
214 String getEmailAddressRepeat ();
217 * Setter for email address repeated
219 * @param emailAddressRepeat the emailAddress to set
221 void setEmailAddressRepeat (final String emailAddressRepeat);
226 * @return the familyName
228 String getFamilyName ();
233 * @param familyName the familyName to set
235 void setFamilyName (final String familyName);
238 * Getter for fax number's area code
240 * @return Fax number's area code
242 Integer getFaxAreaCode ();
245 * Setter for fax number's area code
247 * @param faxAreaCode Fax number's area code
249 void setFaxAreaCode (final Integer faxAreaCode);
252 * Getter for fax's country instance
254 * @return Fax' country instance
256 Country getFaxCountry ();
259 * Setter for fax's country instance
261 * @param faxCountry Fax' country instance
263 void setFaxCountry (final Country faxCountry);
266 * Getter for fax number
270 Long getFaxNumber ();
273 * Setter for fax number
275 * @param faxNumber Fax number
277 void setFaxNumber (final Long faxNumber);
282 * @return the first name
284 String getFirstName ();
289 * @param firstName the first name to set
291 void setFirstName (final String firstName);
294 * Gender of the contact
301 * Gender of the contact
303 * @param gender the gender to set
305 void setGender (final Gender gender);
310 * @return the houseNumber
312 Short getHouseNumber ();
317 * @param houseNumber the houseNumber to set
319 void setHouseNumber (final Short houseNumber);
322 * Getter for phone number's area code
324 * @return Phone number's area code
326 Integer getPhoneAreaCode ();
329 * Setter for phone number's area code
331 * @param phoneAreaCode Phone number's area code
333 void setPhoneAreaCode (final Integer phoneAreaCode);
336 * Getter for phone number's country instance
338 * @return Phone number's country instance
340 Country getPhoneCountry ();
343 * Setter for phone number's country instance
345 * @param phoneCountry Phone number's country instance
347 void setPhoneCountry (final Country phoneCountry);
350 * Getter for phone number
352 * @return Phone number
354 Long getPhoneNumber ();
357 * Setter for phone number
359 * @param phoneNumber Phone number
361 void setPhoneNumber (final Long phoneNumber);
373 * @param street the street to set
375 void setStreet (final String street);
378 * Getter for user instance (e.g. from show_user)
380 * @return User instance
385 * Setter for user instance (e.g. from show_user)
387 * @param user User instance
389 void setUser (final User user);
401 * @param userId User id
403 void setUserId (final Long userId);
406 * Getter for user name
410 String getUserName ();
413 * Setter for user name
415 * @param userName User name
417 void setUserName (final String userName);
420 * Getter for unencrypted user password
422 * @return Unencrypted user password
424 String getUserPassword ();
427 * Setter for unencrypted user password
429 * @param userPassword Unencrypted user password
431 void setUserPassword (final String userPassword);
434 * Getter for unencrypted user password repeated
436 * @return Unencrypted user password repeated
438 String getUserPasswordRepeat ();
441 * Setter for unencrypted user password repeated
443 * @param userPasswordRepeat Unencrypted user password repeated
445 void setUserPasswordRepeat (final String userPasswordRepeat);
448 * Getter for user profile mode
450 * @return User profile mode
452 ProfileMode getUserProfileMode ();
455 * Setter for user profile mode
457 * @param userProfileMode User profile mode
459 void setUserProfileMode (final ProfileMode userProfileMode);
464 * @return the zipCode
466 Integer getZipCode ();
471 * @param zipCode the zipCode to set
473 void setZipCode (final Integer zipCode);
476 * Checks whether user instance's email address is used
478 * @param user User instance's email address to check
480 * @return Whether it is already used
482 boolean isEmailAddressRegistered (final User user);
485 * Checks whether all required personal data is set
487 * @return Whether the required personal data is set
489 boolean isRequiredPersonalDataSet ();
492 * Checks whether all required personal data is set for changing them
494 * @return Whether the required personal data is set
496 boolean isRequiredChangePersonalDataSet ();
499 * Checks whether same email addresses have been entered
501 * @return Whether same email addresses have been entered
503 boolean isSameEmailAddressEntered ();
506 * Checks whether same passwords has been entered
508 * @return Whether same passwords has been entered
510 boolean isSamePasswordEntered ();
513 * Checks whether given user instance's name is used
515 * @param user User instance's name to check
517 * @return Whether it is already used
519 boolean isUserNameRegistered (final User user);
522 * Checks whether a public user account is registered. This means that at
523 * least one user profile has its flag "public user profile" enabled.
525 * @return Whether at least one user has a public profile
527 boolean isVisibleUserFound ();
530 * Checks if the user id is empty
532 * @return Whether the user id is empty
534 boolean isUserIdEmpty ();