View Javadoc
1   /*
2    * Copyright 2016 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.core.audit.XdsAuditDataset;
23  import org.openehealth.ipf.commons.ihe.xds.core.audit.XdsQueryAuditDataset;
24  import org.openehealth.ipf.commons.ihe.xds.iti63.Iti63AuditStrategy;
25  import org.openehealth.ipf.commons.ihe.xds.iti63.Iti63PortType;
26  import org.openehealth.ipf.commons.ihe.xds.iti63.asyncresponse.Iti63AsyncResponsePortType;
27  
28  import javax.xml.namespace.QName;
29  import java.util.Arrays;
30  import java.util.List;
31  
32  /**
33   * @author Christian Ohr
34   * @since 3.2
35   */
36  public class XCF implements XdsIntegrationProfile {
37  
38      private static final XCF Instance = new XCF();
39  
40      @AllArgsConstructor
41      public enum Interactions implements XdsInteractionId {
42          ITI_63(ITI_63_WS_CONFIG),
43          ITI_63_ASYNC_RESPONSE(ITI63_ASYNC_RESPONSE_WS_CONFIG);
44  
45          @Getter 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<XdsQueryAuditDataset> ITI_63_WS_CONFIG = new WsTransactionConfiguration<>(
69              "xcf-iti63",
70              "Cross Gateway Fetch",
71              true,
72              new Iti63AuditStrategy(false),
73              new Iti63AuditStrategy(true),
74              new QName("urn:ihe:iti:xds-b:2007", "RespondingGateway_Service", "ihe"),
75              Iti63PortType.class,
76              new QName("urn:ihe:iti:xds-b:2007", "RespondingGateway_Binding_Soap12", "ihe"),
77              true,
78              "wsdl/iti63.wsdl",
79              true,
80              false,
81              true,
82              true);
83  
84      private final static WsTransactionConfiguration<XdsQueryAuditDataset> ITI63_ASYNC_RESPONSE_WS_CONFIG = new WsTransactionConfiguration<>(
85              "xcf-iti63-async-response",
86              "Cross Gateway Fetch",
87              true,
88              null,
89              new Iti63AuditStrategy(false),      // really!
90              new QName("urn:ihe:iti:xds-b:2007", "InitiatingGateway_Service", "ihe"),
91              Iti63AsyncResponsePortType.class,
92              new QName("urn:ihe:iti:xds-b:2007", "InitiatingGateway_Binding", "ihe"),
93              false,
94              "wsdl/iti63-asyncresponse.wsdl",
95              true,
96              false,
97              false,
98              false);
99  }