]> git.mxchange.org Git - jjobs-war.git/blob - src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionController.java
8104d56164a05a1183005e1355eba31d6cb35bcb
[jjobs-war.git] / src / java / org / mxchange / jjobs / beans / contact / JobsContactWebSessionController.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.contact;
18
19 import java.io.Serializable;
20 import java.util.Date;
21 import java.util.List;
22 import javax.ejb.Local;
23 import org.mxchange.jcontacts.contact.Contact;
24 import org.mxchange.jcontacts.contact.gender.Gender;
25 import org.mxchange.jcontacts.events.contact.add.AdminAddedContactEvent;
26 import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent;
27 import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
28 import org.mxchange.jcountry.data.Country;
29 import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
30 import org.mxchange.jusercore.events.confirmation.UserConfirmedAccountEvent;
31 import org.mxchange.jusercore.events.login.UserLoggedInEvent;
32 import org.mxchange.jusercore.events.registration.UserRegisteredEvent;
33 import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
34 import org.mxchange.jusercore.events.user.linked.AdminLinkedUserEvent;
35
36 /**
37  * An interface for user beans
38  * <p>
39  * @author Roland Haeder<roland@mxchange.org>
40  */
41 @Local
42 public interface JobsContactWebSessionController extends Serializable {
43
44         /**
45          * Returns a list of all found contacts
46          * <p>
47          * @return A list of all contacts.
48          */
49         List<Contact> allContacts ();
50
51         /**
52          * Event observer for newly added users by adminstrator
53          * <p>
54          * @param event Event being fired
55          */
56         void afterAdminAddedUserEvent (final AdminAddedUserEvent event);
57
58         /**
59          * Event observer when user confirmed account.
60          * <p>
61          * @param event Event being fired
62          */
63         void afterUserConfirmedAccount (final UserConfirmedAccountEvent event);
64
65         /**
66          * Updates all data from bean in given contact instance
67          * <p>
68          * @param userContact Contact instance to update
69          */
70         void updateContactDataFromController (final Contact userContact);
71
72         /**
73          * Tries to lookup contact by given id number. If the user is not found a
74          * proper exceptions are thrown.
75          * <p>
76          * @param contactId Contact id
77          * <p>
78          * @return Contact instance
79          * <p>
80          * @throws ContactNotFoundException If the user is not found
81          */
82         Contact lookupContactById (final Long contactId) throws ContactNotFoundException;
83
84         /**
85          * Event observer for new user registrations
86          * <p>
87          * @param event User registration event
88          */
89         void afterRegistrationEvent (final UserRegisteredEvent event);
90
91         /**
92          * Observes events being fired when an administrator has added a new
93          * contact.
94          * <p>
95          * @param event Event being fired
96          */
97         void afterAdminAddedContact (final AdminAddedContactEvent event);
98
99         /**
100          * Observes events being fired when an administrator has linked a new user
101          * with existing contact data.
102          * <p>
103          * @param event Event being fired
104          */
105         void afterAdminLinkedUser (final AdminLinkedUserEvent event);
106
107         /**
108          * Event observer for updated contact data by administrators
109          * <p>
110          * @param event Updated contact data event
111          */
112         void afterAdminUpdatedContactDataEvent (final AdminUpdatedContactEvent event);
113
114         /**
115          * Event observer for logged-in user
116          * <p>
117          * @param event Event instance
118          */
119         void afterUserLogin (final UserLoggedInEvent event);
120
121         /**
122          * Creates an instance from all properties
123          * <p>
124          * @return A contact instance
125          */
126         Contact createContactInstance ();
127
128         /**
129          * Getter for birth day
130          * <p>
131          * @return Birth day
132          */
133         Date getBirthday ();
134
135         /**
136          * Setter for birth day
137          * <p>
138          * @param birthday Birth day
139          */
140         void setBirthday (final Date birthday);
141
142         /**
143          * Getter for ellphone number's carrier
144          * <p>
145          * @return Cellphone number's carrier
146          */
147         MobileProvider getCellphoneCarrier ();
148
149         /**
150          * Setter for cellphone number's carrier prefix
151          * <p>
152          * @param cellphoneCarrier Cellphone number's carrier prefix
153          */
154         void setCellphoneCarrier (final MobileProvider cellphoneCarrier);
155
156         /**
157          * Getter for ellphone number
158          * <p>
159          * @return Cellphone number
160          */
161         Long getCellphoneNumber ();
162
163         /**
164          * Setter for ellphone number
165          * <p>
166          * @param cellphoneNumber Cellphone number
167          */
168         void setCellphoneNumber (final Long cellphoneNumber);
169
170         /**
171          * City
172          * <p>
173          * @return the city
174          */
175         String getCity ();
176
177         /**
178          * City
179          * <p>
180          * @param city the city to set
181          */
182         void setCity (final String city);
183
184         /**
185          * Getter for comments
186          * <p>
187          * @return Comments
188          */
189         String getComment ();
190
191         /**
192          * Setter for comment
193          * <p>
194          * @param comment Comments
195          */
196         void setComment (final String comment);
197
198         /**
199          * Getter for country instance
200          * <p>
201          * @return Country instance
202          */
203         Country getCountry ();
204
205         /**
206          * Setter for country instance
207          * <p>
208          * @param country Country instance
209          */
210         void setCountry (final Country country);
211
212         /**
213          * Getter for email address
214          * <p>
215          * @return Email address
216          */
217         String getEmailAddress ();
218
219         /**
220          * Setter for email address
221          * <p>
222          * @param emailAddress Email address
223          */
224         void setEmailAddress (final String emailAddress);
225
226         /**
227          * Getter for email address, repeated
228          * <p>
229          * @return the emailAddress, repeated
230          */
231         String getEmailAddressRepeat ();
232
233         /**
234          * Setter for email address repeated
235          * <p>
236          * @param emailAddressRepeat the emailAddress to set
237          */
238         void setEmailAddressRepeat (final String emailAddressRepeat);
239
240         /**
241          * Family name
242          * <p>
243          * @return the familyName
244          */
245         String getFamilyName ();
246
247         /**
248          * Family name
249          * <p>
250          * @param familyName the familyName to set
251          */
252         void setFamilyName (final String familyName);
253
254         /**
255          * Getter for fax number's area code
256          * <p>
257          * @return Fax number's area code
258          */
259         Integer getFaxAreaCode ();
260
261         /**
262          * Setter for fax number's area code
263          * <p>
264          * @param faxAreaCode Fax number's area code
265          */
266         void setFaxAreaCode (final Integer faxAreaCode);
267
268         /**
269          * Getter for fax's country instance
270          * <p>
271          * @return Fax' country instance
272          */
273         Country getFaxCountry ();
274
275         /**
276          * Setter for fax's country instance
277          * <p>
278          * @param faxCountry Fax' country instance
279          */
280         void setFaxCountry (final Country faxCountry);
281
282         /**
283          * Getter for fax number
284          * <p>
285          * @return Fax number
286          */
287         Long getFaxNumber ();
288
289         /**
290          * Setter for fax number
291          * <p>
292          * @param faxNumber Fax number
293          */
294         void setFaxNumber (final Long faxNumber);
295
296         /**
297          * First name
298          * <p>
299          * @return the first name
300          */
301         String getFirstName ();
302
303         /**
304          * First name
305          * <p>
306          * @param firstName the first name to set
307          */
308         void setFirstName (final String firstName);
309
310         /**
311          * Gender of the contact
312          * <p>
313          * @return the gender
314          */
315         Gender getGender ();
316
317         /**
318          * Gender of the contact
319          * <p>
320          * @param gender the gender to set
321          */
322         void setGender (final Gender gender);
323
324         /**
325          * House number
326          * <p>
327          * @return the houseNumber
328          */
329         Short getHouseNumber ();
330
331         /**
332          * House number
333          * <p>
334          * @param houseNumber the houseNumber to set
335          */
336         void setHouseNumber (final Short houseNumber);
337
338         /**
339          * Getter for house number extension, example: 123a 'a' is then the
340          * extension and 123 is the house number.
341          * <p>
342          * @return House number extension
343          */
344         String getHouseNumberExtension ();
345
346         /**
347          * Setter for house number extension
348          * <p>
349          * @param houseNumberExtension House number extension
350          */
351         void setHouseNumberExtension (final String houseNumberExtension);
352
353         /**
354          * Getter for phone number's area code
355          * <p>
356          * @return Phone number's area code
357          */
358         Integer getPhoneAreaCode ();
359
360         /**
361          * Setter for phone number's area code
362          * <p>
363          * @param phoneAreaCode Phone number's area code
364          */
365         void setPhoneAreaCode (final Integer phoneAreaCode);
366
367         /**
368          * Getter for phone number's country instance
369          * <p>
370          * @return Phone number's country instance
371          */
372         Country getPhoneCountry ();
373
374         /**
375          * Setter for phone number's country instance
376          * <p>
377          * @param phoneCountry Phone number's country instance
378          */
379         void setPhoneCountry (final Country phoneCountry);
380
381         /**
382          * Getter for phone number
383          * <p>
384          * @return Phone number
385          */
386         Long getPhoneNumber ();
387
388         /**
389          * Setter for phone number
390          * <p>
391          * @param phoneNumber Phone number
392          */
393         void setPhoneNumber (final Long phoneNumber);
394
395         /**
396          * Street
397          * <p>
398          * @return the street
399          */
400         String getStreet ();
401
402         /**
403          * Street
404          * <p>
405          * @param street the street to set
406          */
407         void setStreet (final String street);
408
409         /**
410          * Titöe
411          * <p>
412          * @return the title
413          */
414         String getTitle ();
415
416         /**
417          * Title
418          * <p>
419          * @param title the title to set
420          */
421         void setTitle (final String title);
422
423         /**
424          * ZIP code
425          * <p>
426          * @return the zipCode
427          */
428         Integer getZipCode ();
429
430         /**
431          * ZIP code
432          * <p>
433          * @param zipCode the zipCode to set
434          */
435         void setZipCode (final Integer zipCode);
436
437         /**
438          * Getter for controller type
439          * <p>
440          * @return controller type
441          */
442         String getControllerType ();
443
444         /**
445          * Setter for controller type
446          * <p>
447          * @param controllerType Controller type
448          * @deprecated Don't use this method.
449          */
450         @Deprecated
451         void setControllerType (final String controllerType);
452
453         /**
454          * Checks whether contact instance's email address is used
455          * <p>
456          * @param contact Contact instance's email address to check
457          * <p>
458          * @return Whether it is already used
459          */
460         boolean isEmailAddressRegistered (final Contact contact);
461
462         /**
463          * Checks whether all required personal data is set
464          * <p>
465          * @return Whether the required personal data is set
466          */
467         boolean isRequiredPersonalDataSet ();
468
469         /**
470          * Checks whether all required personal data is set for changing them
471          * <p>
472          * @return Whether the required personal data is set
473          */
474         boolean isRequiredChangePersonalDataSet ();
475
476         /**
477          * Checks whether same email addresses have been entered
478          * <p>
479          * @return Whether same email addresses have been entered
480          */
481         boolean isSameEmailAddressEntered ();
482
483         /**
484          * Changes logged-in user's personal data if the current password matches
485          * and TAC + privacy statement has been accepted.
486          * <p>
487          * @return New target page
488          */
489         String doChangePersonalContactData ();
490
491         /**
492          * Returns a list of all selectable contacts for user creation. Contacts
493          * from already existing users are excluded in this list.
494          * <p>
495          * @return A list of all selectable contacts
496          */
497         List<Contact> selectableContacts ();
498
499 }