Project

General

Profile

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

    
18
/**
19
 * @author a.babadshanjan
20
 * @created 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 faunEu(){
37
		//	Fauna Europaea
38
		String dbms = Source.SQL_SERVER_2008;
39
       	String strServer = "BGBM42";               // "192.168.1.36";
40
        String strDB = "FaunEu";
41
		int port = 1433;
42
		String userName = "WebUser";
43
		return  ImportUtils.makeSource(dbms, strServer, strDB, port, userName, null);
44
	}
45
	
46
	public static Source faunaEu_previous(){
47
		//	Fauna Europaea
48
		String dbms = Source.SQL_SERVER_2008;
49
 		String strServer = "BGBM42";               // "192.168.1.36";
50
 		String strDB = "FaunEu_2_2";
51
		int port = 1433;
52
		String userName = "WebUser";
53
		return  ImportUtils.makeSource(dbms, strServer, strDB, port, userName, null);
54
	}
55
	public static Source faunaEu_old(){
56
		//	Fauna Europaea
57
		String dbms = Source.SQL_SERVER_2008;
58
		String strServer = "BGBM42";               // "192.168.1.36";
59
		String strDB = "FaunaEu_1_3";
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 PESI_IF(){
87
		//	BerlinModel - Pesi-IF
88
		String dbms = Source.SQL_SERVER_2008;
89
		String strServer = "BGBM42";
90
		String strDB = "IF";
91
		int port = 1433;
92
		String userName = "WebUser";
93
		return  makeSource(dbms, strServer, strDB, port, userName, null);
94
	}
95
	
96
	/**
97
	 * Initializes the source.
98
	 * @param dbms
99
	 * @param strServer
100
	 * @param strDB
101
	 * @param port
102
	 * @param userName
103
	 * @param pwd
104
	 * @return the source
105
	 */
106
	private static Source makeSource(String dbms, String strServer, String strDB, int port, String userName, String pwd ){
107
		//establish connection
108
		Source source = null;
109
		source = new Source(dbms, strServer, strDB);
110
		source.setPort(port);
111
			
112
		pwd = AccountStore.readOrStorePassword(dbms, strServer, userName, pwd);
113
		source.setUserAndPwd(userName, pwd);
114
		// write pwd to account store
115
		return source;
116
	}
117

    
118
	
119
}
(11-11/11)