X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2Fjava%2Forg%2Fmxchange%2Fpizzaapplication%2Fbeans%2Fuser%2FPizzaUserWebSessionController.java;h=8109b928db08c3f6c239fa2e754802af102f9588;hb=075cd9b9f4f2d3614b1c898d7b911d35403ab95c;hp=ec3bbc0693a91fcd8296c0a6d8c3b08ef8dbffee;hpb=0e599c4d9613b1474e9e4a190ac548904c8c037b;p=pizzaservice-war.git diff --git a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionController.java b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionController.java index ec3bbc06..8109b928 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionController.java +++ b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionController.java @@ -17,13 +17,12 @@ package org.mxchange.pizzaapplication.beans.user; import java.io.Serializable; -import java.util.Date; import java.util.List; -import org.mxchange.jcontacts.contact.gender.Gender; -import org.mxchange.jcountry.data.Country; -import org.mxchange.jphone.phonenumbers.smsprovider.SmsProvider; +import org.mxchange.jcontacts.contact.Contact; import org.mxchange.jusercore.events.login.UserLoggedInEvent; import org.mxchange.jusercore.events.registration.UserRegisteredEvent; +import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent; +import org.mxchange.jusercore.events.user.update.UpdatedUserPersonalDataEvent; import org.mxchange.jusercore.exceptions.UserNotFoundException; import org.mxchange.jusercore.model.user.User; import org.mxchange.jusercore.model.user.profilemodes.ProfileMode; @@ -41,338 +40,96 @@ public interface PizzaUserWebSessionController extends Serializable { public static final Integer MINIMUM_PASSWORD_LENGTH = 5; /** - * Tries to lookup user by given id number. If the user is not found or the - * account status is not CONFIRMED proper exceptions are thrown. - *

- * @param userId User id - *

- * @return User instance - *

- * @throws UserNotFoundException If the user is not found - */ - User lookupUserById (final Long userId) throws UserNotFoundException; - - /** - * Event observer for new user registrations - *

- * @param event User registration event - */ - void afterRegistrationEvent (final UserRegisteredEvent event); - - /** - * Event observer for logged-in user - *

- * @param event Event instance - */ - void afterUserLogin (final UserLoggedInEvent event); - - /** - * All public user profiles + * All users *

* @return A list of all public user profiles */ - List allVisibleUsers (); - - /** - * Creates an instance from all properties - *

- * @return A user instance - */ - User createUserInstance (); - - /** - * Getter for birth day - *

- * @return Birth day - */ - Date getBirthday (); - - /** - * Setter for birth day - *

- * @param birthday Birth day - */ - void setBirthday (final Date birthday); - - /** - * Getter for ellphone number's carrier - *

- * @return Cellphone number's carrier - */ - SmsProvider getCellphoneCarrier (); - - /** - * Setter for cellphone number's carrier prefix - *

- * @param cellphoneCarrier Cellphone number's carrier prefix - */ - void setCellphoneCarrier (final SmsProvider cellphoneCarrier); - - /** - * Getter for ellphone number - *

- * @return Cellphone number - */ - Long getCellphoneNumber (); - - /** - * Setter for ellphone number - *

- * @param cellphoneNumber Cellphone number - */ - void setCellphoneNumber (final Long cellphoneNumber); - - /** - * City - *

- * @return the city - */ - String getCity (); - - /** - * City - *

- * @param city the city to set - */ - void setCity (final String city); - - /** - * Getter for comments - *

- * @return Comments - */ - String getComment (); - - /** - * Setter for comment - *

- * @param comment Comments - */ - void setComment (final String comment); - - /** - * Getter for country instance - *

- * @return Country instance - */ - Country getCountry (); - - /** - * Setter for country instance - *

- * @param country Country instance - */ - void setCountry (final Country country); - - /** - * Getter for email address - *

- * @return Email address - */ - String getEmailAddress (); - - /** - * Setter for email address - *

- * @param emailAddress Email address - */ - void setEmailAddress (final String emailAddress); - - /** - * Getter for email address 1 (changing) - *

- * @return Email address - */ - String getEmailAddress1 (); - - /** - * Setter for email address 1 (changing) - *

- * @param emailAddress1 Email address 1 - */ - void setEmailAddress1 (final String emailAddress1); - - /** - * Getter for email address 2 (repeat changing) - *

- * @return Email address 2 - */ - String getEmailAddress2 (); - - /** - * Setter for email address 2 (repeat changing) - *

- * @param emailAddress2 Email address 2 - */ - void setEmailAddress2 (final String emailAddress2); - - /** - * Getter for email address, repeated - *

- * @return the emailAddress, repeated - */ - String getEmailAddressRepeat (); - - /** - * Setter for email address repeated - *

- * @param emailAddressRepeat the emailAddress to set - */ - void setEmailAddressRepeat (final String emailAddressRepeat); - - /** - * Family name - *

- * @return the familyName - */ - String getFamilyName (); - - /** - * Family name - *

- * @param familyName the familyName to set - */ - void setFamilyName (final String familyName); - - /** - * Getter for fax number's area code - *

- * @return Fax number's area code - */ - Integer getFaxAreaCode (); - - /** - * Setter for fax number's area code - *

- * @param faxAreaCode Fax number's area code - */ - void setFaxAreaCode (final Integer faxAreaCode); - - /** - * Getter for fax's country instance - *

- * @return Fax' country instance - */ - Country getFaxCountry (); - - /** - * Setter for fax's country instance - *

- * @param faxCountry Fax' country instance - */ - void setFaxCountry (final Country faxCountry); - - /** - * Getter for fax number - *

- * @return Fax number - */ - Long getFaxNumber (); - - /** - * Setter for fax number - *

- * @param faxNumber Fax number - */ - void setFaxNumber (final Long faxNumber); + List allUsers (); /** - * First name + * Checks whether users are registered *

- * @return the first name + * @return Whether users are registered */ - String getFirstName (); + boolean hasUsers (); /** - * First name + * Checks whether the given contact is a user *

- * @param firstName the first name to set - */ - void setFirstName (final String firstName); - - /** - * Gender of the contact + * @param contact Contact to check *

- * @return the gender + * @return Whether the contact is a user */ - Gender getGender (); + boolean isContactFound (final Contact contact); /** - * Gender of the contact + * Listens to fired event when user updated personal data *

- * @param gender the gender to set + * @param event Event being fired */ - void setGender (final Gender gender); + void afterUserUpdatedPersonalData (final UpdatedUserPersonalDataEvent event); /** - * House number + * Updates list with given user *

- * @return the houseNumber + * @param user User to update */ - Short getHouseNumber (); + void updateList (final User user); /** - * House number + * Returns a list of all selectable contacts for user creation. Contacts + * from already existing users are excluded in this list. *

- * @param houseNumber the houseNumber to set + * @return A list of all selectable contacts */ - void setHouseNumber (final Short houseNumber); + List selectableContacts (); /** - * Getter for phone number's area code + * Tries to lookup user by given id number. If the user is not found or the + * account status is not CONFIRMED proper exceptions are thrown. *

- * @return Phone number's area code - */ - Integer getPhoneAreaCode (); - - /** - * Setter for phone number's area code + * @param userId User id *

- * @param phoneAreaCode Phone number's area code - */ - void setPhoneAreaCode (final Integer phoneAreaCode); - - /** - * Getter for phone number's country instance + * @return User instance *

- * @return Phone number's country instance + * @throws UserNotFoundException If the user is not found */ - Country getPhoneCountry (); + User lookupUserById (final Long userId) throws UserNotFoundException; /** - * Setter for phone number's country instance + * Event observer for newly added users by an administrator *

- * @param phoneCountry Phone number's country instance + * @param event Event being fired */ - void setPhoneCountry (final Country phoneCountry); + void afterAdminAddedUserEvent (final AdminAddedUserEvent event); /** - * Getter for phone number + * Event observer for new user registrations *

- * @return Phone number + * @param event User registration event */ - Long getPhoneNumber (); + void afterRegistrationEvent (final UserRegisteredEvent event); /** - * Setter for phone number + * Event observer for logged-in user *

- * @param phoneNumber Phone number + * @param event Event instance */ - void setPhoneNumber (final Long phoneNumber); + void afterUserLogin (final UserLoggedInEvent event); /** - * Street + * All public user profiles *

- * @return the street + * @return A list of all public user profiles */ - String getStreet (); + List allVisibleUsers (); /** - * Street + * Creates an instance from all properties *

- * @param street the street to set + * @return A user instance */ - void setStreet (final String street); + User createUserInstance (); /** * Getter for user id @@ -444,29 +201,6 @@ public interface PizzaUserWebSessionController extends Serializable { */ void setUserProfileMode (final ProfileMode userProfileMode); - /** - * ZIP code - *

- * @return the zipCode - */ - Integer getZipCode (); - - /** - * ZIP code - *

- * @param zipCode the zipCode to set - */ - void setZipCode (final Integer zipCode); - - /** - * Checks whether user instance's email address is used - *

- * @param user User instance's email address to check - *

- * @return Whether it is already used - */ - boolean isEmailAddressRegistered (final User user); - /** * Checks whether all required personal data is set *

@@ -481,13 +215,6 @@ public interface PizzaUserWebSessionController extends Serializable { */ boolean isRequiredChangePersonalDataSet (); - /** - * Checks whether same email addresses have been entered - *

- * @return Whether same email addresses have been entered - */ - boolean isSameEmailAddressEntered (); - /** * Checks whether same passwords has been entered *

@@ -519,4 +246,12 @@ public interface PizzaUserWebSessionController extends Serializable { */ boolean isUserIdEmpty (); + /** + * Changes logged-in user's personal data if the current password matches + * and TAC + privacy statement has been accepted. + *

+ * @return New target page + */ + String doChangePersonalData (); + }