1 | package de.uni_leipzig.asv.clarin.webservices.pidservices2.interfaces; |
---|
2 | |
---|
3 | import java.util.Map; |
---|
4 | |
---|
5 | import org.apache.commons.httpclient.HttpException; |
---|
6 | |
---|
7 | import de.uni_leipzig.asv.clarin.webservices.pidservices2.Configuration; |
---|
8 | import de.uni_leipzig.asv.clarin.webservices.pidservices2.HandleField; |
---|
9 | |
---|
10 | /** |
---|
11 | * Registers new handles at handle server or modifies existing handles |
---|
12 | * |
---|
13 | * @author Thomas Eckart |
---|
14 | * |
---|
15 | */ |
---|
16 | public interface PidWriter { |
---|
17 | |
---|
18 | /** |
---|
19 | * Try to register a new PID at handle server. Returns registered handle if successful. |
---|
20 | * |
---|
21 | * @param configuration |
---|
22 | * @param fieldMap |
---|
23 | * handle mapping field -> value |
---|
24 | * @param pid PID to register |
---|
25 | * @return registered handle identifier |
---|
26 | * @throws HTTPException if the handle could not be created, possibly |
---|
27 | * because the ID already exists at the server |
---|
28 | */ |
---|
29 | public String registerNewPID(final Configuration configuration, Map<HandleField, String> fieldMap, String pid) |
---|
30 | throws HttpException; |
---|
31 | /** |
---|
32 | * Try to register a new PID at handle server. Returns registered handle if successful. |
---|
33 | * |
---|
34 | * @param configuration |
---|
35 | * @param fieldMap |
---|
36 | * handle mapping field -> value |
---|
37 | * @return registered handle identifier |
---|
38 | * @throws HTTPException |
---|
39 | */ |
---|
40 | public String registerNewPID(final Configuration configuration, Map<HandleField, String> fieldMap) |
---|
41 | throws HttpException; |
---|
42 | |
---|
43 | /** |
---|
44 | * Modify existing PID. This method overwrites all existing fields! Fields that should remain stored for the PID have to be added to fieldMap. |
---|
45 | * |
---|
46 | * @param configuration |
---|
47 | * @param pid |
---|
48 | * Persistent identifier that will be modified/overwritten |
---|
49 | * @param fieldMap |
---|
50 | * new field values: mapping handle field -> value |
---|
51 | */ |
---|
52 | public void modifyPid(final Configuration configuration, final String pid, Map<HandleField, String> fieldMap); |
---|
53 | } |
---|