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
.InvocationTargetException
;
13 import java
.lang
.reflect
.Method
;
15 import org
.apache
.log4j
.Logger
;
17 import eu
.etaxonomy
.cdm
.common
.AccountStore
;
18 import eu
.etaxonomy
.cdm
.database
.CdmDataSource
;
19 import eu
.etaxonomy
.cdm
.database
.DatabaseTypeEnum
;
20 import eu
.etaxonomy
.cdm
.database
.ICdmDataSource
;
22 public class CdmDestinations
{
23 @SuppressWarnings("unused")
24 private static Logger logger
= Logger
.getLogger(CdmDestinations
.class);
27 public static ICdmDataSource
cdm_test_useSummary(){
28 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
29 String cdmServer
= "localhost";
30 String cdmDB
= "palmae_2011_07_17";
31 String cdmUserName
= "root";
32 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
35 public static ICdmDataSource
cdm_test_local_mysql(){
36 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
37 String cdmServer
= "127.0.0.1";
38 String cdmDB
= "cdm_test";
39 String cdmUserName
= "root";
40 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
44 public static ICdmDataSource
cdm_test_local_mysql_moose(){
45 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
46 String cdmServer
= "127.0.0.1";
47 String cdmDB
= "moose";
48 String cdmUserName
= "root";
49 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
52 public static ICdmDataSource
cdm_test_local_mysql_standardliste(){
53 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
54 String cdmServer
= "127.0.0.1";
55 String cdmDB
= "standardliste";
56 String cdmUserName
= "root";
57 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
59 public static ICdmDataSource
cdm_test_local_mysql_standardliste2(){
60 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
61 String cdmServer
= "127.0.0.1";
62 String cdmDB
= "standardliste2";
63 String cdmUserName
= "root";
64 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
68 public static ICdmDataSource
cdm_test_local_mysql_dwca(){
69 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
70 String cdmServer
= "127.0.0.1";
71 String cdmDB
= "dwca";
72 String cdmUserName
= "edit";
73 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
77 public static ICdmDataSource
cdm_test_local_mysql_fdac(){
78 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
79 String cdmServer
= "127.0.0.1";
80 String cdmDB
= "fdac";
81 String cdmUserName
= "edit";
82 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
85 public static ICdmDataSource
cdm_test_local_mysql_test(){
86 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
87 String cdmServer
= "127.0.0.1";
88 String cdmDB
= "test";
89 String cdmUserName
= "root"; //root on pesiimport2
90 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
93 public static ICdmDataSource
cdm_test_local_euromed(){
94 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
95 String cdmServer
= "127.0.0.1";
96 String cdmDB
= "euroMed";
97 String cdmUserName
= "root";
98 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
101 public static ICdmDataSource
cdm_test_local_euromed2(){
102 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
103 String cdmServer
= "127.0.0.1";
104 String cdmDB
= "euroMed2";
105 String cdmUserName
= "root";
106 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
108 public static ICdmDataSource
cdm_test_local_euromed3(){
109 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
110 String cdmServer
= "127.0.0.1";
111 String cdmDB
= "euroMed3";
112 String cdmUserName
= "root";
113 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
117 public static ICdmDataSource
cdm_local_EDITImport(){
118 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
119 String cdmServer
= "127.0.0.1";
120 String cdmDB
= "EDITImport";
121 String cdmUserName
= "edit"; //root on pesiimport2
122 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
125 public static ICdmDataSource
cdm_test_euroMed(){
126 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
127 String cdmServer
= "160.45.63.175";
128 String cdmDB
= "cdm_test_euromed";
129 String cdmUserName
= "edit";
130 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
133 public static ICdmDataSource
cdm_pesi_euromed(){
134 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
135 String cdmServer
= "160.45.63.175";
136 String cdmDB
= "cdm_pesi_euromed";
137 String cdmUserName
= "edit";
138 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
141 public static ICdmDataSource
cdm_corvidae_dev(){
142 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
143 String cdmServer
= "160.45.63.175";
144 String cdmDB
= "cdm_corvidae";
145 String cdmUserName
= "edit";
146 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
149 public static ICdmDataSource
cdm_ildis_dev(){
150 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
151 String cdmServer
= "160.45.63.175";
152 String cdmDB
= "cdm_edit_ildis";
153 String cdmUserName
= "edit";
154 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
158 // public static ICdmDataSource cdm_ildis_production(){
159 // DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
160 // String cdmServer = "160.45.63.171";
161 // String cdmDB = "cdm_edit_ildis";
162 // String cdmUserName = "edit";
163 // return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
167 public static ICdmDataSource
cdm_redlist_moose_dev(){
168 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
169 String cdmServer
= "160.45.63.175";
170 String cdmDB
= "cdm_mt_moose";
171 String cdmUserName
= "edit";
172 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
175 public static ICdmDataSource
cdm_redlist_standardlist_dev(){
176 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
177 String cdmServer
= "160.45.63.175";
178 String cdmDB
= "cdm_mt_standardliste";
179 String cdmUserName
= "edit";
180 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
183 public static ICdmDataSource
cdm_cyprus_dev(){
184 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
185 String cdmServer
= "160.45.63.175";
186 String cdmDB
= "cdm_cyprus";
187 String cdmUserName
= "edit";
188 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
191 public static ICdmDataSource
cdm_cyprus_production(){
192 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
193 String cdmServer
= "160.45.63.171";
194 String cdmDB
= "cdm_production_cyprus";
195 String cdmUserName
= "edit";
196 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
199 public static ICdmDataSource
cdm_cyprus_production_tunnel(){
200 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
201 String cdmServer
= "127.0.0.1";
203 String cdmDB
= "cdm_production_cyprus";
204 String cdmUserName
= "edit";
205 return makeDestination(dbType
, cdmServer
, cdmDB
, port
, cdmUserName
, null);
208 public static ICdmDataSource
cdm_cyprus_dev_tunnel(){
209 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
210 String cdmServer
= "127.0.0.1";
212 String cdmDB
= "cdm_cyprus";
213 String cdmUserName
= "edit";
214 return makeDestination(dbType
, cdmServer
, cdmDB
, port
, cdmUserName
, null);
217 public static ICdmDataSource
cdm_campanulaceae_production(){
218 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
219 String cdmServer
= "160.45.63.171";
220 String cdmDB
= "cdm_production_campanulaceae";
221 String cdmUserName
= "edit";
222 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
225 public static ICdmDataSource
cdm_flora_malesiana_preview(){
226 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
227 String cdmServer
= "160.45.63.175";
228 String cdmDB
= "cdm_edit_flora_malesiana";
229 String cdmUserName
= "edit";
230 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
233 public static ICdmDataSource
cdm_flora_malesiana_production(){
234 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
235 String cdmServer
= "160.45.63.171";
236 String cdmDB
= "cdm_production_flora_malesiana";
237 String cdmUserName
= "edit";
238 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
241 public static ICdmDataSource
cdm_portal_test_localhost(){
242 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
243 String cdmServer
= "127.0.0.1";
244 String cdmDB
= "cdm_portal_test";
245 String cdmUserName
= "edit";
246 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
249 public static ICdmDataSource
cdm_portal_test_localhost2(){
250 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
251 String cdmServer
= "127.0.0.1";
252 String cdmDB
= "cdm_portal_test2";
253 String cdmUserName
= "edit";
254 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
257 public static ICdmDataSource
cdm_local_cichorieae(){
258 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
259 String cdmServer
= "127.0.0.1";
260 String cdmDB
= "cdm_edit_cichorieae";
261 String cdmUserName
= "edit";
262 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
265 public static ICdmDataSource
cdm_local_dipera(){
266 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
267 String cdmServer
= "127.0.0.1";
268 String cdmDB
= "cdm_edit_diptera";
269 String cdmUserName
= "edit";
270 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
273 public static ICdmDataSource
cdm_local_palmae(){
274 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
275 String cdmServer
= "127.0.0.1";
276 String cdmDB
= "cdm_edit_palmae";
277 String cdmUserName
= "edit";
278 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
281 public static ICdmDataSource
cdm_globis_dev(){
282 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
283 String cdmServer
= "160.45.63.175";
284 String cdmDB
= "cdm_edit_globis";
285 String cdmUserName
= "edit";
286 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
289 public static ICdmDataSource
cdm_globis_production(){
290 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
291 String cdmServer
= "160.45.63.171";
292 String cdmDB
= "cdm_production_globis";
293 String cdmUserName
= "edit";
294 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
297 public static ICdmDataSource
cdm_local_globis(){
298 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
299 String cdmServer
= "127.0.0.1";
300 String cdmDB
= "cdm_globis";
301 String cdmUserName
= "edit";
302 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
305 public static ICdmDataSource
cdm_local_postgres_CdmTest(){
306 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.PostgreSQL
;
307 String cdmServer
= "127.0.0.1";
308 String cdmDB
= "CdmTest";
309 String cdmUserName
= "edit";
310 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
313 public static ICdmDataSource
cdm_local_tdwg2010(){
314 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
315 String cdmServer
= "127.0.0.1";
316 String cdmDB
= "cdm_tdwg2010";
317 String cdmUserName
= "edit";
318 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
322 public static ICdmDataSource
NULL(){
327 public static ICdmDataSource
localH2(){
328 return CdmDataSource
.NewH2EmbeddedInstance("cdm", "sa", "");
331 public static ICdmDataSource
localH2(String database
, String username
, String filePath
){
332 return CdmDataSource
.NewH2EmbeddedInstance(database
, "sa", "", filePath
, null);
335 public static ICdmDataSource
localH2Salvador(){
336 return CdmDataSource
.NewH2EmbeddedInstance("salvador", "sa", "");
339 public static ICdmDataSource
localH2Armeria(){
340 return CdmDataSource
.NewH2EmbeddedInstance("armeria", "sa", "");
344 public static ICdmDataSource
localH2Cichorieae(){
345 return CdmDataSource
.NewH2EmbeddedInstance("cichorieae", "sa", "");
348 public static ICdmDataSource
localH2Palmae(){
349 return CdmDataSource
.NewH2EmbeddedInstance("palmae", "sa", "");
352 public static ICdmDataSource
localH2EuroMed(){
353 return CdmDataSource
.NewH2EmbeddedInstance("euroMed", "sa", "");
356 public static ICdmDataSource
localH2Erms(){
357 return CdmDataSource
.NewH2EmbeddedInstance("erms", "sa", "");
361 public static ICdmDataSource
cdm_algaterra_preview(){
362 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
363 String cdmServer
= "160.45.63.175";
364 String cdmDB
= "cdm_edit_algaterra";
365 String cdmUserName
= "edit";
366 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
369 public static ICdmDataSource
cdm_algaterra_production(){
370 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
371 String cdmServer
= "160.45.63.171";
372 String cdmDB
= "cdm_production_algaterra";
373 String cdmUserName
= "edit";
374 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
377 public static ICdmDataSource
cdm_edit_cichorieae_local_PG(){
378 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.PostgreSQL
;
379 String cdmServer
= "127.0.0.1";
380 String cdmDB
= "cdm_edit_cichorieae_a";
381 String cdmUserName
= "edit";
383 return makeDestination(dbType
, cdmServer
, cdmDB
, port
, cdmUserName
, null);
386 public static ICdmDataSource
cdm_cichorieae_preview(){
387 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
388 String cdmServer
= "160.45.63.175";
389 String cdmDB
= "cdm_edit_cichorieae";
390 String cdmUserName
= "edit";
391 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
394 public static ICdmDataSource
cdm_production_cichorieae(){
395 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
396 String cdmServer
= "160.45.63.171";
397 // String cdmServer = "127.0.0.1";
398 String cdmDB
= "cdm_production_cichorieae";
399 String cdmUserName
= "edit";
400 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
403 public static ICdmDataSource
cdm_production_palmae(){
404 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
405 String cdmServer
= "160.45.63.171";
406 String cdmDB
= "cdm_production_palmae";
407 String cdmUserName
= "edit";
408 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
411 public static ICdmDataSource
cdm_production_flora_deutschland(){
412 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
413 String cdmServer
= "160.45.63.171";
414 String cdmDB
= "cdm_production_rl_standardliste";
415 String cdmUserName
= "edit";
416 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
420 public static ICdmDataSource
cdm_production_diptera(){
421 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
422 String cdmServer
= "160.45.63.171";
423 String cdmDB
= "cdm_production_diptera";
424 String cdmUserName
= "edit";
425 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
428 public static ICdmDataSource
cdm_edit_cichorieae_preview(){
429 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
430 String cdmServer
= "127.0.0.1";
431 String cdmDB
= "cdm_edit_cichorieae";
432 String cdmUserName
= "edit";
434 return makeDestination(dbType
, cdmServer
, cdmDB
, port
, cdmUserName
, null);
437 public static ICdmDataSource
cdm_edit_cichorieae_preview_direct(){
438 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
439 String cdmServer
= "160.45.63.175";
440 String cdmDB
= "cdm_edit_cichorieae";
441 String cdmUserName
= "edit";
443 return makeDestination(dbType
, cdmServer
, cdmDB
, port
, cdmUserName
, null);
446 public static ICdmDataSource
cdm_production_piB(String database
){
447 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
448 String cdmServer
= "160.45.63.171";
449 String cdmDB
= "cdm_production_" + database
+ "_pilot";
450 String cdmUserName
= "edit";
451 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
454 public static ICdmDataSource
cdm_local_piB(String database
){
455 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
456 String cdmServer
= "127.0.0.1";
457 String cdmDB
= "piB_" + database
;
458 String cdmUserName
= "root";
459 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
465 public static ICdmDataSource
mon_cdm() {
466 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
467 String cdmServer
= "localhost";
468 String cdmDB
= "cdm_local";
469 String cdmUserName
= "root";
470 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
473 public static ICdmDataSource
proibiosphere_chenopodium_local() {
474 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
475 String cdmServer
= "localhost";
476 String cdmDB
= "cdm_production_proibiosphere_chenopodium_pilot";
477 String cdmUserName
= "root";
478 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
481 public static ICdmDataSource
proibiosphere_ants_local() {
482 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
483 String cdmServer
= "localhost";
484 String cdmDB
= "cdm_production_proibiosphere_ants_pilot";
485 String cdmUserName
= "root";
486 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
489 public static ICdmDataSource
proibiosphere_fungi_local() {
490 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
491 String cdmServer
= "localhost";
492 String cdmDB
= "cdm_production_proibiosphere_fungi_pilot";
493 String cdmUserName
= "root";
494 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
497 public static ICdmDataSource
proibiosphere_campylopus_local() {
498 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
499 String cdmServer
= "localhost";
500 String cdmDB
= "cdm_production_proibiosphere_campylopus_pilot";
501 String cdmUserName
= "root";
502 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
506 public static ICdmDataSource
proibiosphere_eupolybothrus_local() {
507 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
508 String cdmServer
= "localhost";
509 String cdmDB
= "cdm_production_proibiosphere_eupolybothrus_pilot";
510 String cdmUserName
= "root";
511 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
514 public static ICdmDataSource
proibiosphere_spiders_local() {
515 DatabaseTypeEnum dbType
= DatabaseTypeEnum
.MySQL
;
516 String cdmServer
= "localhost";
517 String cdmDB
= "cdm_production_proibiosphere_spiders_pilot";
518 String cdmUserName
= "root";
519 return makeDestination(dbType
, cdmServer
, cdmDB
, -1, cdmUserName
, null);
521 // public static ICdmDataSource LAPTOP_HP(){
522 // DatabaseTypeEnum dbType = DatabaseTypeEnum.SqlServer2005;
523 // String cdmServer = "LAPTOPHP";
524 // String cdmDB = "cdmTest";
525 // String cdmUserName = "edit";
526 // return makeDestination(cdmServer, cdmDB, -1, cdmUserName, null);
534 * TODO only supports MySQL and PostgreSQL
544 public static ICdmDataSource
makeDestination(DatabaseTypeEnum dbType
, String cdmServer
, String cdmDB
, int port
, String cdmUserName
, String pwd
){
545 //establish connection
546 pwd
= AccountStore
.readOrStorePassword(cdmServer
, cdmDB
, cdmUserName
, pwd
);
547 ICdmDataSource destination
;
548 if(dbType
.equals(DatabaseTypeEnum
.MySQL
)){
549 destination
= CdmDataSource
.NewMySqlInstance(cdmServer
, cdmDB
, port
, cdmUserName
, pwd
, null);
550 } else if(dbType
.equals(DatabaseTypeEnum
.PostgreSQL
)){
551 destination
= CdmDataSource
.NewPostgreSQLInstance(cdmServer
, cdmDB
, port
, cdmUserName
, pwd
, null);
554 throw new RuntimeException("Unsupported DatabaseType");
562 * Accepts a string array and tries to find a method returning an ICdmDataSource with
563 * the name of the given first string in the array
568 public static ICdmDataSource
chooseDestination(String
[] args
) {
573 if(args
.length
!= 1) {
577 String possibleDestination
= args
[0];
579 Method
[] methods
= CdmDestinations
.class.getMethods();
581 for (Method method
: methods
){
582 if(method
.getName().equals(possibleDestination
)){
584 return (ICdmDataSource
) method
.invoke(null, null);
585 } catch (IllegalArgumentException e
) {
586 // TODO Auto-generated catch block
588 } catch (IllegalAccessException e
) {
589 // TODO Auto-generated catch block
591 } catch (InvocationTargetException e
) {
592 // TODO Auto-generated catch block