further fixes for subareas #4220
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / ITaxonNodeService.java
1 // $Id$
2 /**
3 * Copyright (C) 2007 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
11 package eu.etaxonomy.cdm.api.service;
12
13 import java.util.List;
14 import java.util.Set;
15 import java.util.UUID;
16
17 import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
18 import eu.etaxonomy.cdm.api.service.config.TaxonNodeDeletionConfigurator;
19 import eu.etaxonomy.cdm.api.service.exception.DataChangeNoRollbackException;
20 import eu.etaxonomy.cdm.model.reference.Reference;
21 import eu.etaxonomy.cdm.model.taxon.Classification;
22 import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
23 import eu.etaxonomy.cdm.model.taxon.Synonym;
24 import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType;
25 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
26
27
28 /**
29 * @author n.hoffmann
30 * @created Apr 9, 2010
31 * @version 1.0
32 */
33 public interface ITaxonNodeService extends IAnnotatableService<TaxonNode>{
34
35 /**
36 *
37 * @param uuid
38 */
39 @Deprecated // use findByUuid() instead; TODO will be removed in the next version
40 public TaxonNode getTaxonNodeByUuid(UUID uuid);
41
42 /**
43 *
44 * @param taxonNode
45 * @param propertyPaths
46 * @return
47 */
48 public List<TaxonNode> loadChildNodesOfTaxonNode(TaxonNode taxonNode, List<String> propertyPaths, boolean recursive);
49
50 /**
51 * Changes the taxon associated with the given taxon node into a synonym of the new accepted taxon node.
52 * All data associated with the former taxon are moved to the newly accepted taxon.
53 *
54 * @param oldTaxonNode
55 * @param newAcceptedTaxonNode
56 * @param synonymRelationshipType
57 * @param citation
58 * @param citationMicroReference
59 * @return
60 *
61 */
62 public Synonym makeTaxonNodeASynonymOfAnotherTaxonNode(TaxonNode oldTaxonNode, TaxonNode newAcceptedTaxonNode, SynonymRelationshipType synonymRelationshipType, Reference citation, String citationMicroReference) ;
63
64 /**
65 * deletes the given taxon nodes
66 *
67 * @param nodes
68 * @param config
69 * @return
70 *
71 */
72 List<UUID> deleteTaxonNodes(Set<ITaxonTreeNode> nodes,
73 TaxonDeletionConfigurator config) ;
74 /**
75 * deletes the given taxon node the configurator defines whether the children will be deleted too or not
76 *
77 * @param node
78 * @param conf
79 * @return
80 *
81 */
82 public String deleteTaxonNode(TaxonNode node, TaxonDeletionConfigurator config);
83 /**
84 * Returns a List of all TaxonNodes of a given Classification.
85 *
86 * @param classification - according to the given classification the TaxonNodes are filtered.
87 * @param start - beginning of wanted row set, i.e. 0 if one want to start from the beginning.
88 * @param end - limit of how many rows are to be pulled from the database, i.e. 1000 rows.
89 * @return filtered List of TaxonNode according to the classification provided
90 */
91 public List<TaxonNode> listAllNodesForClassification(Classification classification, Integer start, Integer end);
92
93 /**
94 * Counts all TaxonNodes for a given Classification
95 *
96 * @param classification - according to the given classification the TaxonNodes are filtered.
97 * @return
98 */
99 public int countAllNodesForClassification(Classification classification);
100
101
102
103
104
105
106 }