1
|
/**
|
2
|
* Copyright (C) 2009 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.app.pesi;
|
10
|
|
11
|
import org.apache.log4j.Logger;
|
12
|
|
13
|
import eu.etaxonomy.cdm.config.AccountStore;
|
14
|
import eu.etaxonomy.cdm.io.common.Source;
|
15
|
|
16
|
/**
|
17
|
* @author e.-m.lee
|
18
|
* @since 16.02.2010
|
19
|
*/
|
20
|
public class PesiDestinations {
|
21
|
@SuppressWarnings("unused")
|
22
|
private static final Logger logger = Logger.getLogger(PesiDestinations.class);
|
23
|
|
24
|
public static Source pesi_test_local_CDM_EM2PESI(){
|
25
|
String dbms = Source.SQL_SERVER_2008;
|
26
|
String strServer = "pesiimport3";
|
27
|
String strDB = "CDM_EM2PESI";
|
28
|
int port = 1433;
|
29
|
String userName = "pesi2019";// "pesiexport3";
|
30
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
31
|
}
|
32
|
|
33
|
public static Source pesi_test_local_CDM_EM2PESI_2(){
|
34
|
String dbms = Source.SQL_SERVER_2008;
|
35
|
String strServer = "pesiimport3";
|
36
|
String strDB = "CDM_EM2PESI_2";
|
37
|
int port = 1433;
|
38
|
String userName = "pesi2019";
|
39
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
40
|
}
|
41
|
|
42
|
public static Source pesi_test_local_CDM_FE2PESI(){
|
43
|
String dbms = Source.SQL_SERVER_2008;
|
44
|
String strServer = "pesiimport3"; //192.168.1.223
|
45
|
String strDB = "CDM_FE2PESI";
|
46
|
int port = 1433;
|
47
|
String userName = "pesiExportFaunaEu";
|
48
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
49
|
}
|
50
|
|
51
|
public static Source pesi_test_local_CDM_IF2PESI(){
|
52
|
String dbms = Source.SQL_SERVER_2008;
|
53
|
String strServer = "pesiimport3";
|
54
|
String strDB = "CDM_IF2PESI";
|
55
|
int port = 1433;
|
56
|
String userName = "pesi2019";
|
57
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
58
|
}
|
59
|
|
60
|
public static Source pesi_test_local_CDM_IF2PESI_2(){
|
61
|
String dbms = Source.SQL_SERVER_2008;
|
62
|
String strServer = "pesiimport3";
|
63
|
String strDB = "CDM_IF2PESI_2";
|
64
|
int port = 1433;
|
65
|
String userName = "pesi2019";
|
66
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
67
|
}
|
68
|
|
69
|
public static Source pesi_test_local_CDM_ERMS2PESI(){
|
70
|
String dbms = Source.SQL_SERVER_2008;
|
71
|
String strServer = "pesiimport3";
|
72
|
String strDB = "CDM_ERMS2PESI";
|
73
|
int port = 1433;
|
74
|
String userName = "pesi2019";
|
75
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
76
|
}
|
77
|
|
78
|
public static Source pesi_test_local_CDM_ERMS2PESI_2(){
|
79
|
String dbms = Source.SQL_SERVER_2008;
|
80
|
String strServer = "pesiimport3";
|
81
|
String strDB = "CDM_ERMS2PESI_2";
|
82
|
int port = 1433;
|
83
|
String userName = "pesi2019";
|
84
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
85
|
}
|
86
|
|
87
|
public static Source pesi_test_bgbm42_CDM_DWH_FaEu(){
|
88
|
// CDM - PESI
|
89
|
String dbms = Source.SQL_SERVER_2008;
|
90
|
String strServer = "BGBM42";
|
91
|
String strDB = "CDM_DWH_FaEu";
|
92
|
int port = 1433;
|
93
|
String userName = "WebUser";
|
94
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
95
|
}
|
96
|
|
97
|
public static Source pesi_test_bgbm42_PESI_V11(){
|
98
|
// CDM - PESI
|
99
|
String dbms = Source.SQL_SERVER_2008;
|
100
|
String strServer = "BGBM42";
|
101
|
String strDB = "PESI_v11";
|
102
|
int port = 1433;
|
103
|
String userName = "WebUser";
|
104
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
105
|
}
|
106
|
|
107
|
|
108
|
/**
|
109
|
* Initializes the source.
|
110
|
* @param dbms
|
111
|
* @param strServer
|
112
|
* @param strDB
|
113
|
* @param port
|
114
|
* @param userName
|
115
|
* @param pwd
|
116
|
* @return
|
117
|
*/
|
118
|
private static Source makeSource(String dbms, String strServer, String strDB,
|
119
|
int port, String userName, String pwd ){
|
120
|
//establish connection
|
121
|
Source source = null;
|
122
|
source = new Source(dbms, strServer, strDB);
|
123
|
source.setPort(port);
|
124
|
|
125
|
pwd = AccountStore.readOrStorePassword(dbms, strServer, userName, pwd);
|
126
|
source.setUserAndPwd(userName, pwd);
|
127
|
// write pwd to account store
|
128
|
return source;
|
129
|
}
|
130
|
}
|