removed deprecated methods from CdmDefaultImport
[cdmlib.git] / cdmlib-io / src / main / java / eu / etaxonomy / cdm / io / common / CdmDefaultImport.java
1 /**
2 * Copyright (C) 2007 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
10 package eu.etaxonomy.cdm.io.common;
11
12 import org.apache.log4j.Logger;
13
14 import eu.etaxonomy.cdm.api.application.CdmApplicationController;
15 import eu.etaxonomy.cdm.database.ICdmDataSource;
16
17 /**
18 * @author a.mueller
19 * @created 29.01.2009
20 * @version 1.0
21 */
22 public class CdmDefaultImport<T extends IImportConfigurator> extends CdmDefaultIOBase<IImportConfigurator> implements ICdmImporter<T> {
23 @SuppressWarnings("unused")
24 private static final Logger logger = Logger.getLogger(CdmDefaultImport.class);
25
26 public boolean invoke(T config){
27 ICdmDataSource destination = config.getDestination();
28 boolean omitTermLoading = false;
29 return invoke(config, destination, omitTermLoading);
30 }
31
32 public boolean invoke(IImportConfigurator config, ICdmDataSource destination, boolean omitTermLoading){
33 boolean createNew = false;
34
35 if (startApplicationController(config, destination, omitTermLoading, createNew) == false){
36 return false;
37 }else{
38 CdmApplicationAwareDefaultImport<?> defaultImport = (CdmApplicationAwareDefaultImport<?>)getCdmAppController().applicationContext.getBean("defaultImport");
39 return defaultImport.invoke(config);
40 }
41 }
42
43 /**
44 * Starts the CdmApplicationController if not yet started
45 * @param config Configuration
46 * @param destination destination
47 * @return false if start not successful
48 */
49 public boolean startController(IImportConfigurator config, ICdmDataSource destination){
50 boolean omitTermLoading = false;
51 boolean createNew = false;
52 return startApplicationController(config, destination, omitTermLoading, createNew);
53 }
54
55 }