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