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