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