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