Project

General

Profile

Download (3.63 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
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"; //192.168.1.223
54
		String strDB = "CDMTMP_IF2PESI";
55
		int port = 1433;
56
		String userName = "pesiExportFaunaEu";
57
		return makeSource(dbms, strServer, strDB, port, userName, null);
58
	}
59

    
60
	public static Source pesi_test_local_CDM_ERMS2PESI(){
61
		String dbms = Source.SQL_SERVER_2008;
62
		String strServer = "pesiimport3";
63
		String strDB = "CDM_ERMS2PESI";
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_2(){
70
        String dbms = Source.SQL_SERVER_2008;
71
        String strServer = "pesiimport3";
72
        String strDB = "CDM_ERMS2PESI_2";
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_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
	/**
100
	 * Initializes the source.
101
	 * @param dbms
102
	 * @param strServer
103
	 * @param strDB
104
	 * @param port
105
	 * @param userName
106
	 * @param pwd
107
	 * @return
108
	 */
109
	private static Source makeSource(String dbms, String strServer, String strDB,
110
	        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
}
(6-6/12)