2 * Copyright (C) 2016, 2017 Roland Häder
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.
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.
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/>.
17 package org.mxchange.pizzaapplication.beans.contact;
19 import java.io.Serializable;
20 import java.util.List;
21 import org.mxchange.jcontacts.model.contact.Contact;
24 * An interface for user beans
26 * @author Roland Häder<roland@mxchange.org>
28 public interface PizzaContactWebSessionController extends Serializable {
31 * Minimum password length
33 public static final Integer MINIMUM_PASSWORD_LENGTH = 5;
36 * Getter for email address
38 * @return Email address
40 String getEmailAddress ();
43 * Clears both email address field
45 void clearEmailAddresses ();
48 * Returns a list of all found contacts
50 * @return A list of all contacts.
52 List<Contact> allContacts ();
55 * Updates all data from bean in given contact instance
57 * @param userContact Contact instance to update
59 void updateContactDataFromController (final Contact userContact);
62 * Creates an instance from all properties
64 * @return A contact instance
66 Contact createContactInstance ();
69 * Getter for controller type
71 * @return controller type
73 String getControllerType ();
76 * Setter for controller type
78 * @param controllerType Controller type
80 * @deprecated Don't use this method.
83 void setControllerType (final String controllerType);
86 * Checks whether contact instance's email address is used
88 * @param contact Contact instance's email address to check
90 * @return Whether it is already used
92 boolean isEmailAddressRegistered (final Contact contact);
95 * Checks whether all required personal data is set
97 * @return Whether the required personal data is set
99 boolean isRequiredPersonalDataSet ();
102 * Checks whether all required personal data is set for changing them
104 * @return Whether the required personal data is set
106 boolean isRequiredChangePersonalDataSet ();
109 * Checks whether same email addresses have been entered
111 * @return Whether same email addresses have been entered
113 boolean isSameEmailAddressEntered ();
116 * Changes logged-in user's personal data if the current password matches
117 * and TAC + privacy statement has been accepted.
119 * @return New target page
121 String doChangePersonalContactData ();