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