]> git.mxchange.org Git - pizzaservice-war.git/blob - src/java/org/mxchange/pizzaapplication/beans/contact/PizzaContactWebSessionController.java
Please cherry-pick:
[pizzaservice-war.git] / src / java / org / mxchange / pizzaapplication / beans / contact / PizzaContactWebSessionController.java
1 /*
2  * Copyright (C) 2016, 2017 Roland Häder
3  *
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.
8  *
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.
13  *
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/>.
16  */
17 package org.mxchange.pizzaapplication.beans.contact;
18
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;
28
29 /**
30  * An interface for user beans
31  * <p>
32  * @author Roland Häder<roland@mxchange.org>
33  */
34 @Local
35 public interface PizzaContactWebSessionController extends Serializable {
36
37         /**
38          * Minimum password length
39          */
40         public static final Integer MINIMUM_PASSWORD_LENGTH = 5;
41
42         /**
43          * Returns a list of all found contacts
44          * <p>
45          * @return A list of all contacts.
46          */
47         List<Contact> allContacts ();
48
49         /**
50          * Updates all data from bean in given contact instance
51          * <p>
52          * @param userContact Contact instance to update
53          */
54         void updateContactDataFromController (final Contact userContact);
55
56         /**
57          * Tries to lookup contact by given id number. If the user is not found a
58          * proper exceptions are thrown.
59          * <p>
60          * @param contactId Contact id
61          * <p>
62          * @return Contact instance
63          * <p>
64          * @throws ContactNotFoundException If the user is not found
65          */
66         Contact lookupContactById (final Long contactId) throws ContactNotFoundException;
67
68         /**
69          * Creates an instance from all properties
70          * <p>
71          * @return A contact instance
72          */
73         Contact createContactInstance ();
74
75         /**
76          * Getter for birth day
77          * <p>
78          * @return Birth day
79          */
80         Date getBirthday ();
81
82         /**
83          * Setter for birth day
84          * <p>
85          * @param birthday Birth day
86          */
87         void setBirthday (final Date birthday);
88
89         /**
90          * Getter for mobile number's carrier
91          * <p>
92          * @return Mobile number's carrier
93          */
94         MobileProvider getMobileProvider ();
95
96         /**
97          * Setter for mobile number's carrier prefix
98          * <p>
99          * @param mobileCarrier Mobile number's carrier prefix
100          */
101         void setMobileProvider (final MobileProvider mobileCarrier);
102
103         /**
104          * Getter for mobile number
105          * <p>
106          * @return Mobile number
107          */
108         Long getMobileNumber ();
109
110         /**
111          * Setter for mobile number
112          * <p>
113          * @param mobileNumber Mobile number
114          */
115         void setMobileNumber (final Long mobileNumber);
116
117         /**
118          * City
119          * <p>
120          * @return the city
121          */
122         String getCity ();
123
124         /**
125          * City
126          * <p>
127          * @param city the city to set
128          */
129         void setCity (final String city);
130
131         /**
132          * Getter for comments
133          * <p>
134          * @return Comments
135          */
136         String getComment ();
137
138         /**
139          * Setter for comment
140          * <p>
141          * @param comment Comments
142          */
143         void setComment (final String comment);
144
145         /**
146          * Getter for country instance
147          * <p>
148          * @return Country instance
149          */
150         Country getCountry ();
151
152         /**
153          * Setter for country instance
154          * <p>
155          * @param country Country instance
156          */
157         void setCountry (final Country country);
158
159         /**
160          * Getter for email address
161          * <p>
162          * @return Email address
163          */
164         String getEmailAddress ();
165
166         /**
167          * Setter for email address
168          * <p>
169          * @param emailAddress Email address
170          */
171         void setEmailAddress (final String emailAddress);
172
173         /**
174          * Getter for email address, repeated
175          * <p>
176          * @return the emailAddress, repeated
177          */
178         String getEmailAddressRepeat ();
179
180         /**
181          * Setter for email address repeated
182          * <p>
183          * @param emailAddressRepeat the emailAddress to set
184          */
185         void setEmailAddressRepeat (final String emailAddressRepeat);
186
187         /**
188          * Family name
189          * <p>
190          * @return the familyName
191          */
192         String getFamilyName ();
193
194         /**
195          * Family name
196          * <p>
197          * @param familyName the familyName to set
198          */
199         void setFamilyName (final String familyName);
200
201         /**
202          * Getter for fax number's area code
203          * <p>
204          * @return Fax number's area code
205          */
206         Integer getFaxAreaCode ();
207
208         /**
209          * Setter for fax number's area code
210          * <p>
211          * @param faxAreaCode Fax number's area code
212          */
213         void setFaxAreaCode (final Integer faxAreaCode);
214
215         /**
216          * Getter for fax's country instance
217          * <p>
218          * @return Fax' country instance
219          */
220         Country getFaxCountry ();
221
222         /**
223          * Setter for fax's country instance
224          * <p>
225          * @param faxCountry Fax' country instance
226          */
227         void setFaxCountry (final Country faxCountry);
228
229         /**
230          * Getter for fax number
231          * <p>
232          * @return Fax number
233          */
234         Long getFaxNumber ();
235
236         /**
237          * Setter for fax number
238          * <p>
239          * @param faxNumber Fax number
240          */
241         void setFaxNumber (final Long faxNumber);
242
243         /**
244          * First name
245          * <p>
246          * @return the first name
247          */
248         String getFirstName ();
249
250         /**
251          * First name
252          * <p>
253          * @param firstName the first name to set
254          */
255         void setFirstName (final String firstName);
256
257         /**
258          * Getter for personal title
259          * <p>
260          * @return Personal title
261          */
262         PersonalTitle getPersonalTitle ();
263
264         /**
265          * Setter for personal title
266          * <p>
267          * @param personalTitle Personal title
268          */
269         void setPersonalTitle (final PersonalTitle personalTitle);
270
271         /**
272          * House number
273          * <p>
274          * @return the houseNumber
275          */
276         Short getHouseNumber ();
277
278         /**
279          * House number
280          * <p>
281          * @param houseNumber the houseNumber to set
282          */
283         void setHouseNumber (final Short houseNumber);
284
285         /**
286          * Getter for house number extension, example: 123a 'a' is then the
287          * extension and 123 is the house number.
288          * <p>
289          * @return House number extension
290          */
291         String getHouseNumberExtension ();
292
293         /**
294          * Setter for house number extension
295          * <p>
296          * @param houseNumberExtension House number extension
297          */
298         void setHouseNumberExtension (final String houseNumberExtension);
299
300         /**
301          * Getter for phone number's area code
302          * <p>
303          * @return Phone number's area code
304          */
305         Integer getLandLineAreaCode ();
306
307         /**
308          * Setter for phone number's area code
309          * <p>
310          * @param phoneAreaCode Phone number's area code
311          */
312         void setLandLineAreaCode (final Integer phoneAreaCode);
313
314         /**
315          * Getter for phone number's country instance
316          * <p>
317          * @return Phone number's country instance
318          */
319         Country getLandLineCountry ();
320
321         /**
322          * Setter for phone number's country instance
323          * <p>
324          * @param phoneCountry Phone number's country instance
325          */
326         void setLandLineCountry (final Country phoneCountry);
327
328         /**
329          * Getter for phone number
330          * <p>
331          * @return Phone number
332          */
333         Long getLandLineNumber ();
334
335         /**
336          * Setter for phone number
337          * <p>
338          * @param phoneNumber Phone number
339          */
340         void setLandLineNumber (final Long phoneNumber);
341
342         /**
343          * Street
344          * <p>
345          * @return the street
346          */
347         String getStreet ();
348
349         /**
350          * Street
351          * <p>
352          * @param street the street to set
353          */
354         void setStreet (final String street);
355
356         /**
357          * Getter for academic title
358          * <p>
359          * @return Academic title
360          */
361         String getAcademicTitle ();
362
363         /**
364          * Setter for academic title
365          * <p>
366          * @param academicTitle Academic title
367          */
368         void setAcademicTitle (final String academicTitle);
369
370         /**
371          * ZIP code
372          * <p>
373          * @return the zipCode
374          */
375         Integer getZipCode ();
376
377         /**
378          * ZIP code
379          * <p>
380          * @param zipCode the zipCode to set
381          */
382         void setZipCode (final Integer zipCode);
383
384         /**
385          * Getter for controller type
386          * <p>
387          * @return controller type
388          */
389         String getControllerType ();
390
391         /**
392          * Setter for controller type
393          * <p>
394          * @param controllerType Controller type
395          * <p>
396          * @deprecated Don't use this method.
397          */
398         @Deprecated
399         void setControllerType (final String controllerType);
400
401         /**
402          * Checks whether contact instance's email address is used
403          * <p>
404          * @param contact Contact instance's email address to check
405          * <p>
406          * @return Whether it is already used
407          */
408         boolean isEmailAddressRegistered (final Contact contact);
409
410         /**
411          * Checks whether all required personal data is set
412          * <p>
413          * @return Whether the required personal data is set
414          */
415         boolean isRequiredPersonalDataSet ();
416
417         /**
418          * Checks whether all required personal data is set for changing them
419          * <p>
420          * @return Whether the required personal data is set
421          */
422         boolean isRequiredChangePersonalDataSet ();
423
424         /**
425          * Checks whether same email addresses have been entered
426          * <p>
427          * @return Whether same email addresses have been entered
428          */
429         boolean isSameEmailAddressEntered ();
430
431         /**
432          * Changes logged-in user's personal data if the current password matches
433          * and TAC + privacy statement has been accepted.
434          * <p>
435          * @return New target page
436          */
437         String doChangePersonalContactData ();
438
439         /**
440          * Returns a list of all selectable contacts for user creation. Contacts
441          * from already existing users are excluded in this list.
442          * <p>
443          * @return A list of all selectable contacts
444          */
445         List<Contact> selectableContacts ();
446
447 }