1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.openehealth.ipf.platform.camel.ihe.mllp.core;
17
18 import org.apache.camel.CamelContext;
19 import org.apache.camel.component.mina2.Mina2Endpoint;
20 import org.openehealth.ipf.commons.ihe.core.atna.AuditStrategy;
21 import org.openehealth.ipf.commons.ihe.hl7v2.Hl7v2InteractionId;
22 import org.openehealth.ipf.commons.ihe.hl7v2.audit.MllpAuditDataset;
23 import org.openehealth.ipf.platform.camel.ihe.atna.AuditableComponent;
24
25 import java.util.Map;
26
27
28
29
30
31
32 public abstract class MllpTransactionComponent<AuditDatasetType extends MllpAuditDataset>
33 extends MllpComponent<MllpTransactionEndpointConfiguration, AuditDatasetType> implements AuditableComponent<AuditDatasetType> {
34
35 private final Hl7v2InteractionId<AuditDatasetType> interactionId;
36
37 protected MllpTransactionComponent(Hl7v2InteractionId<AuditDatasetType> interactionId) {
38 super();
39 this.interactionId = interactionId;
40 }
41
42 protected MllpTransactionComponent(CamelContext camelContext, Hl7v2InteractionId<AuditDatasetType> interactionId) {
43 super(camelContext);
44 this.interactionId = interactionId;
45 }
46
47 @Override
48 protected MllpTransactionEndpointConfiguration createConfig(String uri, Map<String, Object> parameters) throws Exception {
49 return new MllpTransactionEndpointConfiguration(this, uri, parameters);
50 }
51
52 @Override
53 protected MllpEndpoint<?, ?, ?> createEndpoint(Mina2Endpoint wrappedEndpoint, MllpTransactionEndpointConfiguration config) {
54 return new MllpTransactionEndpoint<>(this, wrappedEndpoint, config);
55 }
56
57 @Override
58 public AuditStrategy<AuditDatasetType> getClientAuditStrategy() {
59 return interactionId.getHl7v2TransactionConfiguration().getClientAuditStrategy();
60 }
61
62 @Override
63 public AuditStrategy<AuditDatasetType> getServerAuditStrategy() {
64 return interactionId.getHl7v2TransactionConfiguration().getServerAuditStrategy();
65 }
66
67 @Override
68 public Hl7v2InteractionId<AuditDatasetType> getInteractionId() {
69 return interactionId;
70 }
71 }