Project

General

Profile

Download (3.41 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.common.AccountStore;
15
import eu.etaxonomy.cdm.io.common.Source;
16

    
17
/**
18
 * @author e.-m.lee
19
 * @since 16.02.2010
20
 *
21
 */
22
public class PesiDestinations {
23
	@SuppressWarnings("unused")
24
	private static final Logger logger = Logger.getLogger(PesiDestinations.class);
25
	
26
	public static Source pesi_test_local_CDM_EM2PESI(){
27
		//	CDM - PESI
28
		String dbms = Source.SQL_SERVER_2008;
29
		String strServer = "localhost";
30
		String strDB = "CDM_EM2PESI";
31
		int port = 1433;
32
		String userName =  "pesiexport";// "pesiexport3";
33
		return makeSource(dbms, strServer, strDB, port, userName, null);
34
	}
35
	
36
	public static Source pesi_test_local_CDM_EM2PESI_tmp(){
37
		//	CDM - PESI
38
		String dbms = Source.SQL_SERVER_2008;
39
		String strServer = "localhost";
40
		String strDB = "CDMTMP_EM2PESI";
41
		int port = 1433;
42
		String userName = "pesiexport";
43
		return makeSource(dbms, strServer, strDB, port, userName, null);
44
	}
45
	
46
	public static Source pesi_test_local_CDM_FE2PESI(){
47
		//	CDM - PESI
48
		String dbms = Source.SQL_SERVER_2008;
49
		String strServer = "pesiimport3"; //192.168.1.223
50
		String strDB = "CDM_FE2PESI";
51
		int port = 1433;
52
		String userName = "pesiExportFaunaEu";
53
		return makeSource(dbms, strServer, strDB, port, userName, null);
54
	}
55

    
56
	
57
	public static Source pesi_test_local_CDM_IF2PESI(){
58
		//	CDM - PESI
59
		String dbms = Source.SQL_SERVER_2008;
60
		String strServer = "pesiimport3"; //192.168.1.223
61
		String strDB = "CDMTMP_IF2PESI";
62
		int port = 1433;
63
		String userName = "pesiExportFaunaEu";
64
		return makeSource(dbms, strServer, strDB, port, userName, null);
65
	}
66
	
67
	public static Source pesi_test_local_CDM_ERMS2PESI(){
68
		//	CDM - PESI
69
		String dbms = Source.SQL_SERVER_2008;
70
		String strServer = "pesiimport3";
71
		String strDB = "CDM_ERMS2PESI";
72
		int port = 1433;
73
		String userName = "pesiexport";
74
		return makeSource(dbms, strServer, strDB, port, userName, null);
75
	}
76
	
77

    
78
	
79
	public static Source pesi_test_bgbm42_CDM_DWH_FaEu(){
80
		//	CDM - PESI
81
		String dbms = Source.SQL_SERVER_2008;
82
		String strServer = "BGBM42";
83
		String strDB = "CDM_DWH_FaEu";
84
		int port = 1433;
85
		String userName = "WebUser";
86
		return makeSource(dbms, strServer, strDB, port, userName, null);
87
	}
88
	
89
	public static Source pesi_test_bgbm42_PESI_V11(){
90
		//	CDM - PESI
91
		String dbms = Source.SQL_SERVER_2008;
92
		String strServer = "BGBM42";
93
		String strDB = "PESI_v11";
94
		int port = 1433;
95
		String userName = "WebUser";
96
		return makeSource(dbms, strServer, strDB, port, userName, null);
97
	}
98
	
99
	/**
100
	 * Initializes the source.
101
	 * @param dbms
102
	 * @param strServer
103
	 * @param strDB
104
	 * @param port
105
	 * @param userName
106
	 * @param pwd
107
	 * @return the source
108
	 */
109
	private static Source makeSource(String dbms, String strServer, String strDB, int port, String userName, String pwd ){
110
		//establish connection
111
		Source source = null;
112
		source = new Source(dbms, strServer, strDB);
113
		source.setPort(port);
114
			
115
		pwd = AccountStore.readOrStorePassword(dbms, strServer, userName, pwd);
116
		source.setUserAndPwd(userName, pwd);
117
		// write pwd to account store
118
		return source;
119
	}
120

    
121
}
(4-4/10)