latest developments for Index Fungorum import
[cdmlib-apps.git] / cdm-pesi / src / main / java / eu / etaxonomy / cdm / app / pesi / PesiSources.java
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 = "pesiexport";
33 return ImportUtils.makeSource(dbms, strServer, strDB, port, userName, null);
34 }
35
36 public static Source faunEu(){
37 // Fauna Europaea
38
39 String dbms = Source.SQL_SERVER_2008;
40
41 String strServer = "BGBM42"; // "192.168.1.36";
42
43 String strDB = "FaunEu";
44 int port = 1433;
45 String userName = "WebUser";
46 return ImportUtils.makeSource(dbms, strServer, strDB, port, userName, null);
47 }
48
49 public static Source faunaEu_previous(){
50 // Fauna Europaea
51
52 String dbms = Source.SQL_SERVER_2008;
53
54 String strServer = "BGBM42"; // "192.168.1.36";
55
56 String strDB = "FaunEu_2_2";
57 int port = 1433;
58 String userName = "WebUser";
59 return ImportUtils.makeSource(dbms, strServer, strDB, port, userName, null);
60 }
61 public static Source faunaEu_old(){
62 // Fauna Europaea
63
64 String dbms = Source.SQL_SERVER_2008;
65
66 String strServer = "BGBM42"; // "192.168.1.36";
67
68 String strDB = "FaunaEu_1_3";
69 int port = 1433;
70 String userName = "WebUser";
71 return ImportUtils.makeSource(dbms, strServer, strDB, port, userName, null);
72 }
73
74 public static Source PESI_ERMS(){
75 // BerlinModel - Pesi-ERMS
76 String dbms = Source.SQL_SERVER_2008;
77 String strServer = "BGBM42";
78 String strDB = "ERMS";
79 int port = 1433;
80 String userName = "WebUser";
81 return makeSource(dbms, strServer, strDB, port, userName, null);
82 }
83
84 public static Source PESI_IF(){
85 // BerlinModel - Pesi-IF
86 String dbms = Source.SQL_SERVER_2008;
87 String strServer = "BGBM42";
88 String strDB = "IF";
89 int port = 1433;
90 String userName = "WebUser";
91 return makeSource(dbms, strServer, strDB, port, userName, null);
92 }
93
94 /**
95 * Initializes the source.
96 * @param dbms
97 * @param strServer
98 * @param strDB
99 * @param port
100 * @param userName
101 * @param pwd
102 * @return the source
103 */
104 private static Source makeSource(String dbms, String strServer, String strDB, int port, String userName, String pwd ){
105 //establish connection
106 Source source = null;
107 source = new Source(dbms, strServer, strDB);
108 source.setPort(port);
109
110 pwd = AccountStore.readOrStorePassword(dbms, strServer, userName, pwd);
111 source.setUserAndPwd(userName, pwd);
112 // write pwd to account store
113 return source;
114 }
115
116
117 }