2 * Copyright (C) 2007 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.
10 package eu
.etaxonomy
.cdm
.app
.common
;
12 import java
.lang
.reflect
.Method
;
14 import org
.apache
.log4j
.Logger
;
16 import eu
.etaxonomy
.cdm
.common
.AccountStore
;
17 import eu
.etaxonomy
.cdm
.database
.CdmDataSource
;
18 import eu
.etaxonomy
.cdm
.database
.DatabaseTypeEnum
;
19 import eu
.etaxonomy
.cdm
.database
.ICdmDataSource
;
21 public class CdmDestinations
{
22 @SuppressWarnings("unused")
23 private static Logger logger
= Logger
.getLogger(CdmDestinations
.class);
25 public static ICdmDataSource
cdm_redlist_animalia_localhost(){
26 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
27 String cdmServer
= "localhost";
28 String cdmDB
= "cdm_bfn_imports_animalia";
29 String cdmUserName
= "edit";
30 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
33 public static ICdmDataSource
cdm_redlist_animalia_production(){
34 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
35 String cdmServer
= "160.45.63.171";
36 String cdmDB
= "cdm_production_rl_animals";
37 String cdmUserName
= "edit";
38 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
41 public static ICdmDataSource
cdm_redlist_plant_localhost(){
42 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
43 String cdmServer
= "localhost";
44 String cdmDB
= "cdm_bfn_imports_plants";
45 String cdmUserName
= "edit";
46 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
49 public static ICdmDataSource
cdm_redlist_lumbricidae(){
50 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
51 String cdmServer
= "160.45.63.171";
52 String cdmDB
= "cdm_production_rl_lumbricidae";
53 String cdmUserName
= "edit";
54 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
57 public static ICdmDataSource
cdm_testDB_localhost(){
58 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
59 String cdmServer
= "localhost";
60 String cdmDB
= "testDB";
61 String cdmUserName
= "root";
62 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
65 public static ICdmDataSource
cdm_test_useSummary(){
66 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
67 String cdmServer
= "localhost";
68 String cdmDB
= "palmae_2011_07_17";
69 String cdmUserName
= "root";
70 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
73 public static ICdmDataSource
cdm_test_local_mysql(){
74 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
75 String cdmServer
= "127.0.0.1";
76 String cdmDB
= "rl2020_gefaesspflanzen";
77 String cdmUserName
= "root";
78 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
82 public static ICdmDataSource
cdm_test_local_mysql_moose(){
83 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
84 String cdmServer
= "127.0.0.1";
85 String cdmDB
= "moose";
86 String cdmUserName
= "edit";
87 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
90 public static ICdmDataSource
cdm_test_local_mysql_standardliste(){
91 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
92 String cdmServer
= "127.0.0.1";
93 String cdmDB
= "standardliste";
94 String cdmUserName
= "root";
95 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
99 public static ICdmDataSource
cdm_test_local_mysql_dwca(){
100 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
101 String cdmServer
= "127.0.0.1";
102 String cdmDB
= "dwca";
103 String cdmUserName
= "edit";
104 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
108 public static ICdmDataSource
cdm_test_local_mysql_fdac(){
109 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
110 String cdmServer
= "127.0.0.1";
111 String cdmDB
= "fdac";
112 String cdmUserName
= "edit";
113 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
116 public static ICdmDataSource
cdm_test_local_mysql_test(){
117 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
118 String cdmServer
= "127.0.0.1";
119 String cdmDB
= "test";
120 String cdmUserName
= "edit"; //root on pesiimport2
121 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
124 public static ICdmDataSource
cdm_test_local_euromed(){
125 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
126 String cdmServer
= "127.0.0.1";
127 String cdmDB
= "euroMed";
128 String cdmUserName
= "root";
129 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
132 public static ICdmDataSource
cdm_test_local_euromed2(){
133 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
134 String cdmServer
= "127.0.0.1";
135 String cdmDB
= "euroMed2";
136 String cdmUserName
= "root";
137 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
139 public static ICdmDataSource
cdm_test_local_euromed3(){
140 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
141 String cdmServer
= "127.0.0.1";
142 String cdmDB
= "euroMed3";
143 String cdmUserName
= "root";
144 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
147 public static ICdmDataSource
cdm_test_col(){
148 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
149 String cdmServer
= "160.45.63.175";
150 String cdmDB
= "cdm_col";
151 String cdmUserName
= "edit";
152 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
155 public static ICdmDataSource
cdm_test_col2(){
156 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
157 String cdmServer
= "160.45.63.175";
158 String cdmDB
= "cdm_col2";
159 String cdmUserName
= "edit";
160 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
163 public static ICdmDataSource
cdm_col_local(){
164 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
165 String cdmServer
= "127.0.0.1";
166 String cdmDB
= "col_test";
167 String cdmUserName
= "edit";
168 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
171 public static ICdmDataSource
cdm_col2_local(){
172 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
173 String cdmServer
= "127.0.0.1";
174 String cdmDB
= "col_test2";
175 String cdmUserName
= "edit";
176 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
180 public static ICdmDataSource
cdm_local_EDITImport(){
181 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
182 String cdmServer
= "127.0.0.1";
183 String cdmDB
= "EDITImport";
184 String cdmUserName
= "edit"; //root on pesiimport2
185 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
188 public static ICdmDataSource
cdm_test_euroMed(){
189 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
190 String cdmServer
= "160.45.63.175";
191 String cdmDB
= "cdm_test_euromed";
192 String cdmUserName
= "edit";
193 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
196 public static ICdmDataSource
cdm_corvidae_dev(){
197 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
198 String cdmServer
= "160.45.63.175";
199 String cdmDB
= "cdm_corvidae";
200 String cdmUserName
= "edit";
201 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
204 public static ICdmDataSource
cdm_ildis_dev(){
205 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
206 String cdmServer
= "160.45.63.175";
207 String cdmDB
= "cdm_edit_ildis";
208 String cdmUserName
= "edit";
209 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
213 // public static ICdmDataSource cdm_ildis_production(){
214 // DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
215 // String cdmServer = "160.45.63.171";
216 // String cdmDB = "cdm_edit_ildis";
217 // String cdmUserName = "edit";
218 // return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
222 public static ICdmDataSource
cdm_redlist_moose_dev(){
223 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
224 String cdmServer
= "160.45.63.175";
225 String cdmDB
= "cdm_mt_moose";
226 String cdmUserName
= "edit";
227 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
230 public static ICdmDataSource
cdm_redlist_moose_production(){
231 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
232 String cdmServer
= "160.45.63.171";
233 String cdmDB
= "cdm_production_rl_moose";
234 String cdmUserName
= "edit";
235 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
238 public static ICdmDataSource
cdm_redlist_standardlist_dev(){
239 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
240 String cdmServer
= "160.45.63.175";
241 String cdmDB
= "cdm_mt_standardliste";
242 String cdmUserName
= "edit";
243 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
246 public static ICdmDataSource
cdm_redlist_germanSL_preview(){
247 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
248 String cdmServer
= "160.45.63.175";
249 String cdmDB
= "cdm_rl_german_sl";
250 String cdmUserName
= "edit";
251 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
254 public static ICdmDataSource
cdm_germanSL_production(){
255 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
256 String cdmServer
= "160.45.63.171";
257 String cdmDB
= "cdm_production_rl_german_sl";
258 String cdmUserName
= "edit";
259 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
263 public static ICdmDataSource
cdm_cyprus_dev(){
264 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
265 String cdmServer
= "160.45.63.175";
266 String cdmDB
= "cdm_cyprus";
267 String cdmUserName
= "edit";
268 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
271 public static ICdmDataSource
cdm_cyprus_production(){
272 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
273 String cdmServer
= "160.45.63.171";
274 String cdmDB
= "cdm_production_cyprus";
275 String cdmUserName
= "edit";
276 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
279 public static ICdmDataSource
cdm_cuba_production(){
280 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
281 String cdmServer
= "160.45.63.171";
282 String cdmDB
= "cdm_production_flora_cuba";
283 String cdmUserName
= "edit";
284 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
287 public static ICdmDataSource
cdm_greece_checklist_production(){
288 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
289 String cdmServer
= "160.45.63.171";
290 String cdmDB
= "cdm_production_flora_hellenica";
291 String cdmUserName
= "edit";
292 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
295 public static ICdmDataSource
cdm_mexico_rubiaceae_production(){
296 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
297 String cdmServer
= "160.45.63.171";
298 String cdmDB
= "cdm_production_rubiaceae_mexico";
299 String cdmUserName
= "edit";
300 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
303 public static ICdmDataSource
cdm_bogota_production(){
304 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
305 String cdmServer
= "160.45.63.171";
306 String cdmDB
= "cdm_production_flora_bogota";
307 String cdmUserName
= "edit";
308 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
311 public static ICdmDataSource
cdm_cyprus_production_tunnel(){
312 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
313 String cdmServer
= "127.0.0.1";
315 String cdmDB
= "cdm_production_cyprus";
316 String cdmUserName
= "edit";
317 return makeDestination(dbType
, cdmServer
, cdmDB
, port
, cdmUserName
, null);
320 public static ICdmDataSource
cdm_cyprus_dev_tunnel(){
321 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
322 String cdmServer
= "127.0.0.1";
324 String cdmDB
= "cdm_cyprus";
325 String cdmUserName
= "edit";
326 return makeDestination(dbType
, cdmServer
, cdmDB
, port
, cdmUserName
, null);
329 public static ICdmDataSource
cdm_campanulaceae_production(){
330 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
331 String cdmServer
= "160.45.63.171";
332 String cdmDB
= "cdm_production_campanulaceae";
333 String cdmUserName
= "edit";
334 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
337 public static ICdmDataSource
cdm_portal_test_localhost(){
338 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
339 String cdmServer
= "127.0.0.1";
340 String cdmDB
= "cdm_portal_test";
341 String cdmUserName
= "edit";
342 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
345 public static ICdmDataSource
cdm_portal_test_localhost2(){
346 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
347 String cdmServer
= "127.0.0.1";
348 String cdmDB
= "cdm_portal_test2";
349 String cdmUserName
= "edit";
350 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
353 public static ICdmDataSource
cdm_local_cichorieae(){
354 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
355 String cdmServer
= "127.0.0.1";
356 String cdmDB
= "cdm_edit_cichorieae";
357 String cdmUserName
= "edit";
358 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
363 public static ICdmDataSource
cdm_local_palmae(){
364 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
365 String cdmServer
= "127.0.0.1";
366 String cdmDB
= "cdm_edit_caryo";
367 String cdmUserName
= "edit";
368 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
371 public static ICdmDataSource
cdm_local_caryo(){
372 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
373 String cdmServer
= "127.0.0.1";
374 String cdmDB
= "cdm_local_caryophyllales";
375 String cdmUserName
= "root";
376 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
379 public static ICdmDataSource
cdm_globis_dev(){
380 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
381 String cdmServer
= "160.45.63.175";
382 String cdmDB
= "cdm_edit_globis";
383 String cdmUserName
= "edit";
384 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
387 public static ICdmDataSource
cdm_local_edaphobase(){
388 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
389 String cdmServer
= "127.0.0.1";
390 String cdmDB
= "edaphobase";
391 String cdmUserName
= "edit";
392 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
395 public static ICdmDataSource
cdm_globis_production(){
396 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
397 String cdmServer
= "160.45.63.171";
398 String cdmDB
= "cdm_production_globis";
399 String cdmUserName
= "edit";
400 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
403 public static ICdmDataSource
cdm_local_globis(){
404 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
405 String cdmServer
= "127.0.0.1";
406 String cdmDB
= "cdm_globis";
407 String cdmUserName
= "edit";
408 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
411 public static ICdmDataSource
cdm_local_postgres_CdmTest(){
412 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.PostgreSQL
;
413 String cdmServer
= "127.0.0.1";
414 String cdmDB
= "CdmTest";
415 String cdmUserName
= "edit";
416 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
420 public static ICdmDataSource
NULL(){
425 public static ICdmDataSource
localH2(){
426 return CdmDataSource
.NewH2EmbeddedInstance("cdm", "sa", "");
429 public static ICdmDataSource
localH2Edapho(){
430 return CdmDataSource
.NewH2EmbeddedInstance("cdmEdapho", "sa", "");
433 public static ICdmDataSource
localH2Salvador(){
434 return CdmDataSource
.NewH2EmbeddedInstance("salvador", "sa", "");
437 public static ICdmDataSource
localH2Armeria(){
438 return CdmDataSource
.NewH2EmbeddedInstance("armeria", "sa", "");
441 public static ICdmDataSource
localH2Standardliste(){
442 return CdmDataSource
.NewH2EmbeddedInstance("standardliste", "sa", "");
445 public static ICdmDataSource
localH2Cichorieae(){
446 return CdmDataSource
.NewH2EmbeddedInstance("cichorieae", "sa", "");
449 public static ICdmDataSource
localH2Palmae(){
450 return CdmDataSource
.NewH2EmbeddedInstance("palmae", "sa", "");
453 public static ICdmDataSource
localH2EuroMed(){
454 return CdmDataSource
.NewH2EmbeddedInstance("euroMed", "sa", "");
457 public static ICdmDataSource
localH2Erms(){
458 return CdmDataSource
.NewH2EmbeddedInstance("erms", "sa", "");
462 public static ICdmDataSource
cdm_algaterra_preview(){
463 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
464 String cdmServer
= "160.45.63.175";
465 String cdmDB
= "cdm_edit_algaterra";
466 String cdmUserName
= "edit";
467 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
470 public static ICdmDataSource
cdm_algaterra_production(){
471 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
472 String cdmServer
= "160.45.63.171";
473 String cdmDB
= "cdm_production_algaterra";
474 String cdmUserName
= "edit";
475 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
478 public static ICdmDataSource
cdm_salvador_preview(){
479 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
480 String cdmServer
= "160.45.63.175";
481 String cdmDB
= "cdm_salvador";
482 String cdmUserName
= "edit";
483 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
486 public static ICdmDataSource
cdm_salvador_production(){
487 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
488 String cdmServer
= "160.45.63.171";
489 String cdmDB
= "cdm_production_salvador";
490 String cdmUserName
= "edit";
491 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
494 public static ICdmDataSource
cdm_edit_cichorieae_local_PG(){
495 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.PostgreSQL
;
496 String cdmServer
= "127.0.0.1";
497 String cdmDB
= "cdm_edit_cichorieae_a";
498 String cdmUserName
= "edit";
500 return makeDestination(dbType
, cdmServer
, cdmDB
, port
, cdmUserName
, null);
503 public static ICdmDataSource
cdm_cichorieae_preview(){
504 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
505 String cdmServer
= "160.45.63.175";
506 String cdmDB
= "cdm_edit_cichorieae";
507 String cdmUserName
= "edit";
508 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
511 public static ICdmDataSource
cdm_production_cichorieae(){
512 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
513 String cdmServer
= "160.45.63.171";
514 // String cdmServer = "127.0.0.1";
515 String cdmDB
= "cdm_production_cichorieae";
516 String cdmUserName
= "edit";
517 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
520 public static ICdmDataSource
cdm_production_palmae(){
521 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
522 String cdmServer
= "160.45.63.171";
523 String cdmDB
= "cdm_production_palmae";
524 String cdmUserName
= "edit";
525 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
528 public static ICdmDataSource
cdm_production_flora_deutschland(){
529 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
530 String cdmServer
= "160.45.63.171";
531 String cdmDB
= "cdm_production_rl_standardliste";
532 String cdmUserName
= "edit";
533 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
536 public static ICdmDataSource
cdm_production_caryophyllales(){
537 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
538 String cdmServer
= "160.45.63.171";
539 String cdmDB
= "cdm_production_caryophyllales";
540 String cdmUserName
= "edit";
541 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
544 public static ICdmDataSource
cdm_production_caryophyllales_nepenthaceae(){
545 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
546 String cdmServer
= "160.45.63.171";
547 String cdmDB
= "cdm_production_caryo_nepenthaceae";
548 String cdmUserName
= "edit";
549 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
552 public static ICdmDataSource
cdm_local_caryophyllales_nepenthaceae(){
553 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
554 String cdmServer
= "127.0.0.1";
555 String cdmDB
= "cdm_local_caryo_nepenthaceae";
556 String cdmUserName
= "root";
557 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
560 public static ICdmDataSource
cdm_production_redlist_gefaesspflanzen(){
561 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
562 String cdmServer
= "160.45.63.171";
563 String cdmDB
= "cdm_production_rl_plantae";
564 String cdmUserName
= "edit";
565 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
568 public static ICdmDataSource
cdm_production_edaphobase(){
569 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
570 String cdmServer
= "160.45.63.171";
571 String cdmDB
= "cdm_production_edaphobase";
572 String cdmUserName
= "edit";
573 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
577 public static ICdmDataSource
cdm_production_diptera(){
578 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
579 String cdmServer
= "160.45.63.171";
580 String cdmDB
= "cdm_production_diptera";
581 String cdmUserName
= "edit";
582 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
585 public static ICdmDataSource
cdm_edit_cichorieae_preview(){
586 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
587 String cdmServer
= "127.0.0.1";
588 String cdmDB
= "cdm_edit_cichorieae";
589 String cdmUserName
= "edit";
591 return makeDestination(dbType
, cdmServer
, cdmDB
, port
, cdmUserName
, null);
594 public static ICdmDataSource
cdm_edit_cichorieae_preview_direct(){
595 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
596 String cdmServer
= "160.45.63.175";
597 String cdmDB
= "cdm_edit_cichorieae";
598 String cdmUserName
= "edit";
600 return makeDestination(dbType
, cdmServer
, cdmDB
, port
, cdmUserName
, null);
603 public static ICdmDataSource
cdm_production_piB(String database
){
604 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
605 String cdmServer
= "160.45.63.171";
606 String cdmDB
= "cdm_production_" + database
+ "_pilot";
607 String cdmUserName
= "edit";
608 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
611 public static ICdmDataSource
cdm_local_piB(String database
){
612 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
613 String cdmServer
= "127.0.0.1";
614 String cdmDB
= "piB_" + database
;
615 String cdmUserName
= "root";
616 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
619 public static ICdmDataSource
proibiosphere_chenopodium_local() {
620 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
621 String cdmServer
= "localhost";
622 String cdmDB
= "cdm_production_proibiosphere_chenopodium_pilot";
623 String cdmUserName
= "root";
624 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
627 public static ICdmDataSource
proibiosphere_ants_local() {
628 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
629 String cdmServer
= "localhost";
630 String cdmDB
= "cdm_production_proibiosphere_ants_pilot";
631 String cdmUserName
= "root";
632 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
635 public static ICdmDataSource
proibiosphere_eupolybothrus_local() {
636 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
637 String cdmServer
= "localhost";
638 String cdmDB
= "cdm_production_proibiosphere_eupolybothrus_pilot";
639 String cdmUserName
= "root";
640 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
643 public static ICdmDataSource
proibiosphere_spiders_local() {
644 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
645 String cdmServer
= "localhost";
646 String cdmDB
= "cdm_production_proibiosphere_spiders_pilot";
647 String cdmUserName
= "root";
648 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
655 * TODO only supports MySQL and PostgreSQL
665 public static ICdmDataSource
makeDestination(DatabaseTypeEnum dbType
, String cdmServer
, String cdmDB
, int port
, String cdmUserName
, String pwd
){
666 //establish connection
667 pwd
= AccountStore
.readOrStorePassword(cdmServer
, cdmDB
, cdmUserName
, pwd
);
668 ICdmDataSource destination
;
669 if(dbType
.equals(DatabaseTypeEnum
.MySQL
)){
670 destination
= CdmDataSource
.NewMySqlInstance(cdmServer
, cdmDB
, port
, cdmUserName
, pwd
);
671 } else if(dbType
.equals(DatabaseTypeEnum
.PostgreSQL
)){
672 destination
= CdmDataSource
.NewPostgreSQLInstance(cdmServer
, cdmDB
, port
, cdmUserName
, pwd
);
675 throw new RuntimeException("Unsupported DatabaseType");
683 * Accepts a string array and tries to find a method returning an ICdmDataSource with
684 * the name of the given first string in the array
689 public static ICdmDataSource
chooseDestination(String
[] args
) {
694 if(args
.length
!= 1) {
698 String possibleDestination
= args
[0];
700 Method
[] methods
= CdmDestinations
.class.getMethods();
702 for (Method method
: methods
){
703 if(method
.getName().equals(possibleDestination
)){
705 return (ICdmDataSource
) method
.invoke(null, null);
706 } catch (Exception e
) {
708 throw new RuntimeException(e
);