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.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 PizzaUserWebSessionController 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 1 (changing)
179 * @return Email address
181 String getEmailAddress1 ();
184 * Setter for email address 1 (changing)
186 * @param emailAddress1 Email address 1
188 void setEmailAddress1 (final String emailAddress1);
191 * Getter for email address 2 (repeat changing)
193 * @return Email address 2
195 String getEmailAddress2 ();
198 * Setter for email address 2 (repeat changing)
200 * @param emailAddress2 Email address 2
202 void setEmailAddress2 (final String emailAddress2);
205 * Getter for email address, repeated
207 * @return the emailAddress, repeated
209 String getEmailAddressRepeat ();
212 * Setter for email address repeated
214 * @param emailAddressRepeat the emailAddress to set
216 void setEmailAddressRepeat (final String emailAddressRepeat);
221 * @return the familyName
223 String getFamilyName ();
228 * @param familyName the familyName to set
230 void setFamilyName (final String familyName);
233 * Getter for fax number's area code
235 * @return Fax number's area code
237 Integer getFaxAreaCode ();
240 * Setter for fax number's area code
242 * @param faxAreaCode Fax number's area code
244 void setFaxAreaCode (final Integer faxAreaCode);
247 * Getter for fax's country instance
249 * @return Fax' country instance
251 Country getFaxCountry ();
254 * Setter for fax's country instance
256 * @param faxCountry Fax' country instance
258 void setFaxCountry (final Country faxCountry);
261 * Getter for fax number
265 Long getFaxNumber ();
268 * Setter for fax number
270 * @param faxNumber Fax number
272 void setFaxNumber (final Long faxNumber);
277 * @return the first name
279 String getFirstName ();
284 * @param firstName the first name to set
286 void setFirstName (final String firstName);
289 * Gender of the contact
296 * Gender of the contact
298 * @param gender the gender to set
300 void setGender (final Gender gender);
305 * @return the houseNumber
307 Short getHouseNumber ();
312 * @param houseNumber the houseNumber to set
314 void setHouseNumber (final Short houseNumber);
317 * Getter for phone number's area code
319 * @return Phone number's area code
321 Integer getPhoneAreaCode ();
324 * Setter for phone number's area code
326 * @param phoneAreaCode Phone number's area code
328 void setPhoneAreaCode (final Integer phoneAreaCode);
331 * Getter for phone number's country instance
333 * @return Phone number's country instance
335 Country getPhoneCountry ();
338 * Setter for phone number's country instance
340 * @param phoneCountry Phone number's country instance
342 void setPhoneCountry (final Country phoneCountry);
345 * Getter for phone number
347 * @return Phone number
349 Long getPhoneNumber ();
352 * Setter for phone number
354 * @param phoneNumber Phone number
356 void setPhoneNumber (final Long phoneNumber);
368 * @param street the street to set
370 void setStreet (final String street);
382 * @param userId User id
384 void setUserId (final Long userId);
387 * Getter for user name
391 String getUserName ();
394 * Setter for user name
396 * @param userName User name
398 void setUserName (final String userName);
401 * Getter for unencrypted user password
403 * @return Unencrypted user password
405 String getUserPassword ();
408 * Setter for unencrypted user password
410 * @param userPassword Unencrypted user password
412 void setUserPassword (final String userPassword);
415 * Getter for unencrypted user password repeated
417 * @return Unencrypted user password repeated
419 String getUserPasswordRepeat ();
422 * Setter for unencrypted user password repeated
424 * @param userPasswordRepeat Unencrypted user password repeated
426 void setUserPasswordRepeat (final String userPasswordRepeat);
429 * Getter for user profile mode
431 * @return User profile mode
433 ProfileMode getUserProfileMode ();
436 * Setter for user profile mode
438 * @param userProfileMode User profile mode
440 void setUserProfileMode (final ProfileMode userProfileMode);
445 * @return the zipCode
447 Integer getZipCode ();
452 * @param zipCode the zipCode to set
454 void setZipCode (final Integer zipCode);
457 * Checks whether user instance's email address is used
459 * @param user User instance's email address to check
461 * @return Whether it is already used
463 boolean isEmailAddressRegistered (final User user);
466 * Checks whether all required personal data is set
468 * @return Whether the required personal data is set
470 boolean isRequiredPersonalDataSet ();
473 * Checks whether all required personal data is set for changing them
475 * @return Whether the required personal data is set
477 boolean isRequiredChangePersonalDataSet ();
480 * Checks whether same email addresses have been entered
482 * @return Whether same email addresses have been entered
484 boolean isSameEmailAddressEntered ();
487 * Checks whether same passwords has been entered
489 * @return Whether same passwords has been entered
491 boolean isSamePasswordEntered ();
494 * Checks whether given user instance's name is used
496 * @param user User instance's name to check
498 * @return Whether it is already used
500 boolean isUserNameRegistered (final User user);
503 * Checks whether a public user account is registered. This means that at
504 * least one user profile has its flag "public user profile" enabled.
506 * @return Whether at least one user has a public profile
508 boolean isVisibleUserFound ();
511 * Checks if the user id is empty
513 * @return Whether the user id is empty
515 boolean isUserIdEmpty ();