1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.openehealth.ipf.platform.camel.ihe.xds.iti86;
17
18 import lombok.AllArgsConstructor;
19 import lombok.extern.slf4j.Slf4j;
20 import org.apache.camel.Exchange;
21 import org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.RemoveDocumentsRequestType;
22 import org.openehealth.ipf.commons.ihe.xds.core.responses.ErrorCode;
23 import org.openehealth.ipf.commons.ihe.xds.core.responses.Response;
24 import org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.rs.RegistryResponseType;
25 import org.openehealth.ipf.commons.ihe.xds.iti86.Iti86PortType;
26 import org.openehealth.ipf.platform.camel.core.util.Exchanges;
27 import org.openehealth.ipf.platform.camel.ihe.ws.AbstractWebService;
28 import org.openehealth.ipf.platform.camel.ihe.xds.core.converters.EbXML30Converters;
29
30
31
32
33
34
35 @Slf4j
36 @AllArgsConstructor
37 public class Iti86Service extends AbstractWebService implements Iti86PortType {
38
39 @Override
40 public RegistryResponseType documentRepositoryRemoveDocuments(RemoveDocumentsRequestType body) {
41 Exchange result = process(body);
42 Exception exception = Exchanges.extractException(result);
43 if (exception != null) {
44 log.debug(getClass().getSimpleName() + " service failed", exception);
45 Response errorResponse = new Response(
46 exception,
47 ErrorCode.REPOSITORY_METADATA_ERROR,
48 ErrorCode.REPOSITORY_ERROR,
49 null);
50 return EbXML30Converters.convert(errorResponse);
51 }
52 return Exchanges.resultMessage(result).getBody(RegistryResponseType.class);
53 }
54
55 }