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_pesi3(){
27 // Fauna Europaea auf pesiimport3
28 String dbms
= Source
.SQL_SERVER_2008
;
29 String strServer
= "pesiimport3";
30 String strDB
= "FaunEu";
32 String userName
= "pesiexport";
33 return ImportUtils
.makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
36 public static Source
faunEu(){
39 String dbms
= Source
.SQL_SERVER_2008
;
41 String strServer
= "BGBM42"; // "192.168.1.36";
43 String strDB
= "FaunEu";
45 String userName
= "WebUser";
46 return ImportUtils
.makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
49 public static Source
faunaEu_previous(){
52 String dbms
= Source
.SQL_SERVER_2008
;
54 String strServer
= "BGBM42"; // "192.168.1.36";
56 String strDB
= "FaunEu_2_2";
58 String userName
= "WebUser";
59 return ImportUtils
.makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
61 public static Source
faunaEu_old(){
64 String dbms
= Source
.SQL_SERVER_2008
;
66 String strServer
= "BGBM42"; // "192.168.1.36";
68 String strDB
= "FaunaEu_1_3";
70 String userName
= "WebUser";
71 return ImportUtils
.makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
74 public static Source
PESI_ERMS(){
75 // BerlinModel - Pesi-ERMS
76 String dbms
= Source
.SQL_SERVER_2008
;
77 String strServer
= "BGBM42";
78 String strDB
= "ERMS";
80 String userName
= "WebUser";
81 return makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
84 public static Source
PESI_IF(){
85 // BerlinModel - Pesi-IF
86 String dbms
= Source
.SQL_SERVER_2008
;
87 String strServer
= "BGBM42";
90 String userName
= "WebUser";
91 return makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
95 * Initializes the source.
104 private static Source
makeSource(String dbms
, String strServer
, String strDB
, int port
, String userName
, String pwd
){
105 //establish connection
106 Source source
= null;
107 source
= new Source(dbms
, strServer
, strDB
);
108 source
.setPort(port
);
110 pwd
= AccountStore
.readOrStorePassword(dbms
, strServer
, userName
, pwd
);
111 source
.setUserAndPwd(userName
, pwd
);
112 // write pwd to account store