2 * Copyright (C) 2014 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
9 package eu
.etaxonomy
.cdm
.config
;
13 import eu
.etaxonomy
.cdm
.model
.metadata
.CdmMetaDataPropertyName
;
16 * Interface which represents any CDM Source
19 public interface ICdmSource
{
22 * Returns the name representation of this CDM Source
24 * @return name representation of this CDM Source
26 public String
getName();
29 * Sets the name representation of this CDM Source
34 public void setName(String name
);
37 * Returns the server (string representation) where this CDM Source resides
39 * @return server (string representation) where this CDM Source resides
41 public String
getServer();
44 * Sets the server (string representation) where this CDM Source resides
49 public void setServer(String server
);
52 * Returns the port on which this CDM Source is listening
54 * @return port on which this CDM Source is listening
59 * Sets the port on which this CDM Source is listening
63 public void setPort(int port
);
66 * Returns the CDM schema version of this CDM Source
68 * @return CDM schema version of this CDM Source
69 * @throws CdmSourceException if any underlying error
71 public String
getDbSchemaVersion() throws CdmSourceException
;
74 * Checks whether the underlying database is empty
76 * @return true if underlying database is empty, o/w false
77 * @throws CdmSourceException
79 public boolean isDbEmpty() throws CdmSourceException
;
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
87 public boolean checkConnection() throws CdmSourceException
;
90 * Returns the message to display when connecting to this CDM Source
92 * @return message to display when connecting to this CDM Source
94 public String
getConnectionMessage();
97 * Closes any open connections to this CDM Source
100 public void closeOpenConnections();
102 public Map
<CdmMetaDataPropertyName
, String
> getMetaDataMap() throws CdmSourceException
;