1 | /** |
---|
2 | * This software is copyright (c) 2013-2022 by |
---|
3 | * - Leibniz-Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) |
---|
4 | * This is free software. You can redistribute it |
---|
5 | * and/or modify it under the terms described in |
---|
6 | * the GNU General Public License v3 of which you |
---|
7 | * should have received a copy. Otherwise you can download |
---|
8 | * it from |
---|
9 | * |
---|
10 | * http://www.gnu.org/licenses/gpl-3.0.txt |
---|
11 | * |
---|
12 | * @copyright Leibniz-Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) |
---|
13 | * |
---|
14 | * @license http://www.gnu.org/licenses/gpl-3.0.txt |
---|
15 | * GNU General Public License v3 |
---|
16 | */ |
---|
17 | package eu.clarin.sru.server.fcs; |
---|
18 | |
---|
19 | import java.net.URI; |
---|
20 | import java.util.List; |
---|
21 | |
---|
22 | import eu.clarin.sru.server.SRUException; |
---|
23 | |
---|
24 | |
---|
25 | /** |
---|
26 | * An interface for abstracting resource endpoint descriptions. This interface |
---|
27 | * allows you to provide a version of a endpoint description tailored to your |
---|
28 | * environment. |
---|
29 | * <p> |
---|
30 | * The implementation of this interface <em>must</em> be thread-safe. |
---|
31 | * </p> |
---|
32 | */ |
---|
33 | public interface EndpointDescription { |
---|
34 | /** |
---|
35 | * Constant for endpoint description version number for FCS 1.0 |
---|
36 | */ |
---|
37 | public static final int VERSION_1 = 1; |
---|
38 | /** |
---|
39 | * Constant for endpoint description version number for FCS 1.0 |
---|
40 | */ |
---|
41 | public static final int VERSION_2 = 2; |
---|
42 | |
---|
43 | /** |
---|
44 | * Constant for a (synthetic) persistent identifier identifying the top-most |
---|
45 | * (= root) resources in the resource inventory. |
---|
46 | */ |
---|
47 | public static final String PID_ROOT = "root"; |
---|
48 | |
---|
49 | |
---|
50 | /** |
---|
51 | * Destroy the resource info inventory. Use this method for any cleanup the |
---|
52 | * resource info inventory needs to perform upon termination, i.e. closing |
---|
53 | * of persistent database connections, etc. |
---|
54 | */ |
---|
55 | public void destroy(); |
---|
56 | |
---|
57 | |
---|
58 | /** |
---|
59 | * Get the version number of this endpoint description. <br> |
---|
60 | * Valid version are 1 for FCS 1.0 and 2 fpr FCS 2.0. |
---|
61 | * |
---|
62 | * @return the version number for this endpoint description |
---|
63 | */ |
---|
64 | public int getVersion(); |
---|
65 | |
---|
66 | |
---|
67 | /** |
---|
68 | * Check if this endpoint description is in a certain version. |
---|
69 | * |
---|
70 | * @param version |
---|
71 | * the version to check for |
---|
72 | * |
---|
73 | * @return <code>true</code>, if version number matches |
---|
74 | */ |
---|
75 | public boolean isVersion(int version); |
---|
76 | |
---|
77 | |
---|
78 | /** |
---|
79 | * Get the list of capabilities supported by this endpoint. The list |
---|
80 | * contains the appropriate URIs defined by the CLARIN-FCS specification to |
---|
81 | * indicate support for certain capabilities. This list <em>must</em> always |
---|
82 | * contain at least |
---|
83 | * <code>http://clarin.eu/fcs/capability/basic-search</code> for the |
---|
84 | * <em>Basic Search</em> capability. |
---|
85 | * <p> |
---|
86 | * The implementation of this method <em>must</em> be thread-safe. |
---|
87 | * </p> |
---|
88 | * |
---|
89 | * @return the list of capabilities supported by this endpoint |
---|
90 | */ |
---|
91 | public List<URI> getCapabilities(); |
---|
92 | |
---|
93 | |
---|
94 | /** |
---|
95 | * Get the list of data views supported by this endpoint. This list |
---|
96 | * <em>must</em> always contain an entry for the |
---|
97 | * <em>Generic Hits (HITS)</em> data view. |
---|
98 | * <p> |
---|
99 | * The implementation of this method <em>must</em> be thread-safe. |
---|
100 | * </p> |
---|
101 | * |
---|
102 | * @return the list of data views supported by this endpoint |
---|
103 | */ |
---|
104 | public List<DataView> getSupportedDataViews(); |
---|
105 | |
---|
106 | |
---|
107 | /** |
---|
108 | * Get the list of layers that are supported in Advanced Search by this |
---|
109 | * endpoint. |
---|
110 | * <p> |
---|
111 | * The implementation of this method <em>must</em> be thread-safe. |
---|
112 | * </p> |
---|
113 | * |
---|
114 | * @return the list of layers supported in Advanced Search by this endpoint |
---|
115 | */ |
---|
116 | public List<Layer> getSupportedLayers(); |
---|
117 | |
---|
118 | |
---|
119 | /** |
---|
120 | * Get a list of all resources sub-ordinate to a resource identified by a |
---|
121 | * given persistent identifier. |
---|
122 | * <p> |
---|
123 | * The implementation of this method <em>must</em> be thread-safe. |
---|
124 | * </p> |
---|
125 | * |
---|
126 | * @param pid |
---|
127 | * the persistent identifier of the superior resource |
---|
128 | * @return a list of all sub-ordinate ResourceInfo or <code>null</code> if |
---|
129 | * not applicable |
---|
130 | * @throws SRUException |
---|
131 | * if an error occurred |
---|
132 | */ |
---|
133 | public List<ResourceInfo> getResourceList(String pid) |
---|
134 | throws SRUException; |
---|
135 | |
---|
136 | } // interface EndpointDescription |
---|