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
|
/**
|
12
|
* Abstract class representing the base CDM Source object.
|
13
|
*/
|
14
|
public abstract class CdmSource implements ICdmSource {
|
15
|
|
16
|
private String name;
|
17
|
private String server;
|
18
|
private int port;
|
19
|
|
20
|
public static final int NULL_PORT = -1;
|
21
|
|
22
|
public static final String DEFAULT_ENTRY = "-";
|
23
|
|
24
|
/**
|
25
|
* Sets the CDM Source name
|
26
|
*
|
27
|
* @param name
|
28
|
*/
|
29
|
@Override
|
30
|
public void setName(String name) {
|
31
|
this.name = name;
|
32
|
}
|
33
|
|
34
|
/**
|
35
|
* Sets the CDM Source server
|
36
|
*
|
37
|
* @param server
|
38
|
*/
|
39
|
@Override
|
40
|
public void setServer(String server) {
|
41
|
this.server = server;
|
42
|
}
|
43
|
|
44
|
/**
|
45
|
* Sets the CDM Source port
|
46
|
*
|
47
|
* @param port
|
48
|
*/
|
49
|
@Override
|
50
|
public void setPort(int port) {
|
51
|
this.port = port;
|
52
|
}
|
53
|
|
54
|
@Override
|
55
|
public String getName() {
|
56
|
return this.name;
|
57
|
}
|
58
|
|
59
|
@Override
|
60
|
public String getServer() {
|
61
|
return this.server;
|
62
|
}
|
63
|
|
64
|
@Override
|
65
|
public int getPort() {
|
66
|
return this.port;
|
67
|
}
|
68
|
|
69
|
@Override
|
70
|
public abstract String getDbSchemaVersion() throws CdmSourceException;
|
71
|
|
72
|
@Override
|
73
|
public abstract boolean isDbEmpty() throws CdmSourceException;
|
74
|
|
75
|
@Override
|
76
|
public abstract boolean checkConnection() throws CdmSourceException;
|
77
|
|
78
|
@Override
|
79
|
public abstract String getConnectionMessage();
|
80
|
|
81
|
@Override
|
82
|
public void closeOpenConnections() {
|
83
|
|
84
|
}
|
85
|
|
86
|
}
|