update BGBM111 -> BGBM42, delete EDIT_palmae
[cdmlib-apps.git] / app-import / src / main / java / eu / etaxonomy / cdm / app / berlinModelImport / BerlinModelSources.java
1
2 /**
3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
9 */
10
11 package eu.etaxonomy.cdm.app.berlinModelImport;
12
13 import org.apache.log4j.Logger;
14
15 import eu.etaxonomy.cdm.common.AccountStore;
16 import eu.etaxonomy.cdm.io.common.Source;
17
18
19 public class BerlinModelSources {
20 @SuppressWarnings("unused")
21 private static final Logger logger = Logger.getLogger(BerlinModelSources.class);
22
23 public static Source euroMed(){
24 // BerlinModel - Euro+Med
25 String dbms = Source.SQL_SERVER_2005;
26 String strServer = "BGBM42";
27 String strDB = "EuroPlusMed_00_Edit";
28 int port = 1247;
29 String userName = "webUser";
30 return makeSource(dbms, strServer, strDB, port, userName, null);
31 }
32
33 public static Source Campanulaceae(){
34 // BerlinModel - Campanulaceae
35 String dbms = Source.SQL_SERVER_2005;
36 String strServer = "BGBM42";
37 String strDB = "Campanulaceae";
38 int port = 1247;
39 String userName = "webUser";
40 return makeSource(dbms, strServer, strDB, port, userName, null);
41 }
42
43 public static Source ILDIS(){
44 // BerlinModel - EditWP6
45 String dbms = Source.SQL_SERVER_2008;
46 String strServer = "BGBM42";
47 String strDB = "ILDIS_EM_BM";
48 int port = 1433;
49 String userName = "webUser";
50 return makeSource(dbms, strServer, strDB, port, userName, null);
51 }
52
53 public static Source EDIT_CICHORIEAE(){
54 // BerlinModel - EditWP6
55 String dbms = Source.SQL_SERVER_2005;
56 String strServer = "BGBM42";
57 String strDB = "EditWP6";
58 int port = 1247;
59 String userName = "webUser";
60 return makeSource(dbms, strServer, strDB, port, userName, null);
61 }
62
63 public static Source EDIT_Taraxacum(){
64 // BerlinModel - EditWP6
65 String dbms = Source.SQL_SERVER_2005;
66 String strServer = "BGBM42";
67 String strDB = "Edit_Taraxacum";
68 int port = 1247;
69 String userName = "webUser";
70 return makeSource(dbms, strServer, strDB, port, userName, null);
71 }
72
73 public static Source EDIT_Diptera(){
74 // BerlinModel - EDIT_Diptera
75 String dbms = Source.SQL_SERVER_2005;
76 String strServer = "BGBM42";
77 String strDB = "EDIT_Diptera";
78 int port = 1247;
79 String userName = "webUser";
80 return makeSource(dbms, strServer, strDB, port, userName, null);
81 }
82
83 public static Source El_Salvador(){
84 // BerlinModel - El_Salvador
85 String dbms = Source.SQL_SERVER_2005;
86 String strServer = "SQL2000Intern";
87 String strDB = "Salvador";
88 int port = 1433;
89 String userName = "WebUser";
90 return makeSource(dbms, strServer, strDB, port, userName, null);
91 }
92
93 public static Source El_Salvador_Local(){
94 // BerlinModel - El_Salvador
95 String dbms = Source.SQL_SERVER_2005;
96 String strServer = "LENOVO-T61";
97 String strDB = "Salvador";
98 int port = 1433;
99 String userName = "salvadorExport";
100 return makeSource(dbms, strServer, strDB, port, userName, null);
101 }
102
103
104 public static Source AlgaTerra(){
105 // BerlinModel - AlgaTerra
106 String dbms = Source.SQL_SERVER_2005;
107 String strServer = "BGBM17";
108 String strDB = "Algaterra";
109 int port = 1433;
110 String userName = "WebUser";
111 return makeSource(dbms, strServer, strDB, port, userName, null);
112 }
113
114 public static Source PESI_ERMS(){
115 // BerlinModel - Pesi-ERMS
116 String dbms = Source.SQL_SERVER_2005;
117 String strServer = "SQL2000Intern\\SQL2005";
118 String strDB = "BM_ERMS";
119 int port = 1433;
120 String userName = "WebUser";
121 return makeSource(dbms, strServer, strDB, port, userName, null);
122 }
123
124 /**
125 * Initializes the source.
126 * @param dbms
127 * @param strServer
128 * @param strDB
129 * @param port
130 * @param userName
131 * @param pwd
132 * @return the source
133 */
134 private static Source makeSource(String dbms, String strServer, String strDB, int port, String userName, String pwd ){
135 //establish connection
136 Source source = null;
137 source = new Source(dbms, strServer, strDB);
138 source.setPort(port);
139
140 pwd = AccountStore.readOrStorePassword(dbms, strServer, userName, pwd);
141 source.setUserAndPwd(userName, pwd);
142 // write pwd to account store
143 return source;
144 }
145
146 }