1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.openehealth.ipf.platform.camel.ihe.hpd;
17
18 import org.apache.camel.Processor;
19 import org.openehealth.ipf.commons.ihe.hpd.HpdValidator;
20 import org.openehealth.ipf.commons.ihe.hpd.stub.chpidd.DownloadRequest;
21 import org.openehealth.ipf.commons.ihe.hpd.stub.chpidd.DownloadResponse;
22 import org.openehealth.ipf.commons.ihe.hpd.stub.dsmlv2.BatchRequest;
23 import org.openehealth.ipf.commons.ihe.hpd.stub.dsmlv2.BatchResponse;
24
25
26
27
28 public class HpdCamelValidators {
29
30 private static final Processor ITI_58_REQUEST_VALIDATOR = exchange -> {
31 BatchRequest request = exchange.getIn().getMandatoryBody(BatchRequest.class);
32 new HpdValidator().validateBatchRequest(request);
33 };
34
35 private static final Processor ITI_58_RESPONSE_VALIDATOR = exchange -> {
36 BatchResponse response = exchange.getIn().getMandatoryBody(BatchResponse.class);
37 new HpdValidator().validateBatchResponse(response);
38 };
39
40 private static final Processor ITI_59_REQUEST_VALIDATOR = exchange -> {
41
42 };
43
44 private static final Processor ITI_59_RESPONSE_VALIDATOR = exchange -> {
45
46 };
47
48 private static final Processor CH_PIDD_REQUEST_VALIDATOR = exchange -> {
49 DownloadRequest request = exchange.getIn().getMandatoryBody(DownloadRequest.class);
50 new HpdValidator().validateDownloadRequest(request);
51 };
52
53 private static final Processor CH_PIDD_RESPONSE_VALIDATOR = exchange -> {
54 DownloadResponse response = exchange.getIn().getMandatoryBody(DownloadResponse.class);
55 new HpdValidator().validateDownloadResponse(response);
56 };
57
58 public static Processor iti58RequestValidator() {
59 return ITI_58_REQUEST_VALIDATOR;
60 }
61
62 public static Processor iti58ResponseValidator() {
63 return ITI_58_RESPONSE_VALIDATOR;
64 }
65
66 public static Processor iti59RequestValidator() {
67 return ITI_59_REQUEST_VALIDATOR;
68 }
69
70 public static Processor iti59ResponseValidator() {
71 return ITI_59_RESPONSE_VALIDATOR;
72 }
73
74 public static Processor chPiddRequestValidator() {
75 return CH_PIDD_REQUEST_VALIDATOR;
76 }
77
78 public static Processor chPiddResponseValidator() {
79 return CH_PIDD_RESPONSE_VALIDATOR;
80 }
81
82 }