]> git.mxchange.org Git - pizzaservice-war.git/blob - src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionController.java
This "Pizza-Service" application was build on an outdated core, as it was not require...
[pizzaservice-war.git] / src / java / org / mxchange / pizzaapplication / beans / user / PizzaUserWebSessionController.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.user;
18
19 import java.io.Serializable;
20 import java.util.Date;
21 import java.util.List;
22 import org.mxchange.jcontacts.contact.gender.Gender;
23 import org.mxchange.jcountry.data.Country;
24 import org.mxchange.jphone.phonenumbers.smsprovider.SmsProvider;
25 import org.mxchange.jusercore.events.login.UserLoggedInEvent;
26 import org.mxchange.jusercore.events.registration.UserRegisteredEvent;
27 import org.mxchange.jusercore.exceptions.UserNotFoundException;
28 import org.mxchange.jusercore.model.user.User;
29 import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
30
31 /**
32  * An interface for user beans
33  * <p>
34  * @author Roland Haeder<roland@mxchange.org>
35  */
36 public interface PizzaUserWebSessionController extends Serializable {
37
38         /**
39          * Tries to lookup user by given id number. If the user is not found or the
40          * account status is not CONFIRMED proper exceptions are thrown.
41          * <p>
42          * @param userId User id
43          * <p>
44          * @return User instance
45          * <p>
46          * @throws UserNotFoundException If the user is not found
47          */
48         User lookupUserById (final Long userId) throws UserNotFoundException;
49
50         /**
51          * Event observer for new user registrations
52          * <p>
53          * @param event User registration event
54          */
55         void afterRegistrationEvent (final UserRegisteredEvent event);
56
57         /**
58          * Event observer for logged-in user
59          * <p>
60          * @param event Event instance
61          */
62         void afterUserLogin (final UserLoggedInEvent event);
63
64         /**
65          * All public user profiles
66          * <p>
67          * @return A list of all public user profiles
68          */
69         List<User> allVisibleUsers ();
70
71         /**
72          * Creates an instance from all properties
73          * <p>
74          * @return A user instance
75          */
76         User createUserInstance ();
77
78         /**
79          * Getter for birth day
80          * <p>
81          * @return Birth day
82          */
83         Date getBirthday ();
84
85         /**
86          * Setter for birth day
87          * <p>
88          * @param birthday Birth day
89          */
90         void setBirthday (final Date birthday);
91
92         /**
93          * Getter for ellphone number's carrier
94          * <p>
95          * @return Cellphone number's carrier
96          */
97         SmsProvider getCellphoneCarrier ();
98
99         /**
100          * Setter for cellphone number's carrier prefix
101          * <p>
102          * @param cellphoneCarrier Cellphone number's carrier prefix
103          */
104         void setCellphoneCarrier (final SmsProvider cellphoneCarrier);
105
106         /**
107          * Getter for ellphone number
108          * <p>
109          * @return Cellphone number
110          */
111         Long getCellphoneNumber ();
112
113         /**
114          * Setter for ellphone number
115          * <p>
116          * @param cellphoneNumber Cellphone number
117          */
118         void setCellphoneNumber (final Long cellphoneNumber);
119
120         /**
121          * City
122          * <p>
123          * @return the city
124          */
125         String getCity ();
126
127         /**
128          * City
129          * <p>
130          * @param city the city to set
131          */
132         void setCity (final String city);
133
134         /**
135          * Getter for comments
136          * <p>
137          * @return Comments
138          */
139         String getComment ();
140
141         /**
142          * Setter for comment
143          * <p>
144          * @param comment Comments
145          */
146         void setComment (final String comment);
147
148         /**
149          * Getter for country instance
150          * <p>
151          * @return Country instance
152          */
153         Country getCountry ();
154
155         /**
156          * Setter for country instance
157          * <p>
158          * @param country Country instance
159          */
160         void setCountry (final Country country);
161
162         /**
163          * Getter for email address
164          * <p>
165          * @return Email address
166          */
167         String getEmailAddress ();
168
169         /**
170          * Setter for email address
171          * <p>
172          * @param emailAddress Email address
173          */
174         void setEmailAddress (final String emailAddress);
175
176         /**
177          * Getter for email address 1 (changing)
178          * <p>
179          * @return Email address
180          */
181         String getEmailAddress1 ();
182
183         /**
184          * Setter for email address 1 (changing)
185          * <p>
186          * @param emailAddress1 Email address 1
187          */
188         void setEmailAddress1 (final String emailAddress1);
189
190         /**
191          * Getter for email address 2 (repeat changing)
192          * <p>
193          * @return Email address 2
194          */
195         String getEmailAddress2 ();
196
197         /**
198          * Setter for email address 2 (repeat changing)
199          * <p>
200          * @param emailAddress2 Email address 2
201          */
202         void setEmailAddress2 (final String emailAddress2);
203
204         /**
205          * Getter for email address, repeated
206          * <p>
207          * @return the emailAddress, repeated
208          */
209         String getEmailAddressRepeat ();
210
211         /**
212          * Setter for email address repeated
213          * <p>
214          * @param emailAddressRepeat the emailAddress to set
215          */
216         void setEmailAddressRepeat (final String emailAddressRepeat);
217
218         /**
219          * Family name
220          * <p>
221          * @return the familyName
222          */
223         String getFamilyName ();
224
225         /**
226          * Family name
227          * <p>
228          * @param familyName the familyName to set
229          */
230         void setFamilyName (final String familyName);
231
232         /**
233          * Getter for fax number's area code
234          * <p>
235          * @return Fax number's area code
236          */
237         Integer getFaxAreaCode ();
238
239         /**
240          * Setter for fax number's area code
241          * <p>
242          * @param faxAreaCode Fax number's area code
243          */
244         void setFaxAreaCode (final Integer faxAreaCode);
245
246         /**
247          * Getter for fax's country instance
248          * <p>
249          * @return Fax' country instance
250          */
251         Country getFaxCountry ();
252
253         /**
254          * Setter for fax's country instance
255          * <p>
256          * @param faxCountry Fax' country instance
257          */
258         void setFaxCountry (final Country faxCountry);
259
260         /**
261          * Getter for fax number
262          * <p>
263          * @return Fax number
264          */
265         Long getFaxNumber ();
266
267         /**
268          * Setter for fax number
269          * <p>
270          * @param faxNumber Fax number
271          */
272         void setFaxNumber (final Long faxNumber);
273
274         /**
275          * First name
276          * <p>
277          * @return the first name
278          */
279         String getFirstName ();
280
281         /**
282          * First name
283          * <p>
284          * @param firstName the first name to set
285          */
286         void setFirstName (final String firstName);
287
288         /**
289          * Gender of the contact
290          * <p>
291          * @return the gender
292          */
293         Gender getGender ();
294
295         /**
296          * Gender of the contact
297          * <p>
298          * @param gender the gender to set
299          */
300         void setGender (final Gender gender);
301
302         /**
303          * House number
304          * <p>
305          * @return the houseNumber
306          */
307         Short getHouseNumber ();
308
309         /**
310          * House number
311          * <p>
312          * @param houseNumber the houseNumber to set
313          */
314         void setHouseNumber (final Short houseNumber);
315
316         /**
317          * Getter for phone number's area code
318          * <p>
319          * @return Phone number's area code
320          */
321         Integer getPhoneAreaCode ();
322
323         /**
324          * Setter for phone number's area code
325          * <p>
326          * @param phoneAreaCode Phone number's area code
327          */
328         void setPhoneAreaCode (final Integer phoneAreaCode);
329
330         /**
331          * Getter for phone number's country instance
332          * <p>
333          * @return Phone number's country instance
334          */
335         Country getPhoneCountry ();
336
337         /**
338          * Setter for phone number's country instance
339          * <p>
340          * @param phoneCountry Phone number's country instance
341          */
342         void setPhoneCountry (final Country phoneCountry);
343
344         /**
345          * Getter for phone number
346          * <p>
347          * @return Phone number
348          */
349         Long getPhoneNumber ();
350
351         /**
352          * Setter for phone number
353          * <p>
354          * @param phoneNumber Phone number
355          */
356         void setPhoneNumber (final Long phoneNumber);
357
358         /**
359          * Street
360          * <p>
361          * @return the street
362          */
363         String getStreet ();
364
365         /**
366          * Street
367          * <p>
368          * @param street the street to set
369          */
370         void setStreet (final String street);
371
372         /**
373          * Getter for user id
374          * <p>
375          * @return User id
376          */
377         Long getUserId ();
378
379         /**
380          * Setter for user id
381          * <p>
382          * @param userId User id
383          */
384         void setUserId (final Long userId);
385
386         /**
387          * Getter for user name
388          * <p>
389          * @return User name
390          */
391         String getUserName ();
392
393         /**
394          * Setter for user name
395          * <p>
396          * @param userName User name
397          */
398         void setUserName (final String userName);
399
400         /**
401          * Getter for unencrypted user password
402          * <p>
403          * @return Unencrypted user password
404          */
405         String getUserPassword ();
406
407         /**
408          * Setter for unencrypted user password
409          * <p>
410          * @param userPassword Unencrypted user password
411          */
412         void setUserPassword (final String userPassword);
413
414         /**
415          * Getter for unencrypted user password repeated
416          * <p>
417          * @return Unencrypted user password repeated
418          */
419         String getUserPasswordRepeat ();
420
421         /**
422          * Setter for unencrypted user password repeated
423          * <p>
424          * @param userPasswordRepeat Unencrypted user password repeated
425          */
426         void setUserPasswordRepeat (final String userPasswordRepeat);
427
428         /**
429          * Getter for user profile mode
430          * <p>
431          * @return User profile mode
432          */
433         ProfileMode getUserProfileMode ();
434
435         /**
436          * Setter for user profile mode
437          * <p>
438          * @param userProfileMode User profile mode
439          */
440         void setUserProfileMode (final ProfileMode userProfileMode);
441
442         /**
443          * ZIP code
444          * <p>
445          * @return the zipCode
446          */
447         Integer getZipCode ();
448
449         /**
450          * ZIP code
451          * <p>
452          * @param zipCode the zipCode to set
453          */
454         void setZipCode (final Integer zipCode);
455
456         /**
457          * Checks whether user instance's email address is used
458          * <p>
459          * @param user User instance's email address to check
460          * <p>
461          * @return Whether it is already used
462          */
463         boolean isEmailAddressRegistered (final User user);
464
465         /**
466          * Checks whether all required personal data is set
467          * <p>
468          * @return Whether the required personal data is set
469          */
470         boolean isRequiredPersonalDataSet ();
471
472         /**
473          * Checks whether all required personal data is set for changing them
474          * <p>
475          * @return Whether the required personal data is set
476          */
477         boolean isRequiredChangePersonalDataSet ();
478
479         /**
480          * Checks whether same email addresses have been entered
481          * <p>
482          * @return Whether same email addresses have been entered
483          */
484         boolean isSameEmailAddressEntered ();
485
486         /**
487          * Checks whether same passwords has been entered
488          * <p>
489          * @return Whether same passwords has been entered
490          */
491         boolean isSamePasswordEntered ();
492
493         /**
494          * Checks whether given user instance's name is used
495          * <p>
496          * @param user User instance's name to check
497          * <p>
498          * @return Whether it is already used
499          */
500         boolean isUserNameRegistered (final User user);
501
502         /**
503          * Checks whether a public user account is registered. This means that at
504          * least one user profile has its flag "public user profile" enabled.
505          * <p>
506          * @return Whether at least one user has a public profile
507          */
508         boolean isVisibleUserFound ();
509
510         /**
511          * Checks if the user id is empty
512          * <p>
513          * @return Whether the user id is empty
514          */
515         boolean isUserIdEmpty ();
516 }