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