]> git.mxchange.org Git - jjobs-war.git/blob - src/java/org/mxchange/jjobs/beans/contact/JobsContactWebRequestController.java
f31b1f2fd6c1867229a7b0b965162c4c34128ef4
[jjobs-war.git] / src / java / org / mxchange / jjobs / beans / contact / JobsContactWebRequestController.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.jjobs.beans.contact;
18
19 import java.io.Serializable;
20 import java.util.List;
21 import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
22 import org.mxchange.jcontacts.model.contact.Contact;
23
24 /**
25  * An interface for user beans
26  * <p>
27  * @author Roland Häder<roland@mxchange.org>
28  */
29 public interface JobsContactWebRequestController 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          * Creates an instance from all properties
64          * <p>
65          * @return A contact instance
66          */
67         Contact createContactInstance ();
68
69         /**
70          * Getter for controller type
71          * <p>
72          * @return controller type
73          */
74         String getControllerType ();
75
76         /**
77          * Setter for controller type
78          * <p>
79          * @param controllerType Controller type
80          * <p>
81          * @deprecated Don't use this method.
82          */
83         @Deprecated
84         void setControllerType (final String controllerType);
85
86         /**
87          * Checks whether contact instance's email address is used
88          * <p>
89          * @param contact Contact instance's email address to check
90          * <p>
91          * @return Whether it is already used
92          */
93         boolean isEmailAddressRegistered (final Contact contact);
94
95         /**
96          * Checks whether all required personal data is set
97          * <p>
98          * @return Whether the required personal data is set
99          */
100         boolean isRequiredPersonalDataSet ();
101
102         /**
103          * Checks whether all required personal data is set for changing them
104          * <p>
105          * @return Whether the required personal data is set
106          */
107         boolean isRequiredChangePersonalDataSet ();
108
109         /**
110          * Checks whether same email addresses have been entered
111          * <p>
112          * @return Whether same email addresses have been entered
113          */
114         boolean isSameEmailAddressEntered ();
115
116         /**
117          * Changes logged-in user's personal data if the current password matches
118          * and TAC + privacy statement has been accepted.
119          * <p>
120          * @return New target page
121          */
122         String doChangePersonalContactData ();
123
124         /**
125          * Returns a contact instance which has the given id number.
126          * <p>
127          * @param contactId Contact id
128          * <p>
129          * @return Contact instance
130          * <p>
131          * @throws ContactNotFoundException If the contact was not found
132          */
133         Contact findContactById (final Long contactId) throws ContactNotFoundException;
134
135         /**
136          * Checks whether the given email address is already registered. The email
137          * address should be validated by EmailAddressValidator before calling this
138          * method.
139          * <p>
140          * @param emailAddress Email address to check
141          * <p>
142          * @return Whether the email address is already registered
143          */
144         boolean isEmailAddressRegistered (final String emailAddress);
145
146 }