View Javadoc
1   /*
2    * Copyright 2017 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.openehealth.ipf.commons.ihe.xds;
17  
18  import lombok.AllArgsConstructor;
19  import lombok.Getter;
20  import org.openehealth.ipf.commons.ihe.core.InteractionId;
21  import org.openehealth.ipf.commons.ihe.ws.WsTransactionConfiguration;
22  import org.openehealth.ipf.commons.ihe.xds.chxcmu.ChXcmuClientAuditStrategy;
23  import org.openehealth.ipf.commons.ihe.xds.chxcmu.ChXcmuPortType;
24  import org.openehealth.ipf.commons.ihe.xds.chxcmu.ChXcmuServerAuditStrategy;
25  import org.openehealth.ipf.commons.ihe.xds.core.audit.XdsAuditDataset;
26  import org.openehealth.ipf.commons.ihe.xds.core.audit.XdsSubmitAuditDataset;
27  
28  import javax.xml.namespace.QName;
29  import java.util.Arrays;
30  import java.util.List;
31  
32  /**
33   * @author Dmytro Rud
34   * @since 3.4
35   */
36  public class XCMU implements XdsIntegrationProfile {
37  
38  	private static final XCMU Instance = new XCMU();
39  
40  	@AllArgsConstructor
41  	public enum Interactions implements XdsInteractionId {
42  		CH_XCMU(CH_XCMU_WS_CONFIG);
43  
44  		@Getter
45  		private WsTransactionConfiguration<? extends XdsAuditDataset> wsTransactionConfiguration;
46  
47  		@Override
48  		public XdsIntegrationProfile getInteractionProfile() {
49  			return Instance;
50  		}
51  	}
52  
53  	@Override
54  	public boolean isEbXml30Based() {
55  		return true;
56  	}
57  
58  	@Override
59  	public boolean requiresHomeCommunityId() {
60  		return true;
61  	}
62  
63  	@Override
64  	public List<InteractionId> getInteractionIds() {
65  		return Arrays.asList(Interactions.values());
66  	}
67  
68  	private final static WsTransactionConfiguration<XdsSubmitAuditDataset> CH_XCMU_WS_CONFIG = new WsTransactionConfiguration<>(
69  		"ch-xcmu",
70  		"Cross Gateway Update Document Set",
71  		false,
72  		new ChXcmuClientAuditStrategy(),
73  		new ChXcmuServerAuditStrategy(),
74  		new QName("urn:ihe:iti:xcmu:2017", "RespondingGateway_Service", "ihe"),
75  		ChXcmuPortType.class,
76  		new QName("urn:ihe:iti:xcmu:2017", "RespondingGateway_Binding_Soap12", "ihe"),
77  		false,
78  		"wsdl/ch-xcmu.wsdl",
79  		true,
80  		false,
81  		false,
82  		false);
83  }