]> git.mxchange.org Git - addressbook-lib.git/blob - src/org/mxchange/addressbook/manager/contact/ManageableAddressbookContact.java
More cleanup from TDGP usage and towards EJB
[addressbook-lib.git] / src / org / mxchange / addressbook / manager / contact / ManageableAddressbookContact.java
1 /*
2  * Copyright (C) 2015 Roland Haeder
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (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 General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17 package org.mxchange.addressbook.manager.contact;
18
19 import java.io.IOException;
20 import java.lang.reflect.InvocationTargetException;
21 import java.sql.SQLException;
22 import org.mxchange.addressbook.exceptions.ContactAlreadyAddedException;
23 import org.mxchange.jcore.contact.Contact;
24 import org.mxchange.jcore.contact.gender.Gender;
25 import org.mxchange.jcore.manager.database.ManageableDatabase;
26
27 /**
28  *
29  * @author Roland Haeder
30  */
31 public interface ManageableAddressbookContact extends ManageableDatabase {
32         /**
33          * Allows the user to enter own cellphone number.
34          *
35          * @return Cellphone number
36          */
37         public String enterOwnCellNumber ();
38
39         /**
40          * Allows the user to enter own city name.
41          *
42          * @return City name
43          */
44         public String enterOwnCity ();
45
46         /**
47          * Allows the user to enter comment for own entry.
48          *
49          * @return Comment
50          */
51         public String enterOwnComment ();
52
53         /**
54          * Allows the user to enter own company name.
55          *
56          * @return Company name
57          */
58         public String enterOwnCompanyName ();
59
60         /**
61          * Allows the user to enter own country code.
62          *
63          * @return Country code
64          */
65         public String enterOwnCountryCode ();
66
67         /**
68          * Allows the user to enter own email address.
69          *
70          * @return Email address
71          */
72         public String enterOwnEmailAddress ();
73
74         /**
75          * Allows the user to enter own family name.
76          *
77          * @return Family name
78          */
79         public String enterOwnFamilyName ();
80
81         /**
82          * Allows the user to enter own fax number.
83          *
84          * @return Fax number
85          */
86         public String enterOwnFaxNumber ();
87
88         /**
89          * Allows the user to enter own gender.
90          *
91          * @return Gender
92          */
93         public Gender enterOwnGender ();
94
95         /**
96          * Allows the user to enter own phone number.
97          *
98          * @return Phone number
99          */
100         public String enterOwnPhoneNumber ();
101
102         /**
103          * Allows the user to enter own street and house number.
104          *
105          * @return Street and house number
106          */
107         public String enterOwnStreet ();
108
109         /**
110          * Allows the user to enter own surname.
111          *
112          * @return Surname
113          */
114         public String enterOwnFirstName ();
115
116         /**
117          * Allows the user to enter own ZIP code.
118          *
119          * @return ZIP code
120          */
121         public int enterOwnZipCode ();
122
123         /**
124          * List all contacts
125          */
126         public void doListContacts ();
127
128         /**
129          * Adds given contact to address book
130          *
131          * @param contact Contact being added
132          * TODO Add check for book size
133          */
134         public void registerContact (final Contact contact);
135
136         /**
137          * Adds given Contact instance to list
138          *
139          * @param contact Contact instance to add
140          * @throws org.mxchange.addressbook.exceptions.ContactAlreadyAddedException If the contact is already added
141          */
142         public void addContact (final Contact contact) throws ContactAlreadyAddedException;
143
144         /**
145          * Let the user add a new other address
146          */
147         public void doAddOtherAddress ();
148
149         /**
150          * The user can change address data, like street, ZIP code, city and country
151          * of given Contact instance.
152          *
153          * @param contact Instance to change data
154          */
155         public void doChangeAddressData (final Contact contact);
156
157         /**
158          * The user can change name data, like gender, surname, family name and
159          * company name (if business contact).
160          *
161          * @param contact Instance to change data
162          */
163         public void doChangeNameData (final Contact contact);
164
165         /**
166          * Let the user change other address
167          */
168         public void doChangeOtherAddress ();
169
170         /**
171          * The user can change other data, like phone numbers or comments.
172          *
173          * @param contact Instance to change data
174          */
175         public void doChangeOtherData (final Contact contact);
176
177         /**
178          * Let the user change own data
179          * @throws java.sql.SQLException If an SQL error occurs
180          * @throws java.io.IOException If an IO error occurs
181          * @throws java.lang.NoSuchMethodException If a method cannot be found
182          * @throws java.lang.IllegalAccessException If a method is not accessible
183          * @throws java.lang.reflect.InvocationTargetException Any other problems?
184          */
185         public void doChangeOwnData () throws IOException , SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
186
187         /**
188          * Let the user delete other address
189          */
190         public void doDeleteOtherAddress ();
191
192         /**
193          * Asks user for own data
194          * @throws org.mxchange.addressbook.exceptions.ContactAlreadyAddedException If own contact is already added
195          * @throws java.io.IOException If an IO error was found
196          */
197         public void doEnterOwnData () throws ContactAlreadyAddedException, IOException;
198
199         /**
200          * Searches address book for a contact
201          */
202         public void doSearchContacts ();
203
204         /**
205          * Checks whether own contact is already added by checking all entries for
206          * isOwnContact flag
207          *
208          * @return Whether own contact is already added
209          * @throws java.io.IOException If an IO error occurs
210          */
211         public boolean isOwnContactAdded () throws IOException;
212 }