1
|
package eu.etaxonomy.cdm.io.common;
|
2
|
|
3
|
import org.apache.log4j.Logger;
|
4
|
|
5
|
import eu.etaxonomy.cdm.database.DbSchemaValidation;
|
6
|
import eu.etaxonomy.cdm.database.ICdmDataSource;
|
7
|
import eu.etaxonomy.cdm.io.common.mapping.IInputTransformer;
|
8
|
import eu.etaxonomy.cdm.model.reference.Reference;
|
9
|
|
10
|
public class DeleteNonReferencedReferencesConfigurator extends ImportConfiguratorBase<DefaultImportState<DeleteNonReferencedReferencesConfigurator>, Object> implements IImportConfigurator{
|
11
|
|
12
|
private boolean doReferences = true;
|
13
|
private boolean doAuthors = true;
|
14
|
|
15
|
public boolean isDoReferences() {
|
16
|
return doReferences;
|
17
|
}
|
18
|
|
19
|
public void setDoReferences(boolean doReferences) {
|
20
|
this.doReferences = doReferences;
|
21
|
}
|
22
|
|
23
|
public boolean isDoAuthors() {
|
24
|
return doAuthors;
|
25
|
}
|
26
|
|
27
|
public void setDoAuthors(boolean doAuthors) {
|
28
|
this.doAuthors = doAuthors;
|
29
|
}
|
30
|
|
31
|
public DeleteNonReferencedReferencesConfigurator(
|
32
|
IInputTransformer transformer) {
|
33
|
super(transformer);
|
34
|
// TODO Auto-generated constructor stub
|
35
|
}
|
36
|
|
37
|
public DeleteNonReferencedReferencesConfigurator() {
|
38
|
super(null);
|
39
|
}
|
40
|
|
41
|
public DeleteNonReferencedReferencesConfigurator(ICdmDataSource destination) {
|
42
|
super(null);
|
43
|
this.setSource(destination);
|
44
|
this.setDestination(destination);
|
45
|
this.setDbSchemaValidation(DbSchemaValidation.UPDATE);
|
46
|
|
47
|
}
|
48
|
|
49
|
@SuppressWarnings("unused")
|
50
|
private static final Logger logger = Logger.getLogger(CacheUpdaterConfigurator.class);
|
51
|
|
52
|
public static DeleteNonReferencedReferencesConfigurator NewInstance(ICdmDataSource destination){
|
53
|
DeleteNonReferencedReferencesConfigurator result = new DeleteNonReferencedReferencesConfigurator(destination);
|
54
|
return result;
|
55
|
}
|
56
|
|
57
|
|
58
|
|
59
|
@Override
|
60
|
public <STATE extends ImportStateBase> STATE getNewState() {
|
61
|
return (STATE) new DefaultImportState(this);
|
62
|
}
|
63
|
|
64
|
@Override
|
65
|
protected void makeIoClassList() {
|
66
|
ioClassList = new Class[]{
|
67
|
DeleteNonReferencedreferencesUpdater.class
|
68
|
};
|
69
|
}
|
70
|
|
71
|
@Override
|
72
|
public Reference getSourceReference() {
|
73
|
// TODO Auto-generated method stub
|
74
|
return null;
|
75
|
}
|
76
|
|
77
|
}
|