minor
[cdmlib-apps.git] / cdm-pesi / src / main / java / eu / etaxonomy / cdm / app / common / 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.common;
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 PESI_ERMS(){
34 // BerlinModel - Pesi-ERMS
35 String dbms = Source.SQL_SERVER_2005;
36 String strServer = "SQL2000Intern\\SQL2005";
37 String strDB = "BM_ERMS";
38 int port = 1433;
39 String userName = "WebUser";
40 return makeSource(dbms, strServer, strDB, port, userName, null);
41 }
42
43 /**
44 * Initializes the source.
45 * @param dbms
46 * @param strServer
47 * @param strDB
48 * @param port
49 * @param userName
50 * @param pwd
51 * @return the source
52 */
53 private static Source makeSource(String dbms, String strServer, String strDB, int port, String userName, String pwd ){
54 //establish connection
55 Source source = null;
56 source = new Source(dbms, strServer, strDB);
57 source.setPort(port);
58
59 pwd = AccountStore.readOrStorePassword(dbms, strServer, userName, pwd);
60 source.setUserAndPwd(userName, pwd);
61 // write pwd to account store
62 return source;
63 }
64
65 }