1 | package de.uni_leipzig.asv.clarin.webservices.pidservices2.interfaces; |
---|
2 | |
---|
3 | import java.io.IOException; |
---|
4 | import java.util.List; |
---|
5 | import java.util.Map; |
---|
6 | |
---|
7 | import net.sf.json.JSONArray; |
---|
8 | import de.uni_leipzig.asv.clarin.webservices.pidservices2.Configuration; |
---|
9 | import de.uni_leipzig.asv.clarin.webservices.pidservices2.HandleField; |
---|
10 | import de.uni_leipzig.asv.clarin.webservices.pidservices2.PidObject; |
---|
11 | |
---|
12 | /** |
---|
13 | * Requests information about handle from handle server |
---|
14 | * |
---|
15 | * @author Thomas Eckart |
---|
16 | */ |
---|
17 | public interface PidResolver { |
---|
18 | |
---|
19 | /** |
---|
20 | * Get information about handle from handle server. |
---|
21 | * |
---|
22 | * @param configuration |
---|
23 | * @param pid |
---|
24 | * Handle Id |
---|
25 | * @return all information from handle server in JSON |
---|
26 | * @throws IOException |
---|
27 | */ |
---|
28 | public JSONArray resolvePidAsJSON(final Configuration configuration, final String pid) throws IOException; |
---|
29 | |
---|
30 | /** |
---|
31 | * Get information about handle from handle server. |
---|
32 | * |
---|
33 | * The returned object only provides some fields of the handle (like referenced URL). To have access to the complete content use resolvePidAsJSON(). |
---|
34 | * |
---|
35 | * @param configuration |
---|
36 | * @param pid |
---|
37 | * Handle Id |
---|
38 | * @return all information from handle server as simple Java object |
---|
39 | * @throws IOException |
---|
40 | */ |
---|
41 | public PidObject resolvePidAsPOJO(final Configuration configuration, final String pid) throws IOException; |
---|
42 | |
---|
43 | /** |
---|
44 | * Search all handles with matching field assignments. |
---|
45 | * |
---|
46 | * @param configuration |
---|
47 | * @param fieldMap |
---|
48 | * searched handle field assignments |
---|
49 | * @return Map handles -> handle fields as JSONArray |
---|
50 | * @throws IOException |
---|
51 | */ |
---|
52 | public Map<String, JSONArray> searchPidAsJSON(final Configuration configuration, Map<HandleField, String> fieldMap) |
---|
53 | throws IOException; |
---|
54 | |
---|
55 | /** |
---|
56 | * Search all handles with matching field assignments. |
---|
57 | * |
---|
58 | * @param configuration |
---|
59 | * @param fieldMap |
---|
60 | * searched handle field assignments |
---|
61 | * @return Map handles -> handle fields as PidObject |
---|
62 | * @throws IOException |
---|
63 | */ |
---|
64 | public Map<String, PidObject> searchPidAsPOJO(final Configuration configuration, Map<HandleField, String> fieldMap) |
---|
65 | throws IOException; |
---|
66 | |
---|
67 | /** |
---|
68 | * Search all handles with matching field assignments. |
---|
69 | * |
---|
70 | * @param configuration |
---|
71 | * @param fieldMap |
---|
72 | * searched handle field assignments |
---|
73 | * @return List of handle identifiers |
---|
74 | * @throws IOException |
---|
75 | */ |
---|
76 | public List<String> searchPidAsList(final Configuration configuration, Map<HandleField, String> fieldMap) |
---|
77 | throws IOException; |
---|
78 | } |
---|