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