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