1
|
package eu.dnetlib.oai.sets;
|
2
|
|
3
|
import java.util.List;
|
4
|
|
5
|
import eu.dnetlib.oai.info.SetInfo;
|
6
|
|
7
|
/**
|
8
|
* Collection of sets.
|
9
|
*
|
10
|
* @author michele
|
11
|
*/
|
12
|
public interface SetCollection {
|
13
|
|
14
|
/**
|
15
|
* Get all sets.
|
16
|
*
|
17
|
* @return list of SetInfo instances
|
18
|
*/
|
19
|
List<SetInfo> getAllSets(boolean enabledOnly, final String publisherDBName);
|
20
|
|
21
|
/**
|
22
|
* Test if a set is in this collection.
|
23
|
*
|
24
|
* @param set set spec
|
25
|
* @return true if the set is in this collection
|
26
|
*/
|
27
|
boolean containSet(final String set, final String publisherDBName);
|
28
|
|
29
|
/**
|
30
|
* Test if a set is in this collection.
|
31
|
*
|
32
|
* @param set set spec
|
33
|
* @return true if the set is in this collection
|
34
|
*/
|
35
|
boolean containEnabledSet(final String set, final String publisherDBName);
|
36
|
|
37
|
/**
|
38
|
* Obtains the set query.
|
39
|
*
|
40
|
* @param set set spec
|
41
|
* @return set CQL query
|
42
|
*/
|
43
|
String getSetQuery(final String set, final String publisherDBName);
|
44
|
|
45
|
/**
|
46
|
* Gets the number of elements in the set with the given set spec for the given metadata prefix.
|
47
|
*
|
48
|
* @param setSpec
|
49
|
* @param mdPrefix
|
50
|
* @return -1 if the number of elements is unknown, 0 if the set is empty, a positive number otherwise.
|
51
|
*/
|
52
|
int count(final String setSpec, final String mdPrefix, final String publisherDBName);
|
53
|
|
54
|
}
|