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.intercept.producer;
17
18 import org.apache.camel.Exchange;
19 import org.openehealth.ipf.commons.audit.AuditContext;
20 import org.openehealth.ipf.commons.audit.utils.AuditUtils;
21 import org.openehealth.ipf.commons.ihe.core.atna.AuditStrategy;
22 import org.openehealth.ipf.commons.ihe.hl7v2.audit.MllpAuditDataset;
23 import org.openehealth.ipf.platform.camel.ihe.mllp.core.intercept.MllpAuditInterceptorSupport;
24
25
26
27
28
29
30
31 public class ProducerAuditInterceptor<AuditDatasetType extends MllpAuditDataset>
32 extends MllpAuditInterceptorSupport<AuditDatasetType> {
33
34
35 public ProducerAuditInterceptor(AuditContext auditContext) {
36 super(auditContext);
37 }
38
39 @Override
40 public void determineParticipantsAddresses(Exchange exchange, MllpAuditDataset auditDataset) {
41 auditDataset.setLocalAddress(AuditUtils.getLocalHostName());
42 auditDataset.setRemoteAddress(getEndpoint().getEndpointUri());
43 }
44
45 @Override
46 public AuditStrategy<AuditDatasetType> getAuditStrategy() {
47 return getEndpoint().getClientAuditStrategy();
48 }
49 }