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