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 java.util.Map;
|
12
|
|
13
|
import eu.etaxonomy.cdm.model.metadata.CdmMetaData.MetaDataPropertyName;
|
14
|
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
|
15
|
|
16
|
/**
|
17
|
* Interface which represents any CDM Source
|
18
|
*
|
19
|
*/
|
20
|
public interface ICdmSource {
|
21
|
|
22
|
/**
|
23
|
* Returns the name representation of this CDM Source
|
24
|
*
|
25
|
* @return name representation of this CDM Source
|
26
|
*/
|
27
|
public String getName();
|
28
|
|
29
|
/**
|
30
|
* Sets the name representation of this CDM Source
|
31
|
*
|
32
|
* @param name
|
33
|
* @return
|
34
|
*/
|
35
|
public void setName(String name);
|
36
|
|
37
|
/**
|
38
|
* Returns the server (string representation) where this CDM Source resides
|
39
|
*
|
40
|
* @return server (string representation) where this CDM Source resides
|
41
|
*/
|
42
|
public String getServer();
|
43
|
|
44
|
/**
|
45
|
* Sets the server (string representation) where this CDM Source resides
|
46
|
*
|
47
|
* @param server
|
48
|
* @return
|
49
|
*/
|
50
|
public void setServer(String server);
|
51
|
|
52
|
/**
|
53
|
* Returns the port on which this CDM Source is listening
|
54
|
*
|
55
|
* @return port on which this CDM Source is listening
|
56
|
*/
|
57
|
public int getPort();
|
58
|
|
59
|
/**
|
60
|
* Sets the port on which this CDM Source is listening
|
61
|
*
|
62
|
* @param port
|
63
|
*/
|
64
|
public void setPort(int port);
|
65
|
|
66
|
/**
|
67
|
* Returns the {@link NomenclaturalCode} object for this CDM Source
|
68
|
*
|
69
|
* @return
|
70
|
*/
|
71
|
public NomenclaturalCode getNomenclaturalCode();
|
72
|
|
73
|
/**
|
74
|
* Sets the {@link NomenclaturalCode} object for this CDM Source
|
75
|
*
|
76
|
* @param nomenclaturalCode
|
77
|
*/
|
78
|
public void setNomenclaturalCode(NomenclaturalCode nomenclaturalCode);
|
79
|
|
80
|
/**
|
81
|
* Returns the CDM schema version of this CDM Source
|
82
|
*
|
83
|
* @return CDM schema version of this CDM Source
|
84
|
* @throws CdmSourceException if any underlying error
|
85
|
*/
|
86
|
public String getDbSchemaVersion() throws CdmSourceException;
|
87
|
|
88
|
/**
|
89
|
* Checks whether the underlying database is empty
|
90
|
*
|
91
|
* @return true if underlying database is empty, o/w false
|
92
|
* @throws CdmSourceException
|
93
|
*/
|
94
|
public boolean isDbEmpty() throws CdmSourceException;
|
95
|
|
96
|
|
97
|
/**
|
98
|
* Tests, if a database connection can be established.
|
99
|
* @return true if test was successful, false otherwise
|
100
|
* @throws CdmSourceException if any underlying error
|
101
|
*/
|
102
|
public boolean checkConnection() throws CdmSourceException;
|
103
|
|
104
|
/**
|
105
|
* Returns the message to display when connecting to this CDM Source
|
106
|
*
|
107
|
* @return message to display when connecting to this CDM Source
|
108
|
*/
|
109
|
public String getConnectionMessage();
|
110
|
|
111
|
/**
|
112
|
* Closes any open connections to this CDM Source
|
113
|
*
|
114
|
*/
|
115
|
public void closeOpenConnections();
|
116
|
|
117
|
|
118
|
|
119
|
public Map<MetaDataPropertyName, String> getMetaDataMap() throws CdmSourceException ;
|
120
|
|
121
|
|
122
|
|
123
|
|
124
|
|
125
|
|
126
|
}
|