Project

General

Profile

« Previous | Next » 

Revision 0f56664f

Added by Andreas Müller over 1 year ago

remove seperate config package for NonReferencedObjectsDeleterConfigurator

View differences:

cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/operation/NonReferencedObjectsDeleter.java
16 16
import eu.etaxonomy.cdm.api.service.DeleteResult;
17 17
import eu.etaxonomy.cdm.io.common.CdmImportBase;
18 18
import eu.etaxonomy.cdm.io.common.DefaultImportState;
19
import eu.etaxonomy.cdm.io.operation.config.NonReferencedObjectsDeleterConfigurator;
20 19
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
21 20
import eu.etaxonomy.cdm.model.common.IdentifiableSource;
22 21
import eu.etaxonomy.cdm.model.reference.Reference;
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/operation/NonReferencedObjectsDeleterConfigurator.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
package eu.etaxonomy.cdm.io.operation;
10

  
11
import org.apache.log4j.Logger;
12

  
13
import eu.etaxonomy.cdm.api.service.config.CacheUpdaterConfigurator;
14
import eu.etaxonomy.cdm.database.DbSchemaValidation;
15
import eu.etaxonomy.cdm.database.ICdmDataSource;
16
import eu.etaxonomy.cdm.io.common.DefaultImportState;
17
import eu.etaxonomy.cdm.io.common.ImportConfiguratorBase;
18
import eu.etaxonomy.cdm.io.common.ImportStateBase;
19
import eu.etaxonomy.cdm.model.reference.Reference;
20

  
21
/**
22
 * @author k.luther
23
 * @since 2015
24
 */
25
public class NonReferencedObjectsDeleterConfigurator
26
        extends ImportConfiguratorBase<DefaultImportState<NonReferencedObjectsDeleterConfigurator>, Object> {
27

  
28
    private static final long serialVersionUID = -3063590000817699527L;
29
    @SuppressWarnings("unused")
30
    private static final Logger logger = Logger.getLogger(CacheUpdaterConfigurator.class);
31

  
32
	private boolean doReferences = true;
33
	private boolean doAuthors = true;
34

  
35
	private boolean isKeepReferencesWithTitle = false;
36
	private boolean isKeepRisSources = false;
37

  
38
	public NonReferencedObjectsDeleterConfigurator() {
39
		super(null);
40
	}
41

  
42
	public NonReferencedObjectsDeleterConfigurator(ICdmDataSource destination) {
43
		super(null);
44
		this.setSource(destination);
45
		this.setDestination(destination);
46
		this.setDbSchemaValidation(DbSchemaValidation.UPDATE);
47
	}
48

  
49
	public static NonReferencedObjectsDeleterConfigurator NewInstance(ICdmDataSource destination){
50
		NonReferencedObjectsDeleterConfigurator result = new NonReferencedObjectsDeleterConfigurator(destination);
51
		return result;
52
	}
53

  
54
	@SuppressWarnings({ "rawtypes", "unchecked" })
55
    @Override
56
	public <STATE extends ImportStateBase> STATE getNewState() {
57
		return (STATE) new DefaultImportState(this);
58
	}
59

  
60
	@SuppressWarnings("unchecked")
61
    @Override
62
	protected void makeIoClassList() {
63
		ioClassList = new Class[]{
64
				 NonReferencedObjectsDeleter.class
65
		};
66
	}
67

  
68
    public boolean isDoReferences() {
69
        return doReferences;
70
    }
71
    public void setDoReferences(boolean doReferences) {
72
        this.doReferences = doReferences;
73
    }
74

  
75
    public boolean isDoAuthors() {
76
        return doAuthors;
77
    }
78
    public void setDoAuthors(boolean doAuthors) {
79
        this.doAuthors = doAuthors;
80
    }
81

  
82
    public boolean isKeepReferencesWithTitle() {
83
        return isKeepReferencesWithTitle;
84
    }
85
    public void setKeepReferencesWithTitle(boolean isKeepReferencesWithTitle) {
86
        this.isKeepReferencesWithTitle = isKeepReferencesWithTitle;
87
    }
88

  
89
    public boolean isKeepRisSources() {
90
        return isKeepRisSources;
91
    }
92
    public void setKeepRisSources(boolean isKeepRisSources) {
93
        this.isKeepRisSources = isKeepRisSources;
94
    }
95

  
96
    @Override
97
    public Reference getSourceReference() {
98
        return null;
99
    }
100
}
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/operation/config/NonReferencedObjectsDeleterConfigurator.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
package eu.etaxonomy.cdm.io.operation.config;
10

  
11
import org.apache.log4j.Logger;
12

  
13
import eu.etaxonomy.cdm.api.service.config.CacheUpdaterConfigurator;
14
import eu.etaxonomy.cdm.database.DbSchemaValidation;
15
import eu.etaxonomy.cdm.database.ICdmDataSource;
16
import eu.etaxonomy.cdm.io.common.DefaultImportState;
17
import eu.etaxonomy.cdm.io.common.ImportConfiguratorBase;
18
import eu.etaxonomy.cdm.io.common.ImportStateBase;
19
import eu.etaxonomy.cdm.io.operation.NonReferencedObjectsDeleter;
20
import eu.etaxonomy.cdm.model.reference.Reference;
21

  
22
/**
23
 * @author k.luther
24
 * @since 2015
25
 */
26
public class NonReferencedObjectsDeleterConfigurator
27
        extends ImportConfiguratorBase<DefaultImportState<NonReferencedObjectsDeleterConfigurator>, Object> {
28

  
29
    private static final long serialVersionUID = -3063590000817699527L;
30
    @SuppressWarnings("unused")
31
    private static final Logger logger = Logger.getLogger(CacheUpdaterConfigurator.class);
32

  
33
	private boolean doReferences = true;
34
	private boolean doAuthors = true;
35

  
36
	private boolean isKeepReferencesWithTitle = false;
37
	private boolean isKeepRisSources = false;
38

  
39
	public NonReferencedObjectsDeleterConfigurator() {
40
		super(null);
41
	}
42

  
43
	public NonReferencedObjectsDeleterConfigurator(ICdmDataSource destination) {
44
		super(null);
45
		this.setSource(destination);
46
		this.setDestination(destination);
47
		this.setDbSchemaValidation(DbSchemaValidation.UPDATE);
48
	}
49

  
50
	public static NonReferencedObjectsDeleterConfigurator NewInstance(ICdmDataSource destination){
51
		NonReferencedObjectsDeleterConfigurator result = new NonReferencedObjectsDeleterConfigurator(destination);
52
		return result;
53
	}
54

  
55
	@Override
56
	public <STATE extends ImportStateBase> STATE getNewState() {
57
		return (STATE) new DefaultImportState(this);
58
	}
59

  
60
	@SuppressWarnings("unchecked")
61
    @Override
62
	protected void makeIoClassList() {
63
		ioClassList = new Class[]{
64
				 NonReferencedObjectsDeleter.class
65
		};
66
	}
67

  
68
    public boolean isDoReferences() {
69
        return doReferences;
70
    }
71
    public void setDoReferences(boolean doReferences) {
72
        this.doReferences = doReferences;
73
    }
74

  
75
    public boolean isDoAuthors() {
76
        return doAuthors;
77
    }
78
    public void setDoAuthors(boolean doAuthors) {
79
        this.doAuthors = doAuthors;
80
    }
81

  
82
    public boolean isKeepReferencesWithTitle() {
83
        return isKeepReferencesWithTitle;
84
    }
85
    public void setKeepReferencesWithTitle(boolean isKeepReferencesWithTitle) {
86
        this.isKeepReferencesWithTitle = isKeepReferencesWithTitle;
87
    }
88

  
89
    public boolean isKeepRisSources() {
90
        return isKeepRisSources;
91
    }
92
    public void setKeepRisSources(boolean isKeepRisSources) {
93
        this.isKeepRisSources = isKeepRisSources;
94
    }
95

  
96
    @Override
97
    public Reference getSourceReference() {
98
        return null;
99
    }
100
}

Also available in: Unified diff