merge-update from trunk
[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 /**
41 * If true, all name relationships will be deleted prior to deleting the name.
42 * Exceptions will not be thrown due to existing name relationships.
43 * @return the removeAllNameRelationships
44 */
45 public boolean isRemoveAllNameRelationships() {
46 return removeAllNameRelationships;
47 }
48
49 /**
50 * @param removeAllNameRelationships the removeAllNameRelationships to set
51 */
52 public void setRemoveAllNameRelationships(boolean removeAllNameRelationships) {
53 this.removeAllNameRelationships = removeAllNameRelationships;
54 }
55
56 /**
57 * If true, all basionym relationships in which this name is the basionym/original name will be removed.
58 * Exceptions will not be thrown due to existing basionym relationships.
59 * This value is neglected if {@link #isRemoveAllNameRelationships()} is true.
60 * @see #setIgnoreIsBasionymFor(boolean)
61 * @return the ignoreIsBasionymFor
62 */
63 public boolean isIgnoreIsBasionymFor() {
64 return ignoreIsBasionymFor;
65 }
66
67 /**
68 * @see #isIgnoreIsBasionymFor()
69 * @param ignoreIsBasionymFor the ignoreIsBasionymFor to set
70 */
71 public void setIgnoreIsBasionymFor(boolean ignoreIsBasionymFor) {
72 this.ignoreIsBasionymFor = ignoreIsBasionymFor;
73 }
74
75 /**
76 * If true, all name relationships in which this name is a replaced synonym will be removed.
77 * Exceptions will not be thrown due to existing isReplacedSynonym relationships.
78 * This value is neglected if {@link #isRemoveAllNameRelationships()} is true.
79 * @see #setIgnoreIsReplacedSynonymFor(boolean)
80 * @return the ignoreIsReplacedSynonymFor
81 */
82 public boolean isIgnoreIsReplacedSynonymFor() {
83 return ignoreIsReplacedSynonymFor;
84 }
85
86 /**
87 * @see #isIgnoreIsReplacedSynonymFor()
88 * @param ignoreIsReplacedSynonymFor the ignoreIsReplacedSynonymFor to set
89 */
90 public void setIgnoreIsReplacedSynonymFor(boolean ignoreIsReplacedSynonymFor) {
91 this.ignoreIsReplacedSynonymFor = ignoreIsReplacedSynonymFor;
92 }
93
94 /**
95 * If true, all basionym relationships in which this name has a basionym/original name will
96 * be removed.<BR>
97 * Exceptions will not be thrown due to existing hasBasionym relationships.<BR>
98 * This value is neglected if {@link #isRemoveAllNameRelationships()} is true.<BR>
99 * Default value is <code>true</code>.<BR>
100 * @see #setIgnoreHasBasionym(boolean)
101 * @return the ignoreHasBasionym
102 */
103 public boolean isIgnoreHasBasionym() {
104 return ignoreHasBasionym;
105 }
106
107 /**
108 * @see #isIgnoreHasBasionym()
109 * @param ignoreHasBasionym the ignoreHasBasionym to set
110 */
111 public void setIgnoreHasBasionym(boolean ignoreHasBasionym) {
112 this.ignoreHasBasionym = ignoreHasBasionym;
113 }
114
115 /**
116 * If true, all replaced synonym relationships in which this name has a
117 * replaced synonym will be removed.<BR>
118 * Exceptions will not be thrown due to existing hasReplacedSynonym relationships.<BR>
119 * This value is neglected if {@link #isRemoveAllNameRelationships()} is true.<BR>
120 * Default value is <code>true</code>.<BR>
121 * @see #setIgnoreHasBasionym(boolean)
122 * @return the ignoreHasReplacedSynonym
123 */
124 public boolean isIgnoreHasReplacedSynonym() {
125 return ignoreHasReplacedSynonym;
126 }
127
128 /**
129 * @see #isIgnoreHasReplacedSynonym()
130 * @param ignoreHasReplacedSynonym the ignoreHasReplacedSynonym to set
131 */
132 public void setIgnoreHasReplacedSynonym(boolean ignoreHasReplacedSynonym) {
133 this.ignoreHasReplacedSynonym = ignoreHasReplacedSynonym;
134 }
135
136 }