Project

General

Profile

Download (26.4 KB) Statistics
| Branch: | Revision:
1
/**
2
* Copyright (C) 2007 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

    
10
package eu.etaxonomy.cdm.app.common;
11

    
12
import java.lang.reflect.Method;
13

    
14
import org.apache.log4j.Logger;
15

    
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;
20

    
21
public class CdmDestinations {
22
	@SuppressWarnings("unused")
23
	private static Logger logger = Logger.getLogger(CdmDestinations.class);
24

    
25
	public static ICdmDataSource cdm_local_redlist_animalia(){
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);
31
	}
32

    
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_animalia";
37
        String cdmUserName = "edit";
38
        return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
39
    }
40

    
41
    public static ICdmDataSource cdm_redlist_animalia_production_final(){
42
        DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
43
        String cdmServer = "160.45.63.171";
44
        String cdmDB = "cdm_production_rl_animalia_final";
45
        String cdmUserName = "edit";
46
        return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
47
    }
48

    
49
	public static ICdmDataSource cdm_local_redlist_plant(){
50
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
51
		String cdmServer = "localhost";
52
		String cdmDB = "cdm_bfn_imports_plants";
53
		String cdmUserName = "edit";
54
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
55
	}
56

    
57
	public static ICdmDataSource cdm_local_testDB(){
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);
63
	}
64

    
65
	public static ICdmDataSource cdm_local_test_mysql(){
66
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
67
		String cdmServer = "127.0.0.1";
68
		String cdmDB = "rl2020_gefaesspflanzen";
69
		String cdmUserName = "root";
70
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
71
	}
72

    
73

    
74
	public static ICdmDataSource cdm_local_test_mysql_moose(){
75
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
76
		String cdmServer = "127.0.0.1";
77
		String cdmDB = "moose";
78
		String cdmUserName = "edit";
79
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
80
	}
81

    
82
	public static ICdmDataSource cdm_local_test_mysql_standardliste(){
83
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
84
		String cdmServer = "127.0.0.1";
85
		String cdmDB = "standardliste";
86
		String cdmUserName = "root";
87
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
88
	}
89

    
90

    
91
	public static ICdmDataSource cdm_local_test_mysql_dwca(){
92
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
93
		String cdmServer = "127.0.0.1";
94
		String cdmDB = "dwca";
95
		String cdmUserName = "edit";
96
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
97
	}
98

    
99

    
100
	public static ICdmDataSource cdm_local_mysql_fdac(){
101
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
102
		String cdmServer = "127.0.0.1";
103
		String cdmDB = "fdac";
104
		String cdmUserName = "edit";
105
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
106
	}
107

    
108
	public static ICdmDataSource cdm_test_local_mysql_test(){
109
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
110
		String cdmServer = "127.0.0.1";
111
		String cdmDB = "test";
112
		String cdmUserName = "edit";     //root on pesiimport2
113
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
114
	}
115

    
116
    public static ICdmDataSource cdm_local_test_bogota(){
117
        DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
118
        String cdmServer = "127.0.0.1";
119
        String cdmDB = "cdm_local_flora_bogota";
120
        String cdmUserName = "edit";     //root on pesiimport2
121
        return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
122
    }
123

    
124
	public static ICdmDataSource cdm_local_euromed(){
125
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
126
		String cdmServer = "127.0.0.1";
127
		String cdmDB = "euroMed";
128
		String cdmUserName = "edit";
129
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
130
	}
131

    
132
	public static ICdmDataSource cdm_local_euromed2(){
133
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
134
		String cdmServer = "127.0.0.1";
135
		String cdmDB = "euroMed2";
136
		String cdmUserName = "edit";
137
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
138
	}
139
	public static ICdmDataSource cdm_local_test_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);
145
	}
146

    
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);
153
    }
154

    
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);
161
    }
162

    
163
    public static ICdmDataSource cdm_local_col(){
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);
169
    }
170

    
171
    public static ICdmDataSource cdm_local_col2(){
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);
177
    }
178

    
179

    
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);
186
	}
187

    
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);
194
	}
195

    
196
	public static ICdmDataSource cdm_test_corvidae(){
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);
202
	}
203

    
204
   public static ICdmDataSource cdm_test_redlist_mammalia(){
205
        DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
206
        String cdmServer = "160.45.63.175";
207
        String cdmDB = "cdm_rl_mammalia";
208
        String cdmUserName = "edit";
209
        return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
210
    }
211

    
212
	public static ICdmDataSource cdm_test_redlist_moose(){
213
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
214
		String cdmServer = "160.45.63.175";
215
		String cdmDB = "cdm_mt_moose";
216
		String cdmUserName = "edit";
217
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
218
	}
219

    
220
	public static ICdmDataSource cdm_redlist_moose_production(){
221
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
222
		String cdmServer = "160.45.63.171";
223
		String cdmDB = "cdm_production_rl_moose";
224
		String cdmUserName = "edit";
225
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
226
	}
227

    
228
	public static ICdmDataSource cdm_test_redlist_standardlist(){
229
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
230
		String cdmServer = "160.45.63.175";
231
		String cdmDB = "cdm_mt_standardliste";
232
		String cdmUserName = "edit";
233
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
234
	}
235

    
236
	public static ICdmDataSource cdm_test_redlist_germanSL(){
237
        DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
238
        String cdmServer = "160.45.63.175";
239
        String cdmDB = "cdm_rl_german_sl";
240
        String cdmUserName = "edit";
241
        return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
242
    }
243

    
244
    public static ICdmDataSource cdm_germanSL_production(){
245
        DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
246
        String cdmServer = "160.45.63.171";
247
        String cdmDB = "cdm_production_rl_german_sl";
248
        String cdmUserName = "edit";
249
        return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
250
    }
251

    
252

    
253
	public static ICdmDataSource cdm_test_cyprus(){
254
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
255
		String cdmServer = "160.45.63.175";
256
		String cdmDB = "cdm_cyprus";
257
		String cdmUserName = "edit";
258
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
259
	}
260

    
261
	public static ICdmDataSource cdm_cyprus_production(){
262
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
263
		String cdmServer = "160.45.63.171";
264
		String cdmDB = "cdm_production_cyprus";
265
		String cdmUserName = "edit";
266
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
267
	}
268

    
269
    public static ICdmDataSource cdm_production_flora_cuba(){
270
        DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
271
        String cdmServer = "160.45.63.171";
272
        String cdmDB = "cdm_production_flora_cuba";
273
        String cdmUserName = "edit";
274
        return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
275
    }
276

    
277
    public static ICdmDataSource cdm_greece_checklist_production(){
278
        DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
279
        String cdmServer = "160.45.63.171";
280
        String cdmDB = "cdm_production_flora_greece";
281
        String cdmUserName = "edit";
282
        return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
283
    }
284

    
285
    public static ICdmDataSource cdm_mexico_rubiaceae_production(){
286
        DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
287
        String cdmServer = "160.45.63.171";
288
        String cdmDB = "cdm_production_rubiaceae_mexico";
289
        String cdmUserName = "edit";
290
        return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
291
    }
292

    
293
    public static ICdmDataSource cdm_bogota_production(){
294
        DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
295
        String cdmServer = "160.45.63.171";
296
        String cdmDB = "cdm_production_flora_bogota";
297
        String cdmUserName = "edit";
298
        return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
299
    }
300

    
301
	public static ICdmDataSource cdm_cyprus_production_tunnel(){
302
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
303
		String cdmServer = "127.0.0.1";
304
		int port = 13306;
305
		String cdmDB = "cdm_production_cyprus";
306
		String cdmUserName = "edit";
307
		return makeDestination(dbType, cdmServer, cdmDB, port, cdmUserName, null);
308
	}
309

    
310
//	public static ICdmDataSource cdm_cyprus_dev_tunnel(){
311
//		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
312
//		String cdmServer = "127.0.0.1";
313
//		int port = 13306;
314
//		String cdmDB = "cdm_cyprus";
315
//		String cdmUserName = "edit";
316
//		return makeDestination(dbType, cdmServer, cdmDB, port, cdmUserName, null);
317
//	}
318

    
319
	public static ICdmDataSource cdm_campanulaceae_production(){
320
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
321
		String cdmServer = "160.45.63.171";
322
		String cdmDB = "cdm_production_campanulaceae";
323
		String cdmUserName = "edit";
324
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
325
	}
326

    
327
	public static ICdmDataSource cdm_local_portal_test(){
328
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
329
		String cdmServer = "127.0.0.1";
330
		String cdmDB = "cdm_portal_test";
331
		String cdmUserName = "edit";
332
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
333
	}
334

    
335
	public static ICdmDataSource cdm_local_portal_test2(){
336
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
337
		String cdmServer = "127.0.0.1";
338
		String cdmDB = "cdm_portal_test2";
339
		String cdmUserName = "edit";
340
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
341
	}
342

    
343
	public static ICdmDataSource cdm_local_cichorieae(){
344
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
345
		String cdmServer = "127.0.0.1";
346
		String cdmDB = "cdm_edit_cichorieae";
347
		String cdmUserName = "edit";
348
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
349
	}
350

    
351

    
352

    
353
	public static ICdmDataSource cdm_local_palmae(){
354
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
355
		String cdmServer = "127.0.0.1";
356
		String cdmDB = "cdm_edit_caryo";
357
		String cdmUserName = "edit";
358
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
359
	}
360

    
361
    public static ICdmDataSource cdm_local_cuba(){
362
        DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
363
        String cdmServer = "127.0.0.1";
364
        String cdmDB = "cdm_local_flora_cuba";
365
        String cdmUserName = "edit";
366
        return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
367
    }
368

    
369
	public static ICdmDataSource cdm_local_caryo(){
370
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
371
		String cdmServer = "127.0.0.1";
372
		String cdmDB = "cdm_local_caryophyllales";
373
		String cdmUserName = "root";
374
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
375
	}
376

    
377
	public static ICdmDataSource cdm_test_globis(){
378
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
379
		String cdmServer = "160.45.63.175";
380
		String cdmDB = "cdm_edit_globis";
381
		String cdmUserName = "edit";
382
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
383
	}
384

    
385
    public static ICdmDataSource cdm_local_edaphobase(){
386
        DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
387
        String cdmServer = "127.0.0.1";
388
        String cdmDB = "edaphobase";
389
        String cdmUserName = "edit";
390
        return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
391
    }
392

    
393
    public static ICdmDataSource cdm_postgres_edaphobase(){
394
        DatabaseTypeEnum dbType = DatabaseTypeEnum.PostgreSQL;
395
        String cdmServer = "130.133.70.26";
396
        String cdmDB = "cdm_edaphobase";
397
        String cdmUserName = "edaphobase";
398
        int port = 5433;
399
        return makeDestination(dbType, cdmServer, cdmDB, port, cdmUserName, null);
400
    }
401

    
402
    public static ICdmDataSource cdm_test_postgres_edaphobase(){
403
        DatabaseTypeEnum dbType = DatabaseTypeEnum.PostgreSQL;
404
        String cdmServer = "160.45.63.175";
405
        String cdmDB = "cdm_edaphobase";
406
        String cdmUserName = "edaphobase";
407
        int port = 5432;
408
        return makeDestination(dbType, cdmServer, cdmDB, port, cdmUserName, null);
409
    }
410

    
411
    public static ICdmDataSource cdm_test_postgres__ssh_edaphobase(){
412
        DatabaseTypeEnum dbType = DatabaseTypeEnum.PostgreSQL;
413
        String cdmServer = "localhost";
414
        String cdmDB = "cdm_edaphobase";
415
        String cdmUserName = "edaphobase";
416
        int port = 13306;
417
        return makeDestination(dbType, cdmServer, cdmDB, port, cdmUserName, null);
418
    }
419

    
420
    public static ICdmDataSource cdm_local_caryo_spp(){
421
        DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
422
        String cdmServer = "127.0.0.1";
423
        String cdmDB = "cdm_caryo_spp";
424
        String cdmUserName = "edit";
425
        return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
426
    }
427

    
428
    public static ICdmDataSource cdm_local_caryo_spp2(){
429
        DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
430
        String cdmServer = "127.0.0.1";
431
        String cdmDB = "cdm_caryo_spp2";
432
        String cdmUserName = "edit";
433
        return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
434
    }
435

    
436
	public static ICdmDataSource cdm_globis_production(){
437
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
438
		String cdmServer = "160.45.63.171";
439
		String cdmDB = "cdm_production_globis";
440
		String cdmUserName = "edit";
441
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
442
	}
443

    
444
	public static ICdmDataSource cdm_local_globis(){
445
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
446
		String cdmServer = "127.0.0.1";
447
		String cdmDB = "cdm_globis";
448
		String cdmUserName = "edit";
449
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
450
	}
451

    
452
	public static ICdmDataSource cdm_local_postgres_CdmTest(){
453
		DatabaseTypeEnum dbType = DatabaseTypeEnum.PostgreSQL;
454
		String cdmServer = "127.0.0.1";
455
		String cdmDB = "CdmTest";
456
		String cdmUserName = "edit";
457
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
458
	}
459

    
460

    
461
	public static ICdmDataSource NULL(){
462
		return null;
463
	}
464

    
465

    
466
	public static ICdmDataSource localH2(){
467
		return CdmDataSource.NewH2EmbeddedInstance("cdm", "sa", "");
468
	}
469

    
470
	public static ICdmDataSource localH2Edapho(){
471
        return CdmDataSource.NewH2EmbeddedInstance("cdmEdapho", "sa", "");
472
    }
473

    
474
	public static ICdmDataSource localH2Salvador(){
475
		return CdmDataSource.NewH2EmbeddedInstance("salvador", "sa", "");
476
	}
477

    
478
	public static ICdmDataSource localH2Armeria(){
479
		return CdmDataSource.NewH2EmbeddedInstance("armeria", "sa", "");
480
	}
481

    
482
	public static ICdmDataSource localH2Standardliste(){
483
		return CdmDataSource.NewH2EmbeddedInstance("standardliste", "sa", "");
484
	}
485

    
486
	public static ICdmDataSource localH2Cichorieae(){
487
		return CdmDataSource.NewH2EmbeddedInstance("cichorieae", "sa", "");
488
	}
489

    
490
	public static ICdmDataSource localH2Palmae(){
491
		return CdmDataSource.NewH2EmbeddedInstance("palmae", "sa", "");
492
	}
493

    
494
	public static ICdmDataSource localH2EuroMed(){
495
		return CdmDataSource.NewH2EmbeddedInstance("euroMed", "sa", "");
496
	}
497

    
498
	public static ICdmDataSource localH2Erms(){
499
		return CdmDataSource.NewH2EmbeddedInstance("erms", "sa", "");
500
	}
501

    
502

    
503
    public static ICdmDataSource cdm_test_test1(){
504
        DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
505
        String cdmServer = "160.45.63.175";
506
        String cdmDB = "cdm_test1";
507
        String cdmUserName = "edit";
508
        return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
509
	}
510
    public static ICdmDataSource cdm_test_test2(){
511
        DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
512
        String cdmServer = "160.45.63.175";
513
        String cdmDB = "cdm_test2";
514
        String cdmUserName = "edit";
515
        return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
516
    }
517
    public static ICdmDataSource cdm_test_test3(){
518
        DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
519
        String cdmServer = "160.45.63.175";
520
        String cdmDB = "cdm_test3";
521
        String cdmUserName = "edit";
522
        return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
523
    }
524

    
525
	public static ICdmDataSource cdm_test_algaterra(){
526
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
527
		String cdmServer = "160.45.63.175";
528
		String cdmDB = "cdm_edit_algaterra";
529
		String cdmUserName = "edit";
530
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
531
	}
532

    
533
	public static ICdmDataSource cdm_algaterra_production(){
534
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
535
		String cdmServer = "160.45.63.171";
536
		String cdmDB = "cdm_production_algaterra";
537
		String cdmUserName = "edit";
538
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
539
	}
540

    
541
    public static ICdmDataSource cdm_test_salvador(){
542
        DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
543
        String cdmServer = "160.45.63.175";
544
        String cdmDB = "cdm_salvador";
545
        String cdmUserName = "edit";
546
        return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
547
    }
548

    
549
    public static ICdmDataSource cdm_salvador_production(){
550
        DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
551
        String cdmServer = "160.45.63.171";
552
        String cdmDB = "cdm_production_salvador";
553
        String cdmUserName = "edit";
554
        return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
555
    }
556

    
557
	public static ICdmDataSource cdm_test_cichorieae(){
558
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
559
		String cdmServer = "160.45.63.175";
560
		String cdmDB = "cdm_edit_cichorieae";
561
		String cdmUserName = "edit";
562
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
563
	}
564

    
565
	public static ICdmDataSource cdm_production_cichorieae(){
566
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
567
		String cdmServer = "160.45.63.171";
568
		String cdmDB = "cdm_production_cichorieae";
569
		String cdmUserName = "edit";
570
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
571
	}
572

    
573
	public static ICdmDataSource cdm_production_palmae(){
574
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
575
		String cdmServer = "160.45.63.171";
576
		String cdmDB = "cdm_production_palmae";
577
		String cdmUserName = "edit";
578
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
579
	}
580

    
581
	public static ICdmDataSource cdm_production_flora_deutschland(){
582
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
583
		String cdmServer = "160.45.63.171";
584
		String cdmDB = "cdm_production_rl_standardliste";
585
		String cdmUserName = "edit";
586
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
587
	}
588

    
589
	public static ICdmDataSource cdm_production_caryophyllales(){
590
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
591
		String cdmServer = "160.45.63.171";
592
		String cdmDB = "cdm_production_caryophyllales";
593
		String cdmUserName = "edit";
594
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
595
	}
596

    
597
	public static ICdmDataSource cdm_production_caryophyllales_spp(){
598
        DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
599
        String cdmServer = "160.45.63.171";
600
        String cdmDB = "cdm_production_caryophyllales_spp";
601
        String cdmUserName = "edit";
602
        return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
603
    }
604

    
605
	public static ICdmDataSource cdm_production_caryophyllales_nepenthaceae(){
606
        DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
607
        String cdmServer = "160.45.63.171";
608
        String cdmDB = "cdm_production_caryo_nepenthaceae";
609
        String cdmUserName = "edit";
610
        return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
611
    }
612

    
613
	public static ICdmDataSource cdm_local_caryophyllales_nepenthaceae(){
614
        DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
615
        String cdmServer = "127.0.0.1";
616
        String cdmDB = "cdm_local_caryo_nepenthaceae";
617
        String cdmUserName = "root";
618
        return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
619
    }
620

    
621
	public static ICdmDataSource cdm_production_redlist_gefaesspflanzen(){
622
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
623
		String cdmServer = "160.45.63.171";
624
		String cdmDB = "cdm_production_rl_plantae";
625
		String cdmUserName = "edit";
626
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
627
	}
628

    
629
    public static ICdmDataSource cdm_production_edaphobase(){
630
        DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
631
        String cdmServer = "160.45.63.171";
632
        String cdmDB = "cdm_production_edaphobase";
633
        String cdmUserName = "edit";
634
        return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
635
    }
636

    
637
	public static ICdmDataSource cdm_production_piB(String database){
638
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
639
		String cdmServer = "160.45.63.171";
640
		String cdmDB = "cdm_production_" + database + "_pilot";
641
		String cdmUserName = "edit";
642
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
643
	}
644

    
645
	public static ICdmDataSource cdm_local_piB(String database){
646
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
647
		String cdmServer = "127.0.0.1";
648
		String cdmDB = "piB_" + database;
649
		String cdmUserName = "root";
650
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
651
	}
652

    
653
   public static ICdmDataSource proibiosphere_chenopodium_local() {
654
        DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
655
        String cdmServer = "localhost";
656
        String cdmDB = "cdm_production_proibiosphere_chenopodium_pilot";
657
        String cdmUserName = "root";
658
        return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
659
   }
660

    
661
   public static ICdmDataSource proibiosphere_spiders_local() {
662
       DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
663
       String cdmServer = "localhost";
664
       String cdmDB = "cdm_production_proibiosphere_spiders_pilot";
665
       String cdmUserName = "root";
666
       return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
667
   }
668

    
669
   public static ICdmDataSource cdm_test_pesi_fauna_europaea(){
670
       DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
671
       String cdmServer = "160.45.63.175";
672
       String cdmDB = "cdm_pesi_fauna_europaea";
673
       String cdmUserName = "edit";
674
       return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
675
   }
676

    
677

    
678

    
679
	/**
680
	 * initializes source
681
	 * TODO only supports MySQL and PostgreSQL
682
	 *
683
	 * @param dbType
684
	 * @param cdmServer
685
	 * @param cdmDB
686
	 * @param port
687
	 * @param cdmUserName
688
	 * @param pwd
689
	 * @return
690
	 */
691
	public static ICdmDataSource makeDestination(DatabaseTypeEnum dbType, String cdmServer, String cdmDB, int port, String cdmUserName, String pwd ){
692
		//establish connection
693
		pwd = AccountStore.readOrStorePassword(cdmServer, cdmDB, cdmUserName, pwd);
694
		ICdmDataSource destination;
695
		if(dbType.equals(DatabaseTypeEnum.MySQL)){
696
			destination = CdmDataSource.NewMySqlInstance(cdmServer, cdmDB, port, cdmUserName, pwd);
697
		} else if(dbType.equals(DatabaseTypeEnum.PostgreSQL)){
698
			destination = CdmDataSource.NewPostgreSQLInstance(cdmServer, cdmDB, port, cdmUserName, pwd);
699
		} else {
700
			//TODO others
701
			throw new RuntimeException("Unsupported DatabaseType");
702
		}
703
		return destination;
704

    
705
	}
706

    
707

    
708
	/**
709
	 * Accepts a string array and tries to find a method returning an ICdmDataSource with
710
	 * the name of the given first string in the array
711
	 *
712
	 * @param args
713
	 * @return
714
	 */
715
	public static ICdmDataSource chooseDestination(String[] args) {
716
		if(args == null) {
717
            return null;
718
        }
719

    
720
		if(args.length != 1) {
721
            return null;
722
        }
723

    
724
		String possibleDestination = args[0];
725

    
726
		Method[] methods = CdmDestinations.class.getMethods();
727

    
728
		for (Method method : methods){
729
			if(method.getName().equals(possibleDestination)){
730
				try {
731
					return (ICdmDataSource) method.invoke(null, null);
732
				} catch (Exception e) {
733
					e.printStackTrace();
734
					throw new RuntimeException(e);
735
				}
736
			}
737
		}
738
		return null;
739
	}
740

    
741
}
742

    
(2-2/5)