2 * Copyright (C) 2016 - 2020 Free Software Foundation
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.jjobs.beans.contact;
19 import java.io.Serializable;
20 import org.mxchange.jcontacts.model.contact.Contact;
23 * An interface for user beans
25 * @author Roland Häder<roland@mxchange.org>
27 public interface JobsContactWebRequestController extends Serializable {
30 * Minimum password length
32 public static final Integer MINIMUM_PASSWORD_LENGTH = 5;
35 * Getter for email address
37 * @return Email address
39 String getEmailAddress ();
42 * Clears both email address field
44 void clearEmailAddresses ();
47 * Updates all data from bean in given contact instance
49 * @param userContact Contact instance to update
51 void updateContactDataFromController (final Contact userContact);
54 * Creates an instance from all properties
56 * @return A contact instance
58 Contact createContactInstance ();
61 * Getter for controller type
63 * @return controller type
65 String getControllerType ();
68 * Setter for controller type
70 * @param controllerType Controller type
72 * @deprecated Don't use this method.
75 void setControllerType (final String controllerType);
78 * Checks whether contact instance's email address is used
80 * @param contact Contact instance's email address to check
82 * @return Whether it is already used
84 boolean isEmailAddressRegistered (final Contact contact);
87 * Checks whether all required personal data is set
89 * @return Whether the required personal data is set
91 boolean isRequiredPersonalDataSet ();
94 * Checks whether all required personal data is set for changing them
96 * @return Whether the required personal data is set
98 boolean isRequiredChangePersonalDataSet ();
101 * Checks whether same email addresses have been entered
103 * @return Whether same email addresses have been entered
105 boolean isSameEmailAddressEntered ();
108 * Changes logged-in user's personal data if the current password matches
109 * and TAC + privacy statement has been accepted.
111 * @return New target page
113 String doChangePersonalContactData ();
116 * Checks whether the given email address is already registered. The email
117 * address should be validated by EmailAddressValidator before calling this
120 * @param emailAddress Email address to check
122 * @return Whether the email address is already registered
124 boolean isEmailAddressRegistered (final String emailAddress);