]> 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, 2017 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.List;
21 import org.mxchange.jcontacts.contact.Contact;
22 import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
23
24 /**
25  * An interface for user beans
26  * <p>
27  * @author Roland Häder<roland@mxchange.org>
28  */
29 public interface PizzaContactWebSessionController extends Serializable {
30
31         /**
32          * Minimum password length
33          */
34         public static final Integer MINIMUM_PASSWORD_LENGTH = 5;
35
36         /**
37          * Getter for email address
38          * <p>
39          * @return Email address
40          */
41         String getEmailAddress ();
42
43         /**
44          * Clears both email address field
45          */
46         void clearEmailAddresses ();
47
48         /**
49          * Returns a list of all found contacts
50          * <p>
51          * @return A list of all contacts.
52          */
53         List<Contact> allContacts ();
54
55         /**
56          * Updates all data from bean in given contact instance
57          * <p>
58          * @param userContact Contact instance to update
59          */
60         void updateContactDataFromController (final Contact userContact);
61
62         /**
63          * Tries to lookup contact by given id number. If the user is not found a
64          * proper exceptions are thrown.
65          * <p>
66          * @param contactId Contact id
67          * <p>
68          * @return Contact instance
69          * <p>
70          * @throws ContactNotFoundException If the user is not found
71          */
72         Contact lookupContactById (final Long contactId) throws ContactNotFoundException;
73
74         /**
75          * Creates an instance from all properties
76          * <p>
77          * @return A contact instance
78          */
79         Contact createContactInstance ();
80
81         /**
82          * Getter for controller type
83          * <p>
84          * @return controller type
85          */
86         String getControllerType ();
87
88         /**
89          * Setter for controller type
90          * <p>
91          * @param controllerType Controller type
92          * <p>
93          * @deprecated Don't use this method.
94          */
95         @Deprecated
96         void setControllerType (final String controllerType);
97
98         /**
99          * Checks whether contact instance's email address is used
100          * <p>
101          * @param contact Contact instance's email address to check
102          * <p>
103          * @return Whether it is already used
104          */
105         boolean isEmailAddressRegistered (final Contact contact);
106
107         /**
108          * Checks whether all required personal data is set
109          * <p>
110          * @return Whether the required personal data is set
111          */
112         boolean isRequiredPersonalDataSet ();
113
114         /**
115          * Checks whether all required personal data is set for changing them
116          * <p>
117          * @return Whether the required personal data is set
118          */
119         boolean isRequiredChangePersonalDataSet ();
120
121         /**
122          * Checks whether same email addresses have been entered
123          * <p>
124          * @return Whether same email addresses have been entered
125          */
126         boolean isSameEmailAddressEntered ();
127
128         /**
129          * Changes logged-in user's personal data if the current password matches
130          * and TAC + privacy statement has been accepted.
131          * <p>
132          * @return New target page
133          */
134         String doChangePersonalContactData ();
135
136         /**
137          * Returns a list of all selectable contacts for user creation. Contacts
138          * from already existing users are excluded in this list.
139          * <p>
140          * @return A list of all selectable contacts
141          */
142         List<Contact> selectableContacts ();
143
144 }