Project

General

Profile

Download (2.39 KB) Statistics
| Branch: | Tag: | Revision:
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.CdmMetaDataPropertyName;
14

    
15
/**
16
 * Interface which represents any CDM Source
17
 *
18
 */
19
public interface ICdmSource {
20

    
21
	/**
22
	 * Returns the name representation of this CDM Source
23
	 *
24
	 * @return name representation of this CDM Source
25
	 */
26
	public String getName();
27

    
28
	/**
29
	 * Sets the name representation of this CDM Source
30
	 *
31
	 * @param name
32
	 * @return
33
	 */
34
	public void setName(String name);
35

    
36
	/**
37
	 * Returns the server (string representation) where this CDM Source resides
38
	 *
39
	 * @return server (string representation) where this CDM Source resides
40
	 */
41
	public String getServer();
42

    
43
	/**
44
	 * Sets the server (string representation) where this CDM Source resides
45
	 *
46
	 * @param server
47
	 * @return
48
	 */
49
	public void setServer(String server);
50

    
51
	/**
52
	 * Returns the port on which this CDM Source is listening
53
	 *
54
	 * @return port on which this CDM Source is listening
55
	 */
56
	public int getPort();
57

    
58
	/**
59
	 * Sets the port on which this CDM Source is listening
60
	 *
61
	 * @param port
62
	 */
63
	public void setPort(int port);
64

    
65
	/**
66
	 * Returns the CDM  schema version of this CDM Source
67
	 *
68
	 * @return CDM  schema version of this CDM Source
69
	 * @throws CdmSourceException if any underlying error
70
	 */
71
	public String getDbSchemaVersion() throws CdmSourceException;
72

    
73
	/**
74
	 * Checks whether the underlying database is empty
75
	 *
76
	 * @return true if underlying database is empty, o/w false
77
	 * @throws CdmSourceException
78
	 */
79
	public boolean isDbEmpty() throws CdmSourceException;
80

    
81

    
82
	/**
83
	 * Tests, if a database connection can be established.
84
	 * @return true if test was successful, false otherwise
85
	 * @throws CdmSourceException if any underlying error
86
	 */
87
	public boolean checkConnection() throws CdmSourceException;
88

    
89
	/**
90
	 * Returns the message to display when connecting to this CDM Source
91
	 *
92
	 * @return message to display when connecting to this CDM Source
93
	 */
94
	public String getConnectionMessage();
95

    
96
	/**
97
	 * Closes any open connections to this CDM Source
98
	 *
99
	 */
100
	public void closeOpenConnections();
101

    
102
	public Map<CdmMetaDataPropertyName, String> getMetaDataMap() throws CdmSourceException ;
103

    
104
}
(9-9/9)