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