2 * Copyright (C) 2016, 2017 Roland Häder
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.contact;
19 import java.io.Serializable;
20 import java.util.Date;
21 import java.util.List;
22 import javax.ejb.Local;
23 import org.mxchange.jcontacts.contact.Contact;
24 import org.mxchange.jcontacts.contact.title.PersonalTitle;
25 import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
26 import org.mxchange.jcountry.data.Country;
27 import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
30 * An interface for user beans
32 * @author Roland Häder<roland@mxchange.org>
35 public interface PizzaContactWebSessionController extends Serializable {
38 * Minimum password length
40 public static final Integer MINIMUM_PASSWORD_LENGTH = 5;
43 * Returns a list of all found contacts
45 * @return A list of all contacts.
47 List<Contact> allContacts ();
50 * Updates all data from bean in given contact instance
52 * @param userContact Contact instance to update
54 void updateContactDataFromController (final Contact userContact);
57 * Tries to lookup contact by given id number. If the user is not found a
58 * proper exceptions are thrown.
60 * @param contactId Contact id
62 * @return Contact instance
64 * @throws ContactNotFoundException If the user is not found
66 Contact lookupContactById (final Long contactId) throws ContactNotFoundException;
69 * Creates an instance from all properties
71 * @return A contact instance
73 Contact createContactInstance ();
76 * Getter for birth day
83 * Setter for birth day
85 * @param birthday Birth day
87 void setBirthday (final Date birthday);
90 * Getter for mobile number's carrier
92 * @return Mobile number's carrier
94 MobileProvider getMobileProvider ();
97 * Setter for mobile number's carrier prefix
99 * @param mobileCarrier Mobile number's carrier prefix
101 void setMobileProvider (final MobileProvider mobileCarrier);
104 * Getter for mobile number
106 * @return Mobile number
108 Long getMobileNumber ();
111 * Setter for mobile number
113 * @param mobileNumber Mobile number
115 void setMobileNumber (final Long mobileNumber);
127 * @param city the city to set
129 void setCity (final String city);
132 * Getter for comments
136 String getComment ();
141 * @param comment Comments
143 void setComment (final String comment);
146 * Getter for country instance
148 * @return Country instance
150 Country getCountry ();
153 * Setter for country instance
155 * @param country Country instance
157 void setCountry (final Country country);
160 * Getter for email address
162 * @return Email address
164 String getEmailAddress ();
167 * Setter for email address
169 * @param emailAddress Email address
171 void setEmailAddress (final String emailAddress);
174 * Getter for email address, repeated
176 * @return the emailAddress, repeated
178 String getEmailAddressRepeat ();
181 * Setter for email address repeated
183 * @param emailAddressRepeat the emailAddress to set
185 void setEmailAddressRepeat (final String emailAddressRepeat);
190 * @return the familyName
192 String getFamilyName ();
197 * @param familyName the familyName to set
199 void setFamilyName (final String familyName);
202 * Getter for fax number's area code
204 * @return Fax number's area code
206 Integer getFaxAreaCode ();
209 * Setter for fax number's area code
211 * @param faxAreaCode Fax number's area code
213 void setFaxAreaCode (final Integer faxAreaCode);
216 * Getter for fax's country instance
218 * @return Fax' country instance
220 Country getFaxCountry ();
223 * Setter for fax's country instance
225 * @param faxCountry Fax' country instance
227 void setFaxCountry (final Country faxCountry);
230 * Getter for fax number
234 Long getFaxNumber ();
237 * Setter for fax number
239 * @param faxNumber Fax number
241 void setFaxNumber (final Long faxNumber);
246 * @return the first name
248 String getFirstName ();
253 * @param firstName the first name to set
255 void setFirstName (final String firstName);
258 * Getter for personal title
260 * @return Personal title
262 PersonalTitle getPersonalTitle ();
265 * Setter for personal title
267 * @param personalTitle Personal title
269 void setPersonalTitle (final PersonalTitle personalTitle);
274 * @return the houseNumber
276 Short getHouseNumber ();
281 * @param houseNumber the houseNumber to set
283 void setHouseNumber (final Short houseNumber);
286 * Getter for house number extension, example: 123a 'a' is then the
287 * extension and 123 is the house number.
289 * @return House number extension
291 String getHouseNumberExtension ();
294 * Setter for house number extension
296 * @param houseNumberExtension House number extension
298 void setHouseNumberExtension (final String houseNumberExtension);
301 * Getter for phone number's area code
303 * @return Phone number's area code
305 Integer getLandLineAreaCode ();
308 * Setter for phone number's area code
310 * @param phoneAreaCode Phone number's area code
312 void setLandLineAreaCode (final Integer phoneAreaCode);
315 * Getter for phone number's country instance
317 * @return Phone number's country instance
319 Country getLandLineCountry ();
322 * Setter for phone number's country instance
324 * @param phoneCountry Phone number's country instance
326 void setLandLineCountry (final Country phoneCountry);
329 * Getter for phone number
331 * @return Phone number
333 Long getLandLineNumber ();
336 * Setter for phone number
338 * @param phoneNumber Phone number
340 void setLandLineNumber (final Long phoneNumber);
352 * @param street the street to set
354 void setStreet (final String street);
357 * Getter for academic title
359 * @return Academic title
361 String getAcademicTitle ();
364 * Setter for academic title
366 * @param academicTitle Academic title
368 void setAcademicTitle (final String academicTitle);
373 * @return the zipCode
375 Integer getZipCode ();
380 * @param zipCode the zipCode to set
382 void setZipCode (final Integer zipCode);
385 * Getter for controller type
387 * @return controller type
389 String getControllerType ();
392 * Setter for controller type
394 * @param controllerType Controller type
395 * @deprecated Don't use this method.
398 void setControllerType (final String controllerType);
401 * Checks whether contact instance's email address is used
403 * @param contact Contact instance's email address to check
405 * @return Whether it is already used
407 boolean isEmailAddressRegistered (final Contact contact);
410 * Checks whether all required personal data is set
412 * @return Whether the required personal data is set
414 boolean isRequiredPersonalDataSet ();
417 * Checks whether all required personal data is set for changing them
419 * @return Whether the required personal data is set
421 boolean isRequiredChangePersonalDataSet ();
424 * Checks whether same email addresses have been entered
426 * @return Whether same email addresses have been entered
428 boolean isSameEmailAddressEntered ();
431 * Changes logged-in user's personal data if the current password matches
432 * and TAC + privacy statement has been accepted.
434 * @return New target page
436 String doChangePersonalContactData ();
439 * Returns a list of all selectable contacts for user creation. Contacts
440 * from already existing users are excluded in this list.
442 * @return A list of all selectable contacts
444 List<Contact> selectableContacts ();