]> git.mxchange.org Git - jjobs-war.git/blob - src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionController.java
renamed files to make difference to other war-projects
[jjobs-war.git] / src / java / org / mxchange / jjobs / beans / user / JobsUserWebSessionController.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.jjobs.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 JobsUserWebSessionController 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, repeated
178          * <p>
179          * @return the emailAddress, repeated
180          */
181         String getEmailAddressRepeat ();
182
183         /**
184          * Setter for email address repeated
185          * <p>
186          * @param emailAddressRepeat the emailAddress to set
187          */
188         void setEmailAddressRepeat (final String emailAddressRepeat);
189
190         /**
191          * Family name
192          * <p>
193          * @return the familyName
194          */
195         String getFamilyName ();
196
197         /**
198          * Family name
199          * <p>
200          * @param familyName the familyName to set
201          */
202         void setFamilyName (final String familyName);
203
204         /**
205          * Getter for fax number's area code
206          * <p>
207          * @return Fax number's area code
208          */
209         Integer getFaxAreaCode ();
210
211         /**
212          * Setter for fax number's area code
213          * <p>
214          * @param faxAreaCode Fax number's area code
215          */
216         void setFaxAreaCode (final Integer faxAreaCode);
217
218         /**
219          * Getter for fax's country instance
220          * <p>
221          * @return Fax' country instance
222          */
223         Country getFaxCountry ();
224
225         /**
226          * Setter for fax's country instance
227          * <p>
228          * @param faxCountry Fax' country instance
229          */
230         void setFaxCountry (final Country faxCountry);
231
232         /**
233          * Getter for fax number
234          * <p>
235          * @return Fax number
236          */
237         Long getFaxNumber ();
238
239         /**
240          * Setter for fax number
241          * <p>
242          * @param faxNumber Fax number
243          */
244         void setFaxNumber (final Long faxNumber);
245
246         /**
247          * First name
248          * <p>
249          * @return the first name
250          */
251         String getFirstName ();
252
253         /**
254          * First name
255          * <p>
256          * @param firstName the first name to set
257          */
258         void setFirstName (final String firstName);
259
260         /**
261          * Gender of the contact
262          * <p>
263          * @return the gender
264          */
265         Gender getGender ();
266
267         /**
268          * Gender of the contact
269          * <p>
270          * @param gender the gender to set
271          */
272         void setGender (final Gender gender);
273
274         /**
275          * House number
276          * <p>
277          * @return the houseNumber
278          */
279         Short getHouseNumber ();
280
281         /**
282          * House number
283          * <p>
284          * @param houseNumber the houseNumber to set
285          */
286         void setHouseNumber (final Short houseNumber);
287
288         /**
289          * Getter for phone number's area code
290          * <p>
291          * @return Phone number's area code
292          */
293         Integer getPhoneAreaCode ();
294
295         /**
296          * Setter for phone number's area code
297          * <p>
298          * @param phoneAreaCode Phone number's area code
299          */
300         void setPhoneAreaCode (final Integer phoneAreaCode);
301
302         /**
303          * Getter for phone number's country instance
304          * <p>
305          * @return Phone number's country instance
306          */
307         Country getPhoneCountry ();
308
309         /**
310          * Setter for phone number's country instance
311          * <p>
312          * @param phoneCountry Phone number's country instance
313          */
314         void setPhoneCountry (final Country phoneCountry);
315
316         /**
317          * Getter for phone number
318          * <p>
319          * @return Phone number
320          */
321         Long getPhoneNumber ();
322
323         /**
324          * Setter for phone number
325          * <p>
326          * @param phoneNumber Phone number
327          */
328         void setPhoneNumber (final Long phoneNumber);
329
330         /**
331          * Street
332          * <p>
333          * @return the street
334          */
335         String getStreet ();
336
337         /**
338          * Street
339          * <p>
340          * @param street the street to set
341          */
342         void setStreet (final String street);
343
344         /**
345          * Getter for user id
346          * <p>
347          * @return User id
348          */
349         Long getUserId ();
350
351         /**
352          * Setter for user id
353          * <p>
354          * @param userId User id
355          */
356         void setUserId (final Long userId);
357
358         /**
359          * Getter for user name
360          * <p>
361          * @return User name
362          */
363         String getUserName ();
364
365         /**
366          * Setter for user name
367          * <p>
368          * @param userName User name
369          */
370         void setUserName (final String userName);
371
372         /**
373          * Getter for unencrypted user password
374          * <p>
375          * @return Unencrypted user password
376          */
377         String getUserPassword ();
378
379         /**
380          * Setter for unencrypted user password
381          * <p>
382          * @param userPassword Unencrypted user password
383          */
384         void setUserPassword (final String userPassword);
385
386         /**
387          * Getter for unencrypted user password repeated
388          * <p>
389          * @return Unencrypted user password repeated
390          */
391         String getUserPasswordRepeat ();
392
393         /**
394          * Setter for unencrypted user password repeated
395          * <p>
396          * @param userPasswordRepeat Unencrypted user password repeated
397          */
398         void setUserPasswordRepeat (final String userPasswordRepeat);
399
400         /**
401          * Getter for user profile mode
402          * <p>
403          * @return User profile mode
404          */
405         ProfileMode getUserProfileMode ();
406
407         /**
408          * Setter for user profile mode
409          * <p>
410          * @param userProfileMode User profile mode
411          */
412         void setUserProfileMode (final ProfileMode userProfileMode);
413
414         /**
415          * ZIP code
416          * <p>
417          * @return the zipCode
418          */
419         Integer getZipCode ();
420
421         /**
422          * ZIP code
423          * <p>
424          * @param zipCode the zipCode to set
425          */
426         void setZipCode (final Integer zipCode);
427
428         /**
429          * Checks whether user instance's email address is used
430          * <p>
431          * @param user User instance's email address to check
432          * <p>
433          * @return Whether it is already used
434          */
435         boolean isEmailAddressRegistered (final User user);
436
437         /**
438          * Checks whether all required personal data is set
439          * <p>
440          * @return Whether the required personal data is set
441          */
442         boolean isRequiredPersonalDataSet ();
443
444         /**
445          * Checks whether all required personal data is set for changing them
446          * <p>
447          * @return Whether the required personal data is set
448          */
449         boolean isRequiredChangePersonalDataSet ();
450
451         /**
452          * Checks whether same email addresses have been entered
453          * <p>
454          * @return Whether same email addresses have been entered
455          */
456         boolean isSameEmailAddressEntered ();
457
458         /**
459          * Checks whether same passwords has been entered
460          * <p>
461          * @return Whether same passwords has been entered
462          */
463         boolean isSamePasswordEntered ();
464
465         /**
466          * Checks whether given user instance's name is used
467          * <p>
468          * @param user User instance's name to check
469          * <p>
470          * @return Whether it is already used
471          */
472         boolean isUserNameRegistered (final User user);
473
474         /**
475          * Checks whether a public user account is registered. This means that at
476          * least one user profile has its flag "public user profile" enabled.
477          * <p>
478          * @return Whether at least one user has a public profile
479          */
480         boolean isVisibleUserFound ();
481
482         /**
483          * Checks if the user id is empty
484          * <p>
485          * @return Whether the user id is empty
486          */
487         boolean isUserIdEmpty ();
488
489         /**
490          * Changes logged-in user's personal data if the current password matches
491          * and TAC + privacy statement has been accepted.
492          * <p>
493          * @return New target page
494          */
495         String doChangePersonalData ();
496 }