replace localhost for ERMS
[cdmlib-apps.git] / cdm-pesi / src / main / java / eu / etaxonomy / cdm / app / pesi / PesiDestinations.java
1 // $Id$
2 /**
3 * Copyright (C) 2009 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 package eu.etaxonomy.cdm.app.pesi;
11
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 * @author e.-m.lee
20 * @date 16.02.2010
21 *
22 */
23 public class PesiDestinations {
24 @SuppressWarnings("unused")
25 private static final Logger logger = Logger.getLogger(PesiDestinations.class);
26
27 public static Source pesi_test_local_CDM_EM2PESI(){
28 // CDM - PESI
29 String dbms = Source.SQL_SERVER_2008;
30 String strServer = "localhost";
31 String strDB = "CDM_EM2PESI";
32 int port = 1433;
33 String userName = "pesiexport";
34 return makeSource(dbms, strServer, strDB, port, userName, null);
35 }
36
37 public static Source pesi_test_local_CDM_FE2PESI(){
38 // CDM - PESI
39 String dbms = Source.SQL_SERVER_2008;
40 String strServer = "pesiimport3"; //192.168.1.223
41 String strDB = "CDM_FE2PESI";
42 int port = 1433;
43 String userName = "pesiexport";
44 return makeSource(dbms, strServer, strDB, port, userName, null);
45 }
46
47 public static Source pesi_test_local_CDM_ERMS2PESI(){
48 // CDM - PESI
49 String dbms = Source.SQL_SERVER_2008;
50 String strServer = "pesiimport3";
51 String strDB = "CDM_ERMS2PESI";
52 int port = 1433;
53 String userName = "pesiexport";
54 return makeSource(dbms, strServer, strDB, port, userName, null);
55 }
56
57
58
59 public static Source pesi_test_bgbm42_CDM_DWH_FaEu(){
60 // CDM - PESI
61 String dbms = Source.SQL_SERVER_2008;
62 String strServer = "BGBM42";
63 String strDB = "CDM_DWH_FaEu";
64 int port = 1433;
65 String userName = "WebUser";
66 return makeSource(dbms, strServer, strDB, port, userName, null);
67 }
68
69 public static Source pesi_test_bgbm42_PESI_V11(){
70 // CDM - PESI
71 String dbms = Source.SQL_SERVER_2008;
72 String strServer = "BGBM42";
73 String strDB = "PESI_v11";
74 int port = 1433;
75 String userName = "WebUser";
76 return makeSource(dbms, strServer, strDB, port, userName, null);
77 }
78
79 /**
80 * Initializes the source.
81 * @param dbms
82 * @param strServer
83 * @param strDB
84 * @param port
85 * @param userName
86 * @param pwd
87 * @return the source
88 */
89 private static Source makeSource(String dbms, String strServer, String strDB, int port, String userName, String pwd ){
90 //establish connection
91 Source source = null;
92 source = new Source(dbms, strServer, strDB);
93 source.setPort(port);
94
95 pwd = AccountStore.readOrStorePassword(dbms, strServer, userName, pwd);
96 source.setUserAndPwd(userName, pwd);
97 // write pwd to account store
98 return source;
99 }
100
101 }