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.List;
|
13
|
import java.util.Map;
|
14
|
import java.util.Set;
|
15
|
import java.util.UUID;
|
16
|
|
17
|
import eu.etaxonomy.cdm.model.term.DefinedTermBase;
|
18
|
import eu.etaxonomy.cdm.model.term.OrderedTermBase;
|
19
|
import eu.etaxonomy.cdm.model.term.TermVocabulary;
|
20
|
import eu.etaxonomy.cdm.model.term.VocabularyEnum;
|
21
|
|
22
|
public interface ITermLoader {
|
23
|
|
24
|
/**
|
25
|
* Loads the terms for the DefinedTermBase subclass defined by vocType.
|
26
|
* The terms will be loadded into the terms map and
|
27
|
* @param <T>
|
28
|
* @param vocType
|
29
|
* @param terms
|
30
|
* @return
|
31
|
*/
|
32
|
public <T extends DefinedTermBase<T>, S extends OrderedTermBase<S>> TermVocabulary<T> loadTerms(VocabularyEnum vocType, Map<UUID,DefinedTermBase> terms);
|
33
|
|
34
|
/**
|
35
|
* Unload all static terms. After calling this method all static methods returning terms in DefinedTermBase subclasses
|
36
|
* will return null.
|
37
|
*/
|
38
|
public void unloadAllTerms();
|
39
|
|
40
|
/**
|
41
|
* Loads the {@link UUID}s of all vocabularies and all related terms into the given uuidMap.
|
42
|
* Where the key of the map is the vocabulary uuid and the values are the related term uuids.
|
43
|
* @param vocType vocabulary type
|
44
|
* @param uuidMap the resulting uuid map with the key as vocabulary uuid and the value as set of term uuids
|
45
|
* belonging to the given vocabulary
|
46
|
*/
|
47
|
public UUID loadUuids(VocabularyEnum vocType, Map<UUID, List<UUID>> uuidMap);
|
48
|
|
49
|
/**
|
50
|
* Loads all terms for the given vocabulary and with the given term uuids by using the given term loader.
|
51
|
* @param vocType VocabularyEnum
|
52
|
* @param voc vocabulary
|
53
|
* @param missingTerms Set of UUIDs for terms to be loaded.
|
54
|
* @return
|
55
|
*/
|
56
|
public <T extends DefinedTermBase<T>, S extends OrderedTermBase<S>> Set<T> loadSingleTerms(VocabularyEnum vocType, TermVocabulary<T> voc,
|
57
|
Set<UUID> missingTerms);
|
58
|
|
59
|
|
60
|
|
61
|
|
62
|
}
|