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