2 * Copyright (C) 2016 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.gender.Gender;
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 * Returns a list of all found contacts
40 * @return A list of all contacts.
42 List<Contact> allContacts ();
45 * Updates all data from bean in given contact instance
47 * @param userContact Contact instance to update
49 void updateContactDataFromController (final Contact userContact);
52 * Tries to lookup contact by given id number. If the user is not found a
53 * proper exceptions are thrown.
55 * @param contactId Contact id
57 * @return Contact instance
59 * @throws ContactNotFoundException If the user is not found
61 Contact lookupContactById (final Long contactId) throws ContactNotFoundException;
64 * Creates an instance from all properties
66 * @return A contact instance
68 Contact createContactInstance ();
71 * Getter for birth day
78 * Setter for birth day
80 * @param birthday Birth day
82 void setBirthday (final Date birthday);
85 * Getter for mobile provider
87 * @return Mobile provider
89 MobileProvider getMobileProvider ();
92 * Setter for mobile provider
94 * @param mobileProvider Mobile provider
96 void setMobileProvider (final MobileProvider mobileProvider);
99 * Getter for mobile number
101 * @return Mobile number
103 Long getMobileNumber ();
106 * Setter for mobile number
108 * @param mobileNumber Mobile number
110 void setMobileNumber (final Long mobileNumber);
122 * @param city the city to set
124 void setCity (final String city);
127 * Getter for comments
131 String getComment ();
136 * @param comment Comments
138 void setComment (final String comment);
141 * Getter for country instance
143 * @return Country instance
145 Country getCountry ();
148 * Setter for country instance
150 * @param country Country instance
152 void setCountry (final Country country);
155 * Getter for email address
157 * @return Email address
159 String getEmailAddress ();
162 * Setter for email address
164 * @param emailAddress Email address
166 void setEmailAddress (final String emailAddress);
169 * Getter for email address, repeated
171 * @return the emailAddress, repeated
173 String getEmailAddressRepeat ();
176 * Setter for email address repeated
178 * @param emailAddressRepeat the emailAddress to set
180 void setEmailAddressRepeat (final String emailAddressRepeat);
185 * @return the familyName
187 String getFamilyName ();
192 * @param familyName the familyName to set
194 void setFamilyName (final String familyName);
197 * Getter for fax number's area code
199 * @return Fax number's area code
201 Integer getFaxAreaCode ();
204 * Setter for fax number's area code
206 * @param faxAreaCode Fax number's area code
208 void setFaxAreaCode (final Integer faxAreaCode);
211 * Getter for fax's country instance
213 * @return Fax' country instance
215 Country getFaxCountry ();
218 * Setter for fax's country instance
220 * @param faxCountry Fax' country instance
222 void setFaxCountry (final Country faxCountry);
225 * Getter for fax number
229 Long getFaxNumber ();
232 * Setter for fax number
234 * @param faxNumber Fax number
236 void setFaxNumber (final Long faxNumber);
241 * @return the first name
243 String getFirstName ();
248 * @param firstName the first name to set
250 void setFirstName (final String firstName);
253 * Gender of the contact
260 * Gender of the contact
262 * @param gender the gender to set
264 void setGender (final Gender gender);
269 * @return the houseNumber
271 Short getHouseNumber ();
276 * @param houseNumber the houseNumber to set
278 void setHouseNumber (final Short houseNumber);
281 * Getter for house number extension, example: 123a 'a' is then the
282 * extension and 123 is the house number.
284 * @return House number extension
286 String getHouseNumberExtension ();
289 * Setter for house number extension
291 * @param houseNumberExtension House number extension
293 void setHouseNumberExtension (final String houseNumberExtension);
296 * Getter for phone number's area code
298 * @return Phone number's area code
300 Integer getLandLineAreaCode ();
303 * Setter for phone number's area code
305 * @param phoneAreaCode Phone number's area code
307 void setLandLineAreaCode (final Integer phoneAreaCode);
310 * Getter for phone number's country instance
312 * @return Phone number's country instance
314 Country getLandLineCountry ();
317 * Setter for phone number's country instance
319 * @param phoneCountry Phone number's country instance
321 void setLandLineCountry (final Country phoneCountry);
324 * Getter for phone number
326 * @return Phone number
328 Long getLandLineNumber ();
331 * Setter for phone number
333 * @param phoneNumber Phone number
335 void setLandLineNumber (final Long phoneNumber);
347 * @param street the street to set
349 void setStreet (final String street);
361 * @param title the title to set
363 void setTitle (final String title);
368 * @return the zipCode
370 Integer getZipCode ();
375 * @param zipCode the zipCode to set
377 void setZipCode (final Integer zipCode);
380 * Getter for controller type
382 * @return controller type
384 String getControllerType ();
387 * Setter for controller type
389 * @param controllerType Controller type
391 * @deprecated Don't use this method.
394 void setControllerType (final String controllerType);
397 * Checks whether contact instance's email address is used
399 * @param contact Contact instance's email address to check
401 * @return Whether it is already used
403 boolean isEmailAddressRegistered (final Contact contact);
406 * Checks whether all required personal data is set
408 * @return Whether the required personal data is set
410 boolean isRequiredPersonalDataSet ();
413 * Checks whether all required personal data is set for changing them
415 * @return Whether the required personal data is set
417 boolean isRequiredChangePersonalDataSet ();
420 * Checks whether same email addresses have been entered
422 * @return Whether same email addresses have been entered
424 boolean isSameEmailAddressEntered ();
427 * Changes logged-in user's personal data if the current password matches
428 * and TAC + privacy statement has been accepted.
430 * @return New target page
432 String doChangePersonalContactData ();
435 * Returns a list of all selectable contacts for user creation. Contacts
436 * from already existing users are excluded in this list.
438 * @return A list of all selectable contacts
440 List<Contact> selectableContacts ();