Project

General

Profile

Download (1.89 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy 
4
* http://www.e-taxonomy.eu
5
* 
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9

    
10
package eu.etaxonomy.cdm.model.term.init;
11

    
12
import java.util.Map;
13
import java.util.Set;
14
import java.util.UUID;
15

    
16
import eu.etaxonomy.cdm.model.term.DefinedTermBase;
17
import eu.etaxonomy.cdm.model.term.TermVocabulary;
18
import eu.etaxonomy.cdm.model.term.VocabularyEnum;
19

    
20
public interface ITermLoader {
21
	
22
	/**
23
	 * Loads the terms for the DefinedTermBase subclass defined by vocType.
24
	 * The terms will be loadded into the terms map and 
25
	 * @param <T>
26
	 * @param vocType
27
	 * @param terms
28
	 * @return
29
	 */
30
	public <T extends DefinedTermBase> TermVocabulary<T> loadTerms(VocabularyEnum vocType, Map<UUID,DefinedTermBase> terms);
31

    
32
	/**
33
	 * Unload all static terms. After calling this method all static methods returning terms in DefinedTermBase subclasses 
34
	 * will return null.
35
	 */
36
	public void unloadAllTerms();
37

    
38
	/**
39
	 * Loads the {@link UUID}s of all vocabularies and all related terms into the given uuidMap.
40
	 * Where the key of the map is the vocabulary uuid and the values are the related term uuids.
41
	 * @param vocType vocabulary type
42
	 * @param uuidMap the resulting uuid map with the key as vocabulary uuid and the value as set of term uuids
43
	 *        belonging to the given vocabulary
44
	 */
45
	public UUID loadUuids(VocabularyEnum vocType, Map<UUID, Set<UUID>> uuidMap);
46

    
47
	/**
48
	 * Loads all terms for the given vocabulary and with the given term uuids by using the given term loader.
49
	 * @param vocType VocabularyEnum
50
	 * @param voc vocabulary
51
	 * @param missingTerms Set of UUIDs for terms to be loaded.
52
	 * @return
53
	 */
54
	public <T extends DefinedTermBase> Set<T> loadSingleTerms(VocabularyEnum vocType, TermVocabulary<T> voc, 
55
				Set<UUID> missingTerms);
56

    
57
	
58

    
59
	
60
}
(2-2/4)