Project

General

Profile

Download (1.41 KB) Statistics
| Branch: | Tag: | Revision:
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.util.HashMap;
14
import java.util.Map;
15
import java.util.UUID;
16

    
17
import org.apache.log4j.Logger;
18

    
19
import eu.etaxonomy.cdm.io.common.DbExportConfiguratorBase.IdType;
20
import eu.etaxonomy.cdm.model.common.CdmBase;
21

    
22
/**
23
 * @author a.mueller
24
 * @created 11.05.2009
25
 * @version 1.0
26
 */
27
public abstract class DbExportStateBase<CONFIG extends DbExportConfiguratorBase<? extends DbExportStateBase<CONFIG>>> extends ExportStateBase<CONFIG> {
28
	private static final Logger logger = Logger.getLogger(DbExportStateBase.class);
29
	
30
	protected Map<UUID, Integer> dbIdMap = new HashMap<UUID, Integer>();
31
	
32
	
33
	public DbExportStateBase(CONFIG config) {
34
		super(config);
35
	}
36

    
37
	public void putDbId(CdmBase cdmBase, int dbId){
38
		if (cdmBase != null){
39
			dbIdMap.put(cdmBase.getUuid(), dbId);
40
		}else{
41
			logger.warn("CdmBase was (null) and could not be added to dbIdMap");
42
		}
43
	}
44
	
45
	public Integer getDbId(CdmBase cdmBase){
46
		if (cdmBase != null){
47
			return dbIdMap.get(cdmBase.getUuid());
48
		}else{
49
			logger.warn("CdmBase was (null). No entries in dbIdMap available");
50
			return null;
51
		}
52
	}
53
	
54
}
(13-13/48)