Project

General

Profile

Download (4.11 KB) Statistics
| Branch: | Revision:
1
/**
2
* Copyright (C) 2007 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

    
10
package eu.etaxonomy.cdm.app.pesi;
11

    
12
import org.apache.log4j.Logger;
13

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

    
18
/**
19
 * @author a.babadshanjan
20
 * @since 12.05.2009
21
 */
22
public class PesiSources {
23
	@SuppressWarnings("unused")
24
	private static final Logger logger = Logger.getLogger(PesiSources.class);
25

    
26
	public static Source faunEu_pesi3(){
27
		//	Fauna Europaea auf pesiimport3
28
		String dbms = Source.SQL_SERVER_2008;
29
        String strServer = "pesiimport3";
30
        String strDB = "FaunEu";
31
		int port = 1433;
32
		String userName = "pesiExportFaunaEu";
33
		return  ImportUtils.makeSource(dbms, strServer, strDB, port, userName, null);
34
	}
35

    
36
	public static Source mfn_faunEu_pesi3(){
37
		//	Fauna Europaea auf pesiimport3
38
		String dbms = Source.SQL_SERVER_2008;
39
        String strServer = "pesiimport3";
40
        String strDB = "MfN_FaunaEuropaea";
41
		int port = 1433;
42
		String userName = "pesiExportFaunaEu";
43
		return  ImportUtils.makeSource(dbms, strServer, strDB, port, userName, null);
44
	}
45

    
46
	public static Source faunEu(){
47
		//	Fauna Europaea
48
		String dbms = Source.SQL_SERVER_2008;
49
       	String strServer = "BGBM42";               // "192.168.1.36";
50
        String strDB = "FaunEu";
51
		int port = 1433;
52
		String userName = "WebUser";
53
		return  ImportUtils.makeSource(dbms, strServer, strDB, port, userName, null);
54
	}
55

    
56
	public static Source faunaEu_previous(){
57
		//	Fauna Europaea
58
		String dbms = Source.SQL_SERVER_2008;
59
 		String strServer = "BGBM42";               // "192.168.1.36";
60
 		String strDB = "FaunEu_2_2";
61
		int port = 1433;
62
		String userName = "WebUser";
63
		return  ImportUtils.makeSource(dbms, strServer, strDB, port, userName, null);
64
	}
65

    
66
	public static Source PESI_ERMS(){
67
		//	BerlinModel - Pesi-ERMS
68
		String dbms = Source.SQL_SERVER_2008;
69
		String strServer = "BGBM42";
70
		String strDB = "ERMS";
71
		int port = 1433;
72
		String userName = "WebUser";
73
		return  makeSource(dbms, strServer, strDB, port, userName, null);
74
	}
75

    
76

    
77
	public static Source PESI3_ERMS(){
78
		//	BerlinModel - Pesi-ERMS
79
		String dbms = Source.SQL_SERVER_2008;
80
		String strServer = "Pesiimport3";
81
		String strDB = "ERMS";
82
		int port = 1433;
83
		String userName = "pesiexport";
84
		return  makeSource(dbms, strServer, strDB, port, userName, null);
85
	}
86

    
87
   public static Source PESI2019_ERMS(){
88
        //  BerlinModel - Pesi-ERMS
89
        String dbms = Source.SQL_SERVER_2008;
90
        String strServer = "BGBM-PESISQL\\SQLEXPRESS";
91
        String strDB = "erms";
92
        int port = 1434;
93
        String userName = "pesiimport";
94
        return  makeSource(dbms, strServer, strDB, port, userName, null);
95
    }
96

    
97
	public static Source PESI3_IF(){
98
		//	BerlinModel - Pesi-ERMS
99
		String dbms = Source.SQL_SERVER_2008;
100
		String strServer = "Pesiimport3";
101
		String strDB = "IF_2014_06";
102
		int port = 1433;
103
		String userName = "pesi2019";
104
		return  makeSource(dbms, strServer, strDB, port, userName, null);
105
	}
106

    
107
	public static Source PESI_IF(){
108
		//	BerlinModel - Pesi-IF
109
		String dbms = Source.SQL_SERVER_2008;
110
		String strServer = "BGBM42";
111
		String strDB = "IF";
112
		int port = 1433;
113
		String userName = "WebUser";
114
		return  makeSource(dbms, strServer, strDB, port, userName, null);
115
	}
116

    
117
	/**
118
	 * Initializes the source.
119
	 * @param dbms
120
	 * @param strServer
121
	 * @param strDB
122
	 * @param port
123
	 * @param userName
124
	 * @param pwd
125
	 * @return the source
126
	 */
127
	private static Source makeSource(String dbms, String strServer, String strDB, int port, String userName, String pwd ){
128
		//establish connection
129
		Source source = null;
130
		source = new Source(dbms, strServer, strDB);
131
		source.setPort(port);
132

    
133
		pwd = AccountStore.readOrStorePassword(dbms, strServer, userName, pwd);
134
		source.setUserAndPwd(userName, pwd);
135
		// write pwd to account store
136
		return source;
137
	}
138

    
139

    
140
}
(12-12/12)