Project

General

Profile

Download (4.31 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.common;
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 a.babadshanjan
19
 * @since 12.05.2009
20
 */
21
public class PesiSources {
22
	@SuppressWarnings("unused")
23
	private static final Logger logger = Logger.getLogger(PesiSources.class);
24

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

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

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

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

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

    
75

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

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

    
96
    public static Source PESI2019_ERMS_2019(){
97
        //  BerlinModel - Pesi-ERMS
98
        String dbms = Source.SQL_SERVER_2008;
99
        String strServer = "BGBM-PESISQL\\SQLEXPRESS";
100
        String strDB = "erms2019_12_16";
101
        int port = 1434;
102
        String userName = "pesiimport";
103
        return  makeSource(dbms, strServer, strDB, port, userName, null);
104
    }
105

    
106
	public static Source PESI3_IF(){
107
		//	BerlinModel - Pesi-ERMS
108
		String dbms = Source.SQL_SERVER_2008;
109
		String strServer = "Pesiimport3";
110
		String strDB = "IF_2014_06";
111
		int port = 1433;
112
		String userName = "pesi2019";
113
		return  makeSource(dbms, strServer, strDB, port, userName, null);
114
	}
115

    
116
	public static Source PESI_IF(){
117
		//	BerlinModel - Pesi-IF
118
		String dbms = Source.SQL_SERVER_2008;
119
		String strServer = "BGBM42";
120
		String strDB = "IF";
121
		int port = 1433;
122
		String userName = "WebUser";
123
		return  makeSource(dbms, strServer, strDB, port, userName, null);
124
	}
125

    
126
	/**
127
	 * Initializes the source.
128
	 * @param dbms
129
	 * @param strServer
130
	 * @param strDB
131
	 * @param port
132
	 * @param userName
133
	 * @param pwd
134
	 * @return the source
135
	 */
136
	private static Source makeSource(String dbms, String strServer, String strDB, int port, String userName, String pwd ){
137
		//establish connection
138
		Source source = null;
139
		source = new Source(dbms, strServer, strDB);
140
		source.setPort(port);
141

    
142
		pwd = AccountStore.readOrStorePassword(dbms, strServer, userName, pwd);
143
		source.setUserAndPwd(userName, pwd);
144
		// write pwd to account store
145
		return source;
146
	}
147

    
148

    
149
}
(4-4/5)