merge trunk into model change 3.6
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / DeleteResult.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;
11
12 import java.io.Serializable;
13 import java.util.ArrayList;
14 import java.util.HashSet;
15 import java.util.List;
16 import java.util.Set;
17
18 import org.apache.log4j.Logger;
19
20 import eu.etaxonomy.cdm.model.common.CdmBase;
21 import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
22
23 /**
24 * This class represents the result of a delete action.
25 *
26 * @author a.mueller
27 * @date 04.01.2012
28 *
29 */
30 public class DeleteResult extends UpdateResult{
31
32 @SuppressWarnings("unused")
33 private static final Logger logger = Logger.getLogger(DeleteResult.class);
34
35
36
37 private final List<Exception> exceptions = new ArrayList<Exception>();
38
39 private final Set<CdmBase> relatedObjects = new HashSet<CdmBase>();
40
41 // private Set<PersistPair> objectsToDelete = new HashSet<PersistPair>();
42 //
43 // private Set<PersistPair> objectsToSave = new HashSet<DeleteResult.PersistPair>();
44
45 // protected class PersistPair{
46 // protected CdmBase objectToPersist;
47 // protected ICdmEntityDao<CdmBase> dao;
48 // }
49
50
51
52 //***************************** GETTER /SETTER /ADDER *************************/
53
54
55
56 /**
57 * Related objects that prevent the delete action to take place.
58 * @return
59 */
60 public Set<CdmBase> getRelatedObjects() {
61 return relatedObjects;
62 }
63 public void addRelatedObject(CdmBase relatedObject) {
64 this.relatedObjects.add(relatedObject);
65 }
66 public void addRelatedObjects(Set<? extends CdmBase> relatedObjects) {
67 this.relatedObjects.addAll(relatedObjects);
68 }
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83 }