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.XdsNonconstructiveDocumentSetRequestAuditDataset;
24  import org.openehealth.ipf.commons.ihe.xds.core.audit.XdsQueryAuditDataset;
25  import org.openehealth.ipf.commons.ihe.xds.iti38.Iti38AuditStrategy;
26  import org.openehealth.ipf.commons.ihe.xds.iti38.Iti38PortType;
27  import org.openehealth.ipf.commons.ihe.xds.iti38.asyncresponse.Iti38AsyncResponsePortType;
28  import org.openehealth.ipf.commons.ihe.xds.iti39.Iti39ClientAuditStrategy;
29  import org.openehealth.ipf.commons.ihe.xds.iti39.Iti39PortType;
30  import org.openehealth.ipf.commons.ihe.xds.iti39.Iti39ServerAuditStrategy;
31  import org.openehealth.ipf.commons.ihe.xds.iti39.asyncresponse.Iti39AsyncResponsePortType;
32  
33  import javax.xml.namespace.QName;
34  import java.util.Arrays;
35  import java.util.List;
36  
37  /**
38   * @author Christian Ohr
39   * @since 3.2
40   */
41  public class XCA implements XdsIntegrationProfile {
42  
43      private static final XCA Instance = new XCA();
44  
45      @AllArgsConstructor
46      public enum Interactions implements XdsInteractionId {
47          ITI_38(ITI_38_WS_CONFIG),
48          ITI_38_ASYNC_RESPONSE(ITI_38_ASYNC_RESPONSE_WS_CONFIG),
49          ITI_39(ITI_39_WS_CONFIG),
50          ITI_39_ASYNC_RESPONSE(ITI_39_ASYNC_RESPONSE_WS_CONFIG);
51  
52          @Getter
53          private WsTransactionConfiguration<? extends XdsAuditDataset> wsTransactionConfiguration;
54  
55          @Override
56          public XdsIntegrationProfile getInteractionProfile() {
57              return Instance;
58          }
59      }
60  
61      @Override
62      public boolean isEbXml30Based() {
63          return true;
64      }
65  
66      @Override
67      public boolean requiresHomeCommunityId() {
68          return true;
69      }
70  
71      @Override
72      public List<InteractionId> getInteractionIds() {
73          return Arrays.asList(Interactions.values());
74      }
75  
76      private final static WsTransactionConfiguration<XdsQueryAuditDataset> ITI_38_WS_CONFIG = new WsTransactionConfiguration<>(
77              "xca-iti38",
78              "Cross Gateway Query",
79              true,
80              new Iti38AuditStrategy(false),
81              new Iti38AuditStrategy(true),
82              new QName("urn:ihe:iti:xds-b:2007", "RespondingGateway_Service", "ihe"),
83              Iti38PortType.class,
84              new QName("urn:ihe:iti:xds-b:2007", "RespondingGateway_Binding_Soap12", "ihe"),
85              false,
86              "wsdl/iti38.wsdl",
87              true,
88              false,
89              true,
90              true);
91  
92      private final static WsTransactionConfiguration<XdsQueryAuditDataset> ITI_38_ASYNC_RESPONSE_WS_CONFIG = new WsTransactionConfiguration<>(
93              "xca-iti38-async-response",
94              "Cross Gateway Query",
95              true,
96              null,
97              new Iti38AuditStrategy(false),     // really!
98              new QName("urn:ihe:iti:xds-b:2007", "InitiatingGateway_Service", "ihe"),
99              Iti38AsyncResponsePortType.class,
100             new QName("urn:ihe:iti:xds-b:2007", "InitiatingGateway_Binding", "ihe"),
101             false,
102             "wsdl/iti38-asyncresponse.wsdl",
103             true,
104             false,
105             false,
106             false);
107 
108     private final static WsTransactionConfiguration<XdsNonconstructiveDocumentSetRequestAuditDataset> ITI_39_WS_CONFIG = new WsTransactionConfiguration<>(
109             "xca-iti39",
110             "Cross Gateway Retrieve",
111             false,
112             new Iti39ClientAuditStrategy(),
113             new Iti39ServerAuditStrategy(),
114             new QName("urn:ihe:iti:xds-b:2007", "RespondingGateway_Service", "ihe"),
115             Iti39PortType.class,
116             new QName("urn:ihe:iti:xds-b:2007", "RespondingGateway_Binding_Soap12", "ihe"),
117             true,
118             "wsdl/iti39.wsdl",
119             true,
120             false,
121             false,
122             true);
123 
124     private final static WsTransactionConfiguration<XdsNonconstructiveDocumentSetRequestAuditDataset> ITI_39_ASYNC_RESPONSE_WS_CONFIG = new WsTransactionConfiguration<>(
125             "xca-iti39-async-response",
126             "Cross Gateway Retrieve",
127             false,
128             null,
129             new Iti39ClientAuditStrategy(),     // really!
130             new QName("urn:ihe:iti:xds-b:2007", "InitiatingGateway_Service", "ihe"),
131             Iti39AsyncResponsePortType.class,
132             new QName("urn:ihe:iti:xds-b:2007", "InitiatingGateway_Binding", "ihe"),
133             false,
134             "wsdl/iti39-asyncresponse.wsdl",
135             true,
136             false,
137             false,
138             false);
139 }