2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.cdm
.app
.pesi
;
12 import org
.apache
.log4j
.Logger
;
14 import eu
.etaxonomy
.cdm
.app
.common
.ImportUtils
;
15 import eu
.etaxonomy
.cdm
.common
.AccountStore
;
16 import eu
.etaxonomy
.cdm
.io
.common
.Source
;
19 * @author a.babadshanjan
22 public class PesiSources
{
23 @SuppressWarnings("unused")
24 private static final Logger logger
= Logger
.getLogger(PesiSources
.class);
26 public static Source
faunEu(){
29 String dbms
= Source
.SQL_SERVER_2008
;
31 String strServer
= "BGBM42"; // "192.168.1.36";
33 String strDB
= "FaunEu";
35 String userName
= "WebUser";
36 return ImportUtils
.makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
39 public static Source
faunaEu_previous(){
42 String dbms
= Source
.SQL_SERVER_2008
;
44 String strServer
= "BGBM42"; // "192.168.1.36";
46 String strDB
= "FaunEu_2_2";
48 String userName
= "WebUser";
49 return ImportUtils
.makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
51 public static Source
faunaEu_old(){
54 String dbms
= Source
.SQL_SERVER_2008
;
56 String strServer
= "BGBM42"; // "192.168.1.36";
58 String strDB
= "FaunaEu_1_3";
60 String userName
= "WebUser";
61 return ImportUtils
.makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
64 public static Source
PESI_ERMS(){
65 // BerlinModel - Pesi-ERMS
66 String dbms
= Source
.SQL_SERVER_2008
;
67 String strServer
= "BGBM42";
68 String strDB
= "ERMS";
70 String userName
= "WebUser";
71 return makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
76 * Initializes the source.
85 private static Source
makeSource(String dbms
, String strServer
, String strDB
, int port
, String userName
, String pwd
){
86 //establish connection
88 source
= new Source(dbms
, strServer
, strDB
);
91 pwd
= AccountStore
.readOrStorePassword(dbms
, strServer
, userName
, pwd
);
92 source
.setUserAndPwd(userName
, pwd
);
93 // write pwd to account store