1
|
/**
|
2
|
* Copyright (C) 2014 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.cdm.config;
|
10
|
|
11
|
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
|
12
|
|
13
|
/**
|
14
|
* Abstract class representing the base CDM Source object.
|
15
|
*
|
16
|
*
|
17
|
*/
|
18
|
public abstract class CdmSource implements ICdmSource {
|
19
|
|
20
|
private String name;
|
21
|
private String server;
|
22
|
private int port;
|
23
|
private NomenclaturalCode nomenclaturalCode;
|
24
|
|
25
|
public static final int NULL_PORT = -1;
|
26
|
|
27
|
public static final String DEFAULT_ENTRY = "-";
|
28
|
|
29
|
/**
|
30
|
* Sets the CDM Source name
|
31
|
*
|
32
|
* @param name
|
33
|
*/
|
34
|
@Override
|
35
|
public void setName(String name) {
|
36
|
this.name = name;
|
37
|
}
|
38
|
|
39
|
/**
|
40
|
* Sets the CDM Source server
|
41
|
*
|
42
|
* @param server
|
43
|
*/
|
44
|
@Override
|
45
|
public void setServer(String server) {
|
46
|
this.server = server;
|
47
|
}
|
48
|
|
49
|
/**
|
50
|
* Sets the CDM Source port
|
51
|
*
|
52
|
* @param port
|
53
|
*/
|
54
|
@Override
|
55
|
public void setPort(int port) {
|
56
|
this.port = port;
|
57
|
}
|
58
|
|
59
|
/**
|
60
|
* Sets the CDM Source {@link NomenclaturalCode}
|
61
|
*
|
62
|
* @param nomenclaturalCode
|
63
|
*/
|
64
|
@Override
|
65
|
public void setNomenclaturalCode(NomenclaturalCode nomenclaturalCode) {
|
66
|
this.nomenclaturalCode = nomenclaturalCode;
|
67
|
}
|
68
|
|
69
|
|
70
|
/* (non-Javadoc)
|
71
|
* @see eu.etaxonomy.cdm.config.ICdmSource#getName()
|
72
|
*/
|
73
|
@Override
|
74
|
public String getName() {
|
75
|
return this.name;
|
76
|
}
|
77
|
|
78
|
/* (non-Javadoc)
|
79
|
* @see eu.etaxonomy.cdm.config.ICdmSource#getServer()
|
80
|
*/
|
81
|
@Override
|
82
|
public String getServer() {
|
83
|
return this.server;
|
84
|
}
|
85
|
|
86
|
/* (non-Javadoc)
|
87
|
* @see eu.etaxonomy.cdm.config.ICdmSource#getPort()
|
88
|
*/
|
89
|
@Override
|
90
|
public int getPort() {
|
91
|
return this.port;
|
92
|
}
|
93
|
|
94
|
/* (non-Javadoc)
|
95
|
* @see eu.etaxonomy.cdm.config.ICdmSource#getNomenclaturalCode()
|
96
|
*/
|
97
|
@Override
|
98
|
public NomenclaturalCode getNomenclaturalCode() {
|
99
|
return this.nomenclaturalCode;
|
100
|
}
|
101
|
|
102
|
/* (non-Javadoc)
|
103
|
* @see eu.etaxonomy.cdm.config.ICdmSource#getDbSchemaVersion()
|
104
|
*/
|
105
|
@Override
|
106
|
public abstract String getDbSchemaVersion() throws CdmSourceException;
|
107
|
|
108
|
/* (non-Javadoc)
|
109
|
* @see eu.etaxonomy.cdm.config.ICdmSource#isDbEmpty()
|
110
|
*/
|
111
|
@Override
|
112
|
public abstract boolean isDbEmpty() throws CdmSourceException;
|
113
|
|
114
|
/* (non-Javadoc)
|
115
|
* @see eu.etaxonomy.cdm.config.ICdmSource#checkConnection()
|
116
|
*/
|
117
|
@Override
|
118
|
public abstract boolean checkConnection() throws CdmSourceException;
|
119
|
|
120
|
/* (non-Javadoc)
|
121
|
* @see eu.etaxonomy.cdm.config.ICdmSource#getConnectionMessage()
|
122
|
*/
|
123
|
@Override
|
124
|
public abstract String getConnectionMessage();
|
125
|
|
126
|
/* (non-Javadoc)
|
127
|
* @see eu.etaxonomy.cdm.config.ICdmSource#closeOpenConnections()
|
128
|
*/
|
129
|
@Override
|
130
|
public void closeOpenConnections() {
|
131
|
|
132
|
}
|
133
|
|
134
|
}
|