Revision 81f1b374
Added by Andreas Müller almost 4 years ago
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/operation/config/DeleteNonReferencedReferencesConfigurator.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 |
*/ |
|
1 | 9 |
package eu.etaxonomy.cdm.io.operation.config; |
2 | 10 |
|
3 | 11 |
import org.apache.log4j.Logger; |
... | ... | |
6 | 14 |
import eu.etaxonomy.cdm.database.DbSchemaValidation; |
7 | 15 |
import eu.etaxonomy.cdm.database.ICdmDataSource; |
8 | 16 |
import eu.etaxonomy.cdm.io.common.DefaultImportState; |
9 |
import eu.etaxonomy.cdm.io.common.IImportConfigurator; |
|
10 | 17 |
import eu.etaxonomy.cdm.io.common.ImportConfiguratorBase; |
11 | 18 |
import eu.etaxonomy.cdm.io.common.ImportStateBase; |
12 |
import eu.etaxonomy.cdm.io.common.mapping.IInputTransformer; |
|
13 | 19 |
import eu.etaxonomy.cdm.io.operation.DeleteNonReferencedReferencesUpdater; |
14 | 20 |
import eu.etaxonomy.cdm.model.reference.Reference; |
15 | 21 |
|
16 |
public class DeleteNonReferencedReferencesConfigurator extends ImportConfiguratorBase<DefaultImportState<DeleteNonReferencedReferencesConfigurator>, Object> implements IImportConfigurator{ |
|
22 |
/** |
|
23 |
* @author k.luther |
|
24 |
* @since 2015 |
|
25 |
*/ |
|
26 |
public class DeleteNonReferencedReferencesConfigurator |
|
27 |
extends ImportConfiguratorBase<DefaultImportState<DeleteNonReferencedReferencesConfigurator>, Object> { |
|
17 | 28 |
|
18 |
private boolean doReferences = true; |
|
19 |
private boolean doAuthors = true; |
|
20 |
|
|
21 |
public boolean isDoReferences() { |
|
22 |
return doReferences; |
|
23 |
} |
|
29 |
private static final long serialVersionUID = -3063590000817699527L; |
|
30 |
@SuppressWarnings("unused") |
|
31 |
private static final Logger logger = Logger.getLogger(CacheUpdaterConfigurator.class); |
|
24 | 32 |
|
25 |
public void setDoReferences(boolean doReferences) { |
|
26 |
this.doReferences = doReferences; |
|
27 |
} |
|
28 |
|
|
29 |
public boolean isDoAuthors() { |
|
30 |
return doAuthors; |
|
31 |
} |
|
32 |
|
|
33 |
public void setDoAuthors(boolean doAuthors) { |
|
34 |
this.doAuthors = doAuthors; |
|
35 |
} |
|
36 |
|
|
37 |
public DeleteNonReferencedReferencesConfigurator( |
|
38 |
IInputTransformer transformer) { |
|
39 |
super(transformer); |
|
40 |
// TODO Auto-generated constructor stub |
|
41 |
} |
|
33 |
private boolean doReferences = true; |
|
34 |
private boolean doAuthors = true; |
|
42 | 35 |
|
43 | 36 |
public DeleteNonReferencedReferencesConfigurator() { |
44 | 37 |
super(null); |
... | ... | |
49 | 42 |
this.setSource(destination); |
50 | 43 |
this.setDestination(destination); |
51 | 44 |
this.setDbSchemaValidation(DbSchemaValidation.UPDATE); |
52 |
|
|
53 | 45 |
} |
54 | 46 |
|
55 |
@SuppressWarnings("unused") |
|
56 |
private static final Logger logger = Logger.getLogger(CacheUpdaterConfigurator.class); |
|
57 |
|
|
58 | 47 |
public static DeleteNonReferencedReferencesConfigurator NewInstance(ICdmDataSource destination){ |
59 | 48 |
DeleteNonReferencedReferencesConfigurator result = new DeleteNonReferencedReferencesConfigurator(destination); |
60 | 49 |
return result; |
61 | 50 |
} |
62 |
|
|
63 |
|
|
64 |
|
|
51 |
|
|
65 | 52 |
@Override |
66 | 53 |
public <STATE extends ImportStateBase> STATE getNewState() { |
67 | 54 |
return (STATE) new DefaultImportState(this); |
... | ... | |
71 | 58 |
protected void makeIoClassList() { |
72 | 59 |
ioClassList = new Class[]{ |
73 | 60 |
DeleteNonReferencedReferencesUpdater.class |
74 |
};
|
|
61 |
}; |
|
75 | 62 |
} |
76 | 63 |
|
64 |
public boolean isDoReferences() { |
|
65 |
return doReferences; |
|
66 |
} |
|
67 |
|
|
68 |
public void setDoReferences(boolean doReferences) { |
|
69 |
this.doReferences = doReferences; |
|
70 |
} |
|
71 |
|
|
72 |
public boolean isDoAuthors() { |
|
73 |
return doAuthors; |
|
74 |
} |
|
75 |
|
|
76 |
public void setDoAuthors(boolean doAuthors) { |
|
77 |
this.doAuthors = doAuthors; |
|
78 |
} |
|
79 |
|
|
77 | 80 |
@Override |
78 | 81 |
public Reference getSourceReference() { |
79 |
// TODO Auto-generated method stub |
|
80 | 82 |
return null; |
81 | 83 |
} |
82 |
|
|
83 | 84 |
} |
Also available in: Unified diff
cleanup