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.iti59;
17  
18  import org.apache.camel.Endpoint;
19  import org.openehealth.ipf.commons.ihe.hpd.HPD;
20  import org.openehealth.ipf.commons.ihe.hpd.iti59.Iti59AuditDataset;
21  import org.openehealth.ipf.commons.ihe.hpd.stub.dsmlv2.BatchRequest;
22  import org.openehealth.ipf.commons.ihe.hpd.stub.dsmlv2.BatchResponse;
23  import org.openehealth.ipf.commons.ihe.ws.JaxWsClientFactory;
24  import org.openehealth.ipf.commons.ihe.ws.WsInteractionId;
25  import org.openehealth.ipf.commons.ihe.ws.WsTransactionConfiguration;
26  import org.openehealth.ipf.platform.camel.ihe.hpd.HpdEndpoint;
27  import org.openehealth.ipf.platform.camel.ihe.ws.AbstractWsComponent;
28  import org.openehealth.ipf.platform.camel.ihe.ws.AbstractWsEndpoint;
29  import org.openehealth.ipf.platform.camel.ihe.ws.AbstractWsProducer;
30  import org.openehealth.ipf.platform.camel.ihe.ws.SimpleWsProducer;
31  
32  import java.util.Map;
33  
34  /**
35   * @author Dmytro Rud
36   */
37  public class Iti59Component extends AbstractWsComponent<Iti59AuditDataset, WsTransactionConfiguration<Iti59AuditDataset>, WsInteractionId<WsTransactionConfiguration<Iti59AuditDataset>>> {
38  
39      public Iti59Component() {
40          super(HPD.FeedInteractions.ITI_59);
41      }
42  
43      @Override
44      protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) {
45          return new HpdEndpoint<Iti59AuditDataset>(uri, remaining, this, parameters, Iti59Service.class) {
46              @Override
47              public AbstractWsProducer<Iti59AuditDataset, WsTransactionConfiguration<Iti59AuditDataset>, ?, ?> getProducer(AbstractWsEndpoint<Iti59AuditDataset, WsTransactionConfiguration<Iti59AuditDataset>> endpoint, JaxWsClientFactory<Iti59AuditDataset> clientFactory) {
48                  return new SimpleWsProducer<>(endpoint, clientFactory, BatchRequest.class, BatchResponse.class);
49              }
50          };
51      }
52  
53  }