1 | package eu.clarin.sru.server.fcs; |
---|
2 | |
---|
3 | import java.net.URI; |
---|
4 | import java.util.List; |
---|
5 | |
---|
6 | import eu.clarin.sru.server.SRUException; |
---|
7 | |
---|
8 | |
---|
9 | /** |
---|
10 | * An interface for abstracting resource endpoint descriptions. This interface |
---|
11 | * allows you to provide a version of a endpoint description tailored to your |
---|
12 | * environment. |
---|
13 | * <p> |
---|
14 | * The implementation of this interface <em>must</em> be thread-safe. |
---|
15 | * </p> |
---|
16 | */ |
---|
17 | public interface EndpointDescription { |
---|
18 | /** |
---|
19 | * Constant for a (synthetic) persistent identifier identifying the top-most |
---|
20 | * (= root) resources in the resource inventory. |
---|
21 | */ |
---|
22 | public static final String PID_ROOT = "root"; |
---|
23 | |
---|
24 | /** |
---|
25 | * Destroy the resource info inventory. Use this method for any cleanup the |
---|
26 | * resource info inventory needs to perform upon termination, i.e. closing |
---|
27 | * of persistent database connections, etc. |
---|
28 | */ |
---|
29 | public void destroy(); |
---|
30 | |
---|
31 | |
---|
32 | /** |
---|
33 | * Get the list of capabilities supported by this endpoint. The list |
---|
34 | * contains the appropriate URIs defined by the CLARIN-FCS specification to |
---|
35 | * indicate support for certain capabilities. This list <em>must</em> always |
---|
36 | * contain at least |
---|
37 | * <code>http://clarin.eu/fcs/capability/basic-search</code> for the |
---|
38 | * <em>Basic Search</em> capability. |
---|
39 | * <p> |
---|
40 | * The implementation of this method <em>must</em> be thread-safe. |
---|
41 | * </p> |
---|
42 | * |
---|
43 | * @return the list of capabilities supported by this endpoint |
---|
44 | */ |
---|
45 | public List<URI> getCapabilities(); |
---|
46 | |
---|
47 | |
---|
48 | /** |
---|
49 | * Get the list of data views supported by this endpoint. This list |
---|
50 | * <em>must</em> always contain an entry for the |
---|
51 | * <em>Generic Hits (HITS)</em> data view. |
---|
52 | * <p> |
---|
53 | * The implementation of this method <em>must</em> be thread-safe. |
---|
54 | * </p> |
---|
55 | * |
---|
56 | * @return the list of data views supported by this endpoint |
---|
57 | */ |
---|
58 | public List<DataView> getSupportedDataViews(); |
---|
59 | |
---|
60 | |
---|
61 | /** |
---|
62 | * Get a list of all resources sub-ordinate to a resource identified by a |
---|
63 | * given persistent identifier. |
---|
64 | * <p> |
---|
65 | * The implementation of this method <em>must</em> be thread-safe. |
---|
66 | * </p> |
---|
67 | * |
---|
68 | * @param pid |
---|
69 | * the persistent identifier of the superior resource |
---|
70 | * @return a list of all sub-ordinate ResourceInfo or <code>null</code> if |
---|
71 | * not applicable |
---|
72 | * @throws SRUException |
---|
73 | * if an error occurred |
---|
74 | */ |
---|
75 | public List<ResourceInfo> getResourceList(String pid) |
---|
76 | throws SRUException; |
---|
77 | |
---|
78 | } // interface EndpointDescription |
---|