3225938d2354ecf01a0ef0c28cc88a97f66914a0
[cdmlib.git] / cdmlib-persistence / src / main / java / eu / etaxonomy / cdm / config / CdmSource.java
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 * Abstract class representing the base CDM Source object.
18 *
19 *
20 */
21 public abstract class CdmSource implements ICdmSource {
22
23 private String name;
24 private String server;
25 private int port;
26 private NomenclaturalCode nomenclaturalCode;
27
28 public static final String DEFAULT_ENTRY = "-";
29
30 /**
31 * Sets the CDM Source name
32 *
33 * @param name
34 */
35 @Override
36 public void setName(String name) {
37 this.name = name;
38 }
39
40 /**
41 * Sets the CDM Source server
42 *
43 * @param server
44 */
45 @Override
46 public void setServer(String server) {
47 this.server = server;
48 }
49
50 /**
51 * Sets the CDM Source port
52 *
53 * @param port
54 */
55 @Override
56 public void setPort(int port) {
57 this.port = port;
58 }
59
60 /**
61 * Sets the CDM Source {@link NomenclaturalCode}
62 *
63 * @param nomenclaturalCode
64 */
65 @Override
66 public void setNomenclaturalCode(NomenclaturalCode nomenclaturalCode) {
67 this.nomenclaturalCode = nomenclaturalCode;
68 }
69
70
71 /* (non-Javadoc)
72 * @see eu.etaxonomy.cdm.config.ICdmSource#getName()
73 */
74 @Override
75 public String getName() {
76 return this.name;
77 }
78
79 /* (non-Javadoc)
80 * @see eu.etaxonomy.cdm.config.ICdmSource#getServer()
81 */
82 @Override
83 public String getServer() {
84 return this.server;
85 }
86
87 /* (non-Javadoc)
88 * @see eu.etaxonomy.cdm.config.ICdmSource#getPort()
89 */
90 @Override
91 public int getPort() {
92 return this.port;
93 }
94
95 /* (non-Javadoc)
96 * @see eu.etaxonomy.cdm.config.ICdmSource#getNomenclaturalCode()
97 */
98 @Override
99 public NomenclaturalCode getNomenclaturalCode() {
100 return this.nomenclaturalCode;
101 }
102
103 /* (non-Javadoc)
104 * @see eu.etaxonomy.cdm.config.ICdmSource#getDbSchemaVersion()
105 */
106 @Override
107 public abstract String getDbSchemaVersion() throws CdmSourceException;
108
109 /* (non-Javadoc)
110 * @see eu.etaxonomy.cdm.config.ICdmSource#isDbEmpty()
111 */
112 @Override
113 public abstract boolean isDbEmpty() throws CdmSourceException;
114
115 /* (non-Javadoc)
116 * @see eu.etaxonomy.cdm.config.ICdmSource#checkConnection()
117 */
118 @Override
119 public abstract boolean checkConnection() throws CdmSourceException;
120
121 /* (non-Javadoc)
122 * @see eu.etaxonomy.cdm.config.ICdmSource#getConnectionMessage()
123 */
124 @Override
125 public abstract String getConnectionMessage();
126
127 /* (non-Javadoc)
128 * @see eu.etaxonomy.cdm.config.ICdmSource#closeOpenConnections()
129 */
130 @Override
131 public void closeOpenConnections() {
132
133 }
134
135 }