merge trunk into model change 3.6
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / config / NameDeletionConfigurator.java
1 // $Id$
2 /**
3 * Copyright (C) 2009 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
9 */
10 package eu.etaxonomy.cdm.api.service.config;
11
12 import org.apache.log4j.Logger;
13
14 import eu.etaxonomy.cdm.api.service.INameService;
15
16 /**
17 * This class is used to configure name deletion.
18 *
19 * @see INameService#delete(eu.etaxonomy.cdm.model.name.TaxonNameBase)
20 *
21 * @author a.mueller
22 * @date 19.09.2011
23 *
24 */
25 public class NameDeletionConfigurator extends DeleteConfiguratorBase {
26 @SuppressWarnings("unused")
27 private static final Logger logger = Logger.getLogger(NameDeletionConfigurator.class);
28
29
30 private boolean removeAllNameRelationships = false;
31
32 private boolean ignoreIsBasionymFor = false;
33
34 private boolean ignoreIsReplacedSynonymFor = false;
35
36 private boolean ignoreHasBasionym = true;
37
38 private boolean ignoreHasReplacedSynonym = true;
39
40 private boolean removeAllNameTypeDesignations = true;
41 /**
42 * If true, all name relationships will be deleted prior to deleting the name.
43 * Exceptions will not be thrown due to existing name relationships.
44 * @return the removeAllNameRelationships
45 */
46 public boolean isRemoveAllNameRelationships() {
47 return removeAllNameRelationships;
48 }
49
50 /**
51 * @param removeAllNameRelationships the removeAllNameRelationships to set
52 */
53 public void setRemoveAllNameRelationships(boolean removeAllNameRelationships) {
54 this.removeAllNameRelationships = removeAllNameRelationships;
55 }
56
57 /**
58 * If true, all basionym relationships in which this name is the basionym/original name will be removed.
59 * Exceptions will not be thrown due to existing basionym relationships.
60 * This value is neglected if {@link #isRemoveAllNameRelationships()} is true.
61 * @see #setIgnoreIsBasionymFor(boolean)
62 * @return the ignoreIsBasionymFor
63 */
64 public boolean isIgnoreIsBasionymFor() {
65 return ignoreIsBasionymFor;
66 }
67
68 /**
69 * @see #isIgnoreIsBasionymFor()
70 * @param ignoreIsBasionymFor the ignoreIsBasionymFor to set
71 */
72 public void setIgnoreIsBasionymFor(boolean ignoreIsBasionymFor) {
73 this.ignoreIsBasionymFor = ignoreIsBasionymFor;
74 }
75
76 /**
77 * If true, all name relationships in which this name is a replaced synonym will be removed.
78 * Exceptions will not be thrown due to existing isReplacedSynonym relationships.
79 * This value is neglected if {@link #isRemoveAllNameRelationships()} is true.
80 * @see #setIgnoreIsReplacedSynonymFor(boolean)
81 * @return the ignoreIsReplacedSynonymFor
82 */
83 public boolean isIgnoreIsReplacedSynonymFor() {
84 return ignoreIsReplacedSynonymFor;
85 }
86
87 /**
88 * @see #isIgnoreIsReplacedSynonymFor()
89 * @param ignoreIsReplacedSynonymFor the ignoreIsReplacedSynonymFor to set
90 */
91 public void setIgnoreIsReplacedSynonymFor(boolean ignoreIsReplacedSynonymFor) {
92 this.ignoreIsReplacedSynonymFor = ignoreIsReplacedSynonymFor;
93 }
94
95 /**
96 * If true, all basionym relationships in which this name has a basionym/original name will
97 * be removed.<BR>
98 * Exceptions will not be thrown due to existing hasBasionym relationships.<BR>
99 * This value is neglected if {@link #isRemoveAllNameRelationships()} is true.<BR>
100 * Default value is <code>true</code>.<BR>
101 * @see #setIgnoreHasBasionym(boolean)
102 * @return the ignoreHasBasionym
103 */
104 public boolean isIgnoreHasBasionym() {
105 return ignoreHasBasionym;
106 }
107
108 /**
109 * @see #isIgnoreHasBasionym()
110 * @param ignoreHasBasionym the ignoreHasBasionym to set
111 */
112 public void setIgnoreHasBasionym(boolean ignoreHasBasionym) {
113 this.ignoreHasBasionym = ignoreHasBasionym;
114 }
115
116 /**
117 * If true, all replaced synonym relationships in which this name has a
118 * replaced synonym will be removed.<BR>
119 * Exceptions will not be thrown due to existing hasReplacedSynonym relationships.<BR>
120 * This value is neglected if {@link #isRemoveAllNameRelationships()} is true.<BR>
121 * Default value is <code>true</code>.<BR>
122 * @see #setIgnoreHasBasionym(boolean)
123 * @return the ignoreHasReplacedSynonym
124 */
125 public boolean isIgnoreHasReplacedSynonym() {
126 return ignoreHasReplacedSynonym;
127 }
128
129 /**
130 * @see #isIgnoreHasReplacedSynonym()
131 * @param ignoreHasReplacedSynonym the ignoreHasReplacedSynonym to set
132 */
133 public void setIgnoreHasReplacedSynonym(boolean ignoreHasReplacedSynonym) {
134 this.ignoreHasReplacedSynonym = ignoreHasReplacedSynonym;
135 }
136
137 public boolean isRemoveAllNameTypeDesignations() {
138 return removeAllNameTypeDesignations;
139 }
140
141 }