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