Project

General

Profile

Download (3.39 KB) Statistics
| Branch: | Revision:
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

    
12
import org.apache.log4j.Logger;
13

    
14
import eu.etaxonomy.cdm.config.AccountStore;
15
import eu.etaxonomy.cdm.io.common.Source;
16

    
17
/**
18
 * @author e.-m.lee
19
 * @since 16.02.2010
20
 */
21
public class PesiDestinations {
22
	@SuppressWarnings("unused")
23
	private static final Logger logger = Logger.getLogger(PesiDestinations.class);
24

    
25
	public static Source pesi_test_local_CDM_EM2PESI(){
26
		//	CDM - PESI
27
		String dbms = Source.SQL_SERVER_2008;
28
		String strServer = "localhost";
29
		String strDB = "CDM_EM2PESI";
30
		int port = 1433;
31
		String userName =  "pesiexport";// "pesiexport3";
32
		return makeSource(dbms, strServer, strDB, port, userName, null);
33
	}
34

    
35
	public static Source pesi_test_local_CDM_EM2PESI_tmp(){
36
		//	CDM - PESI
37
		String dbms = Source.SQL_SERVER_2008;
38
		String strServer = "localhost";
39
		String strDB = "CDMTMP_EM2PESI";
40
		int port = 1433;
41
		String userName = "pesiexport";
42
		return makeSource(dbms, strServer, strDB, port, userName, null);
43
	}
44

    
45
	public static Source pesi_test_local_CDM_FE2PESI(){
46
		//	CDM - PESI
47
		String dbms = Source.SQL_SERVER_2008;
48
		String strServer = "pesiimport3"; //192.168.1.223
49
		String strDB = "CDM_FE2PESI";
50
		int port = 1433;
51
		String userName = "pesiExportFaunaEu";
52
		return makeSource(dbms, strServer, strDB, port, userName, null);
53
	}
54

    
55

    
56
	public static Source pesi_test_local_CDM_IF2PESI(){
57
		//	CDM - PESI
58
		String dbms = Source.SQL_SERVER_2008;
59
		String strServer = "pesiimport3"; //192.168.1.223
60
		String strDB = "CDMTMP_IF2PESI";
61
		int port = 1433;
62
		String userName = "pesiExportFaunaEu";
63
		return makeSource(dbms, strServer, strDB, port, userName, null);
64
	}
65

    
66
	public static Source pesi_test_local_CDM_ERMS2PESI(){
67
		//	CDM - PESI
68
		String dbms = Source.SQL_SERVER_2008;
69
		String strServer = "pesiimport3";
70
		String strDB = "CDM_ERMS2PESI";
71
		int port = 1433;
72
		String userName = "pesi2019";
73
		return makeSource(dbms, strServer, strDB, port, userName, null);
74
	}
75

    
76

    
77

    
78
	public static Source pesi_test_bgbm42_CDM_DWH_FaEu(){
79
		//	CDM - PESI
80
		String dbms = Source.SQL_SERVER_2008;
81
		String strServer = "BGBM42";
82
		String strDB = "CDM_DWH_FaEu";
83
		int port = 1433;
84
		String userName = "WebUser";
85
		return makeSource(dbms, strServer, strDB, port, userName, null);
86
	}
87

    
88
	public static Source pesi_test_bgbm42_PESI_V11(){
89
		//	CDM - PESI
90
		String dbms = Source.SQL_SERVER_2008;
91
		String strServer = "BGBM42";
92
		String strDB = "PESI_v11";
93
		int port = 1433;
94
		String userName = "WebUser";
95
		return makeSource(dbms, strServer, strDB, port, userName, null);
96
	}
97

    
98
	/**
99
	 * Initializes the source.
100
	 * @param dbms
101
	 * @param strServer
102
	 * @param strDB
103
	 * @param port
104
	 * @param userName
105
	 * @param pwd
106
	 * @return the source
107
	 */
108
	private static Source makeSource(String dbms, String strServer, String strDB, int port, String userName, String pwd ){
109
		//establish connection
110
		Source source = null;
111
		source = new Source(dbms, strServer, strDB);
112
		source.setPort(port);
113

    
114
		pwd = AccountStore.readOrStorePassword(dbms, strServer, userName, pwd);
115
		source.setUserAndPwd(userName, pwd);
116
		// write pwd to account store
117
		return source;
118
	}
119

    
120
}
(5-5/11)