1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2009 EDIT
|
4
|
* European Distributed Institute of Taxonomy
|
5
|
* http://www.e-taxonomy.eu
|
6
|
*
|
7
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
8
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
9
|
*/
|
10
|
package eu.etaxonomy.cdm.app.pesi;
|
11
|
|
12
|
|
13
|
import org.apache.log4j.Logger;
|
14
|
|
15
|
import eu.etaxonomy.cdm.common.AccountStore;
|
16
|
import eu.etaxonomy.cdm.io.common.Source;
|
17
|
|
18
|
/**
|
19
|
* @author e.-m.lee
|
20
|
* @date 16.02.2010
|
21
|
*
|
22
|
*/
|
23
|
public class PesiDestinations {
|
24
|
@SuppressWarnings("unused")
|
25
|
private static final Logger logger = Logger.getLogger(PesiDestinations.class);
|
26
|
|
27
|
public static Source pesi_test_local_CDM_EM2PESI(){
|
28
|
// CDM - PESI
|
29
|
String dbms = Source.SQL_SERVER_2008;
|
30
|
String strServer = "localhost";
|
31
|
String strDB = "CDM_EM2PESI";
|
32
|
int port = 1433;
|
33
|
String userName = "pesiexport";// "pesiexport3";
|
34
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
35
|
}
|
36
|
|
37
|
public static Source pesi_test_local_CDM_EM2PESI_tmp(){
|
38
|
// CDM - PESI
|
39
|
String dbms = Source.SQL_SERVER_2008;
|
40
|
String strServer = "localhost";
|
41
|
String strDB = "CDMTMP_EM2PESI";
|
42
|
int port = 1433;
|
43
|
String userName = "pesiexport2";
|
44
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
45
|
}
|
46
|
|
47
|
public static Source pesi_test_local_CDM_FE2PESI(){
|
48
|
// CDM - PESI
|
49
|
String dbms = Source.SQL_SERVER_2008;
|
50
|
String strServer = "pesiimport3"; //192.168.1.223
|
51
|
String strDB = "CDM_FE2PESI";
|
52
|
int port = 1433;
|
53
|
String userName = "pesiExportFaunaEu";
|
54
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
55
|
}
|
56
|
|
57
|
|
58
|
public static Source pesi_test_local_CDM_IF2PESI(){
|
59
|
// CDM - PESI
|
60
|
String dbms = Source.SQL_SERVER_2008;
|
61
|
String strServer = "pesiimport3"; //192.168.1.223
|
62
|
String strDB = "CDM_IF2PESI";
|
63
|
int port = 1433;
|
64
|
String userName = "pesiexport";
|
65
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
66
|
}
|
67
|
|
68
|
public static Source pesi_test_local_CDM_ERMS2PESI(){
|
69
|
// CDM - PESI
|
70
|
String dbms = Source.SQL_SERVER_2008;
|
71
|
String strServer = "pesiimport3";
|
72
|
String strDB = "CDM_ERMS2PESI";
|
73
|
int port = 1433;
|
74
|
String userName = "pesiexport";
|
75
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
76
|
}
|
77
|
|
78
|
|
79
|
|
80
|
public static Source pesi_test_bgbm42_CDM_DWH_FaEu(){
|
81
|
// CDM - PESI
|
82
|
String dbms = Source.SQL_SERVER_2008;
|
83
|
String strServer = "BGBM42";
|
84
|
String strDB = "CDM_DWH_FaEu";
|
85
|
int port = 1433;
|
86
|
String userName = "WebUser";
|
87
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
88
|
}
|
89
|
|
90
|
public static Source pesi_test_bgbm42_PESI_V11(){
|
91
|
// CDM - PESI
|
92
|
String dbms = Source.SQL_SERVER_2008;
|
93
|
String strServer = "BGBM42";
|
94
|
String strDB = "PESI_v11";
|
95
|
int port = 1433;
|
96
|
String userName = "WebUser";
|
97
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
98
|
}
|
99
|
|
100
|
/**
|
101
|
* Initializes the source.
|
102
|
* @param dbms
|
103
|
* @param strServer
|
104
|
* @param strDB
|
105
|
* @param port
|
106
|
* @param userName
|
107
|
* @param pwd
|
108
|
* @return the source
|
109
|
*/
|
110
|
private static Source makeSource(String dbms, String strServer, String strDB, int port, String userName, String pwd ){
|
111
|
//establish connection
|
112
|
Source source = null;
|
113
|
source = new Source(dbms, strServer, strDB);
|
114
|
source.setPort(port);
|
115
|
|
116
|
pwd = AccountStore.readOrStorePassword(dbms, strServer, userName, pwd);
|
117
|
source.setUserAndPwd(userName, pwd);
|
118
|
// write pwd to account store
|
119
|
return source;
|
120
|
}
|
121
|
|
122
|
}
|