Project

General

Profile

Download (2.83 KB) Statistics
| Branch: | Revision:
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_PESI_V10(){
28
		//	CDM - PESI
29
		String dbms = Source.SQL_SERVER_2008;
30
		String strServer = "C206\\MSSQLSERVER2";
31
		String strDB = "PESI_V10";
32
		int port = 1433;
33
		String userName = "sa";
34
		String pwd = "bewell";
35
		return makeSource(dbms, strServer, strDB, port, userName, pwd);
36
	}
37
	
38
	public static Source pesi_test_local_CDM_DWH_FaEu(){
39
		//	CDM - PESI
40
		String dbms = Source.SQL_SERVER_2008;
41
		String strServer = "C206\\MSSQLSERVER2";
42
		String strDB = "CDM_DWH_FaEu";
43
		int port = 1433;
44
		String userName = "sa";
45
		String pwd = "bewell";
46
		return makeSource(dbms, strServer, strDB, port, userName, pwd);
47
	}
48
	
49
	public static Source pesi_test_local_PESI_V11(){
50
		//	CDM - PESI
51
		String dbms = Source.SQL_SERVER_2008;
52
		String strServer = "C206\\MSSQLSERVER2";
53
		String strDB = "PESI_V11_LOCAL";
54
		int port = 1433;
55
		String userName = "sa";
56
		String pwd = "bewell";
57
		return makeSource(dbms, strServer, strDB, port, userName, pwd);
58
	}
59
	
60
	public static Source pesi_test_bgbm42_CDM_DWH_FaEu(){
61
		//	CDM - PESI
62
		String dbms = Source.SQL_SERVER_2008;
63
		String strServer = "BGBM42";
64
		String strDB = "CDM_DWH_FaEu";
65
		int port = 1433;
66
		String userName = "WebUser";
67
		String pwd = "";
68
		return makeSource(dbms, strServer, strDB, port, userName, pwd);
69
	}
70
	
71
	public static Source pesi_test_bgbm42_PESI_V11(){
72
		//	CDM - PESI
73
		String dbms = Source.SQL_SERVER_2008;
74
		String strServer = "BGBM42";
75
		String strDB = "PESI_v11";
76
		int port = 1433;
77
		String userName = "WebUser";
78
		String pwd = "";
79
		return makeSource(dbms, strServer, strDB, port, userName, pwd);
80
	}
81
	
82
	/**
83
	 * Initializes the source.
84
	 * @param dbms
85
	 * @param strServer
86
	 * @param strDB
87
	 * @param port
88
	 * @param userName
89
	 * @param pwd
90
	 * @return the source
91
	 */
92
	private static Source makeSource(String dbms, String strServer, String strDB, int port, String userName, String pwd ){
93
		//establish connection
94
		Source source = null;
95
		source = new Source(dbms, strServer, strDB);
96
		source.setPort(port);
97
			
98
		pwd = AccountStore.readOrStorePassword(dbms, strServer, userName, pwd);
99
		source.setUserAndPwd(userName, pwd);
100
		// write pwd to account store
101
		return source;
102
	}
103

    
104
}
(5-5/6)