ref #6241 change @date to @since in appimport
[cdmlib-apps.git] / app-import / src / main / java / eu / etaxonomy / cdm / app / berlinModelImport / SourceBase.java
1 /**
2 * Copyright (C) 2009 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
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.
8 */
9 package eu.etaxonomy.cdm.app.berlinModelImport;
10
11 import eu.etaxonomy.cdm.common.AccountStore;
12 import eu.etaxonomy.cdm.io.common.Source;
13
14 /**
15 * @author a.mueller
16 * @since 14.11.2012
17 *
18 */
19 public abstract class SourceBase {
20
21
22 /**
23 * Initializes the source.
24 * @param dbms
25 * @param strServer
26 * @param strDB
27 * @param port
28 * @param userName
29 * @param pwd
30 * @return the source
31 */
32 public static Source makeSource(String dbms, String strServer, String strDB, int port, String userName, String pwd ){
33 //establish connection
34 Source source = null;
35 source = new Source(dbms, strServer, strDB);
36 source.setPort(port);
37
38 pwd = AccountStore.readOrStorePassword(dbms, strServer, userName, pwd);
39 source.setUserAndPwd(userName, pwd);
40 // write pwd to account store
41 return source;
42 }
43 }