3 * Copyright (C) 2009 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.cdm
.app
.pesi
;
13 import org
.apache
.log4j
.Logger
;
15 import eu
.etaxonomy
.cdm
.common
.AccountStore
;
16 import eu
.etaxonomy
.cdm
.io
.common
.Source
;
23 public class PesiDestinations
{
24 @SuppressWarnings("unused")
25 private static final Logger logger
= Logger
.getLogger(PesiDestinations
.class);
27 public static Source
pesi_test_local_CDM_EM2PESI(){
29 String dbms
= Source
.SQL_SERVER_2008
;
30 String strServer
= "localhost";
31 String strDB
= "CDM_EM2PESI";
33 String userName
= "pesiexport";
34 return makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
37 public static Source
pesi_test_local_CDM_FE2PESI(){
39 String dbms
= Source
.SQL_SERVER_2008
;
40 String strServer
= "pesiimport3"; //192.168.1.223
41 String strDB
= "CDM_FE2PESI";
43 String userName
= "pesiexport";
44 return makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
47 public static Source
pesi_test_local_CDM_ERMS2PESI(){
49 String dbms
= Source
.SQL_SERVER_2008
;
50 String strServer
= "pesiimport3";
51 String strDB
= "CDM_ERMS2PESI";
53 String userName
= "pesiexport";
54 return makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
59 public static Source
pesi_test_bgbm42_CDM_DWH_FaEu(){
61 String dbms
= Source
.SQL_SERVER_2008
;
62 String strServer
= "BGBM42";
63 String strDB
= "CDM_DWH_FaEu";
65 String userName
= "WebUser";
66 return makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
69 public static Source
pesi_test_bgbm42_PESI_V11(){
71 String dbms
= Source
.SQL_SERVER_2008
;
72 String strServer
= "BGBM42";
73 String strDB
= "PESI_v11";
75 String userName
= "WebUser";
76 return makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
80 * Initializes the source.
89 private static Source
makeSource(String dbms
, String strServer
, String strDB
, int port
, String userName
, String pwd
){
90 //establish connection
92 source
= new Source(dbms
, strServer
, strDB
);
95 pwd
= AccountStore
.readOrStorePassword(dbms
, strServer
, userName
, pwd
);
96 source
.setUserAndPwd(userName
, pwd
);
97 // write pwd to account store