1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.openehealth.ipf.platform.camel.ihe.hl7v3;
17
18 import org.openehealth.ipf.commons.ihe.hl7v3.audit.Hl7v3AuditDataset;
19 import org.openehealth.ipf.commons.ihe.hl7v3.Hl7v3ClientFactory;
20 import org.openehealth.ipf.commons.ihe.hl7v3.Hl7v3ContinuationAwareWsTransactionConfiguration;
21 import org.openehealth.ipf.commons.ihe.hl7v3.Hl7v3ServiceFactory;
22 import org.openehealth.ipf.commons.ihe.hl7v3.storage.Hl7v3ContinuationStorage;
23 import org.openehealth.ipf.commons.ihe.ws.JaxWsClientFactory;
24 import org.openehealth.ipf.commons.ihe.ws.JaxWsServiceFactory;
25 import org.openehealth.ipf.commons.ihe.ws.WsInteractionId;
26 import org.openehealth.ipf.platform.camel.ihe.ws.AbstractWsComponent;
27 import org.openehealth.ipf.platform.camel.ihe.ws.AbstractWsEndpoint;
28 import org.openehealth.ipf.platform.camel.ihe.ws.AbstractWsProducer;
29
30 import java.util.Map;
31
32
33
34
35
36
37
38 public class Hl7v3ContinuationAwareEndpoint
39 extends Hl7v3Endpoint<Hl7v3ContinuationAwareWsTransactionConfiguration> {
40
41
42
43 private boolean supportContinuation = false;
44
45
46
47
48
49
50 private boolean autoCancel = false;
51
52
53
54
55
56
57
58 private int defaultContinuationThreshold = -1;
59
60
61
62
63 private Hl7v3ContinuationStorage continuationStorage = null;
64
65
66
67
68
69 private boolean validationOnContinuation = false;
70
71
72 protected Hl7v3ContinuationAwareEndpoint(
73 String endpointUri,
74 String address,
75 AbstractWsComponent<Hl7v3AuditDataset, Hl7v3ContinuationAwareWsTransactionConfiguration, ? extends WsInteractionId<Hl7v3ContinuationAwareWsTransactionConfiguration>> component,
76 Map<String, Object> parameters) {
77 super(endpointUri, address, component, parameters, null);
78 }
79
80 @Override
81 public AbstractWsProducer<Hl7v3AuditDataset,Hl7v3ContinuationAwareWsTransactionConfiguration, ?, ?> getProducer(AbstractWsEndpoint<Hl7v3AuditDataset,Hl7v3ContinuationAwareWsTransactionConfiguration> endpoint, JaxWsClientFactory<Hl7v3AuditDataset> clientFactory) {
82 return new Hl7v3ContinuationAwareProducer(this, getJaxWsClientFactory());
83 }
84
85
86
87
88 public boolean isSupportContinuation() {
89 return supportContinuation;
90 }
91
92 public void setSupportContinuation(boolean supportContinuation) {
93 this.supportContinuation = supportContinuation;
94 }
95
96
97
98
99
100
101
102
103
104 public int getDefaultContinuationThreshold() {
105 return defaultContinuationThreshold;
106 }
107
108 public void setDefaultContinuationThreshold(int defaultContinuationThreshold) {
109 this.defaultContinuationThreshold = defaultContinuationThreshold;
110 }
111
112
113
114
115
116
117 public Hl7v3ContinuationStorage getContinuationStorage() {
118 return continuationStorage;
119 }
120
121 public void setContinuationStorage(Hl7v3ContinuationStorage continuationStorage) {
122 this.continuationStorage = continuationStorage;
123 }
124
125
126
127
128
129
130
131
132 public boolean isAutoCancel() {
133 return autoCancel;
134 }
135
136 public void setAutoCancel(boolean autoCancel) {
137 this.autoCancel = autoCancel;
138 }
139
140
141
142
143
144 public boolean isValidationOnContinuation() {
145 return validationOnContinuation;
146 }
147
148 public void setValidationOnContinuation(boolean validationOnContinuation) {
149 this.validationOnContinuation = validationOnContinuation;
150 }
151
152
153
154
155
156
157
158 public boolean isManualAudit() {
159 return (isAudit() && isSupportContinuation());
160 }
161
162
163 @Override
164 public JaxWsClientFactory<Hl7v3AuditDataset> getJaxWsClientFactory() {
165 return new Hl7v3ClientFactory(
166 getComponent().getWsTransactionConfiguration(),
167 getServiceUrl(),
168 isManualAudit() ? null : getComponent().getClientAuditStrategy(),
169 getAuditContext(),
170 getCustomInterceptors(),
171 getFeatures(),
172 getProperties(),
173 getCorrelator());
174 }
175
176
177 @Override
178 public JaxWsServiceFactory<Hl7v3AuditDataset> getJaxWsServiceFactory() {
179 return new Hl7v3ServiceFactory(
180 getComponent().getWsTransactionConfiguration(),
181 getServiceAddress(),
182 isManualAudit() ? null : getComponent().getServerAuditStrategy(),
183 getAuditContext(),
184 getCustomInterceptors(),
185 getRejectionHandlingStrategy());
186 }
187 }