1
|
package eu.dnetlib.clients.data.mdstore.ws;
|
2
|
|
3
|
import eu.dnetlib.api.DriverServiceException;
|
4
|
import eu.dnetlib.api.data.MDStoreService;
|
5
|
import eu.dnetlib.api.data.MDStoreServiceException;
|
6
|
import eu.dnetlib.domain.EPR;
|
7
|
import eu.dnetlib.domain.ServiceIdentity;
|
8
|
import eu.dnetlib.domain.enabling.Notification;
|
9
|
import eu.dnetlib.utils.EPRUtils;
|
10
|
|
11
|
import java.util.List;
|
12
|
|
13
|
/**
|
14
|
* Created by antleb on 9/8/14.
|
15
|
*/
|
16
|
public class MDStoreServiceWSClient implements MDStoreService {
|
17
|
private eu.dnetlib.data.mdstore.MDStoreService service = null;
|
18
|
|
19
|
public void setClient(eu.dnetlib.data.mdstore.MDStoreService service) {
|
20
|
this.service = service;
|
21
|
}
|
22
|
|
23
|
public void setWebService(Object service) {
|
24
|
this.service = (eu.dnetlib.data.mdstore.MDStoreService) service;
|
25
|
}
|
26
|
|
27
|
@Override
|
28
|
public EPR deliverMDRecords(String mdStoreId, String from, String until, String recordsFilter) throws MDStoreServiceException {
|
29
|
try {
|
30
|
return EPRUtils.createEPR(service.deliverMDRecords(mdStoreId, from, until, recordsFilter));
|
31
|
} catch (eu.dnetlib.data.mdstore.MDStoreServiceException e) {
|
32
|
throw new MDStoreServiceException("Error delivering records", e);
|
33
|
}
|
34
|
}
|
35
|
|
36
|
@Override
|
37
|
public String deliverRecord(String mdStoreId, String recordId) throws MDStoreServiceException {
|
38
|
try {
|
39
|
return service.deliverRecord(mdStoreId, recordId);
|
40
|
} catch (eu.dnetlib.data.mdstore.MDStoreServiceException e) {
|
41
|
throw new MDStoreServiceException("Error delivering record", e);
|
42
|
}
|
43
|
}
|
44
|
|
45
|
@Override
|
46
|
public EPR bulkDeliverMDRecords(String format, String layout, String interpretation) throws MDStoreServiceException {
|
47
|
try {
|
48
|
return EPRUtils.createEPR(service.bulkDeliverMDRecords(format, layout, interpretation));
|
49
|
} catch (eu.dnetlib.data.mdstore.MDStoreServiceException e) {
|
50
|
throw new MDStoreServiceException("Error delivering records", e);
|
51
|
}
|
52
|
}
|
53
|
|
54
|
@Override
|
55
|
public List<String> getListOfMDStores() throws MDStoreServiceException {
|
56
|
throw new UnsupportedOperationException();
|
57
|
}
|
58
|
|
59
|
@Override
|
60
|
public List<String> listMDStores(String format, String layout, String interpretation) throws MDStoreServiceException {
|
61
|
throw new UnsupportedOperationException();
|
62
|
}
|
63
|
|
64
|
@Override
|
65
|
public boolean storeMDRecordsFromRS(String mdStoreId, String resultSetId, String storingType) throws MDStoreServiceException {
|
66
|
throw new UnsupportedOperationException();
|
67
|
}
|
68
|
|
69
|
@Override
|
70
|
public ServiceIdentity identify() {
|
71
|
throw new UnsupportedOperationException();
|
72
|
}
|
73
|
|
74
|
@Override
|
75
|
public void notify(Notification notification) throws DriverServiceException {
|
76
|
throw new UnsupportedOperationException();
|
77
|
}
|
78
|
}
|