1
|
/**
|
2
|
* Copyright (C) 2009 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
|
package eu.etaxonomy.cdm.persistence.dao.common;
|
10
|
|
11
|
import java.util.List;
|
12
|
|
13
|
import eu.etaxonomy.cdm.model.metadata.CdmPreference;
|
14
|
import eu.etaxonomy.cdm.model.metadata.CdmPreference.PrefKey;
|
15
|
import eu.etaxonomy.cdm.model.metadata.IPreferencePredicate;
|
16
|
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
|
17
|
|
18
|
/**
|
19
|
* @author a.mueller
|
20
|
* @since 2013-09-09
|
21
|
*/
|
22
|
public interface IPreferenceDao {
|
23
|
|
24
|
/**
|
25
|
* Retrieve the value for the given preference key.
|
26
|
* @param key
|
27
|
* @return
|
28
|
*/
|
29
|
public CdmPreference get(CdmPreference.PrefKey key);
|
30
|
|
31
|
/**
|
32
|
* Write the value for the preference's key
|
33
|
*/
|
34
|
public void set(CdmPreference preference);
|
35
|
|
36
|
/**
|
37
|
* Return the number of all existing cdm preferences
|
38
|
*/
|
39
|
public long count();
|
40
|
|
41
|
public List<CdmPreference> list();
|
42
|
|
43
|
public List<CdmPreference> list(IPreferencePredicate<?> predicate);
|
44
|
|
45
|
/**
|
46
|
* Retrieves the best matching CdmPreference for the given
|
47
|
* taxon node and the given predicate.<BR>
|
48
|
* The rules how to do this best is still under discussion (see FIXME in implementing code)
|
49
|
*
|
50
|
* @param taxonNode
|
51
|
* @param predicate
|
52
|
* @return the CdmPreference
|
53
|
*/
|
54
|
public CdmPreference find(TaxonNode taxonNode, String predicate);
|
55
|
|
56
|
public void remove(PrefKey key);
|
57
|
|
58
|
}
|