]> git.mxchange.org Git - jfinancials-swing.git/blob - Addressbook/src/org/mxchange/addressbook/database/frontend/contact/AddressbookContactFrontend.java
Renamed some classes/interfaces to make it clear they belong only to this project...
[jfinancials-swing.git] / Addressbook / src / org / mxchange / addressbook / database / frontend / contact / AddressbookContactFrontend.java
1 /*
2  * Copyright (C) 2015 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 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.database.frontend.contact;
18
19 import java.sql.SQLException;
20 import org.mxchange.addressbook.exceptions.ContactAlreadyAddedException;
21 import org.mxchange.jcore.contact.Contact;
22 import org.mxchange.jcore.database.frontend.DatabaseFrontend;
23 import org.mxchange.jcore.exceptions.BadTokenException;
24
25 /**
26  *
27  * @author Roland Häder
28  */
29 public interface AddressbookContactFrontend extends DatabaseFrontend {
30
31         /**
32          * Adds given contact instance to database
33          *
34          * @param contact Contact instance to add
35          * @throws org.mxchange.addressbook.exceptions.ContactAlreadyAddedException If the contact is already added
36          */
37         public void addContact (final Contact contact) throws ContactAlreadyAddedException;
38
39         /**
40          * Shuts down the database layer
41          */
42         public void doShutdown ();
43
44         /**
45          * Some "getter" for total contacts count
46          *
47          * @return Total contacts count
48          * @throws java.sql.SQLException If any SQL error occurs
49          */
50         public int getContactsCount () throws SQLException;
51
52         /**
53          * Checks if given Contact is found
54          * 
55          * @param contact Contact instance to check
56          * @return Whether the given Contact instance is found
57          * @throws org.mxchange.jcore.exceptions.BadTokenException Continued throw
58          */
59         public boolean isContactFound (final Contact contact) throws BadTokenException;
60
61         /**
62          * Some "getter" for own contact instance
63          *
64          * @return Own contact instance
65          */
66         public Contact getOwnContact ();
67
68         /**
69          * Checks whether own contact is found
70          * 
71          * @return Whether own contact is found
72          * @throws java.sql.SQLException If any SQL error occurs
73          */
74         public boolean isOwnContactFound () throws SQLException;
75
76         /**
77          * Reads a single row and parses it to a contact instance
78          *
79          * @param rowIndex Row index (also how much to skip)
80          * @return Contact instance
81          */
82         public Contact readSingleContact (final int rowIndex);
83 }