]> git.mxchange.org Git - jfinancials-swing.git/blob - Addressbook/src/org/mxchange/addressbook/database/frontend/BaseDatabaseFrontend.java
Added a lot trace messages + sanity checks for null references and such things
[jfinancials-swing.git] / Addressbook / src / org / mxchange / addressbook / database / frontend / BaseDatabaseFrontend.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.database.frontend;
18
19 import org.mxchange.addressbook.BaseFrameworkSystem;
20 import org.mxchange.addressbook.database.backend.DatabaseBackend;
21 import org.mxchange.addressbook.database.backend.csv.Base64CsvDatabaseBackend;
22
23 /**
24  * General database frontend class
25  *
26  * @author Roland Haeder
27  */
28 public class BaseDatabaseFrontend extends BaseFrameworkSystem {
29
30         /**
31          * Instance for database backend
32          */
33         private DatabaseBackend backend;
34
35         /**
36          * No instances from this class
37          */
38         protected BaseDatabaseFrontend () {
39         }
40
41         /**
42          * Instance for database backend
43          *
44          * @return the backend
45          */
46         protected final DatabaseBackend getBackend () {
47                 return this.backend;
48         }
49
50         /**
51          * Instance for database backend
52          *
53          * @param backend the backend to set
54          */
55         protected final void setBackend (final DatabaseBackend backend) {
56                 this.backend = backend;
57         }
58
59         /**
60          * Initialize backend
61          */
62         protected void initBackend () {
63                 // Trace message
64                 this.getLogger().trace("CALLED!"); //NOI18N
65
66                 // Instance backend
67                 this.backend = new Base64CsvDatabaseBackend(this.getTableName());
68
69                 // Trace message
70                 this.getLogger().trace("EXIT!"); //NOI18N
71         }
72 }