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