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