adding Vaadin compatibility to trunk
[cdmlib.git] / cdmlib-io / src / main / java / eu / etaxonomy / cdm / io / common / IPartitionedState.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.io.common;
12
13 import java.sql.ResultSet;
14 import java.util.Map;
15
16 import org.springframework.transaction.TransactionStatus;
17
18 import eu.etaxonomy.cdm.api.service.IReferenceService;
19 import eu.etaxonomy.cdm.model.common.CdmBase;
20 import eu.etaxonomy.cdm.model.reference.Reference;
21
22 /**
23 * This class represents all (import(?)) states used with an ResultSetPartitioner
24 * @author a.mueller
25 * @created 02.03.2010
26 * @version 1.0
27 */
28 public interface IPartitionedState {
29
30 public void addRelatedObject(Object namespace, String id, CdmBase relatedObject);
31
32 /**
33 * Sets the related objects map. This usually does not need to be handled by the user
34 * but is called by the {@link ResultSetPartitioner result set partitioner}
35 * @param relatedObjects
36 */
37 public void setRelatedObjects(Map<Object, Map<String, CdmBase>> relatedObjects);
38
39 /**
40 * Returns a related object defined by the namespace and the id.
41 * The related objects are computed in {@link IPartitionedIO#getRelatedObjectsForPartition(ResultSet)}
42 * @param namespace
43 * @param id
44 * @return
45 */
46 public CdmBase getRelatedObject(Object namespace, String id);
47
48 public Reference getTransactionalSourceReference();
49
50 public void resetTransactionalSourceReference();
51
52 public void makeTransactionalSourceReference(IReferenceService service);
53
54 }