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.platform.camel.ihe.hpd;
17  
18  import org.openehealth.ipf.commons.ihe.ws.*;
19  import org.openehealth.ipf.commons.ihe.ws.cxf.audit.WsAuditDataset;
20  import org.openehealth.ipf.platform.camel.ihe.ws.AbstractWebService;
21  import org.openehealth.ipf.platform.camel.ihe.ws.AbstractWsComponent;
22  import org.openehealth.ipf.platform.camel.ihe.ws.AbstractWsEndpoint;
23  
24  import java.util.Map;
25  
26  /**
27   * @author Dmytro Rud
28   */
29  public abstract class HpdEndpoint<AuditDatasetType extends WsAuditDataset> extends AbstractWsEndpoint<AuditDatasetType, WsTransactionConfiguration<AuditDatasetType>> {
30  
31      protected HpdEndpoint(
32              String endpointUri,
33              String address,
34              AbstractWsComponent<AuditDatasetType, WsTransactionConfiguration<AuditDatasetType>, ? extends WsInteractionId<WsTransactionConfiguration<AuditDatasetType>>> component,
35              Map<String, Object> parameters,
36              Class<? extends AbstractWebService> serviceClass) {
37          super(endpointUri, address, component, parameters, serviceClass);
38      }
39  
40      @Override
41      public JaxWsClientFactory<AuditDatasetType> getJaxWsClientFactory() {
42          return new JaxWsRequestClientFactory<>(
43                  getComponent().getWsTransactionConfiguration(),
44                  getServiceUrl(),
45                  isAudit() ? getClientAuditStrategy() : null,
46                  getAuditContext(),
47                  getCustomInterceptors(),
48                  getFeatures(),
49                  getProperties(),
50                  getCorrelator());
51      }
52  
53      @Override
54      public JaxWsServiceFactory<AuditDatasetType> getJaxWsServiceFactory() {
55          return new JaxWsRequestServiceFactory<>(
56                  getComponent().getWsTransactionConfiguration(),
57                  getServiceAddress(),
58                  isAudit() ? getServerAuditStrategy() : null,
59                  getAuditContext(),
60                  getCustomInterceptors(),
61                  getRejectionHandlingStrategy());
62      }
63  
64  }