View Javadoc
1   /*
2    * Copyright 2011 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.hl7v2ws.pcd01;
17  
18  import org.apache.camel.Endpoint;
19  import org.openehealth.ipf.commons.ihe.ws.JaxWsClientFactory;
20  import org.openehealth.ipf.commons.ihe.ws.WsTransactionConfiguration;
21  import org.openehealth.ipf.commons.ihe.ws.cxf.audit.WsAuditDataset;
22  import org.openehealth.ipf.platform.camel.ihe.hl7v2ws.AbstractHl7v2WsComponent;
23  import org.openehealth.ipf.platform.camel.ihe.hl7v2ws.SimpleHl7v2WsEndpoint;
24  import org.openehealth.ipf.platform.camel.ihe.ws.AbstractWsEndpoint;
25  import org.openehealth.ipf.platform.camel.ihe.ws.AbstractWsProducer;
26  import org.openehealth.ipf.platform.camel.ihe.ws.SimpleWsProducer;
27  
28  import java.util.Map;
29  
30  import static org.openehealth.ipf.commons.ihe.hl7v2ws.PCD.Interactions.PCD_01;
31  
32  
33  /**
34   * Camel component for the IHE PCD-01 transaction.
35   */
36  public class Pcd01Component extends AbstractHl7v2WsComponent {
37  
38      public Pcd01Component() {
39          super(PCD_01);
40      }
41  
42      @Override
43      protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) {
44          return new SimpleHl7v2WsEndpoint<Pcd01Component>(uri, remaining, this, parameters, Pcd01Service.class) {
45              @Override
46              public AbstractWsProducer<WsAuditDataset, WsTransactionConfiguration<WsAuditDataset>, ?, ?> getProducer(
47                      AbstractWsEndpoint<WsAuditDataset, WsTransactionConfiguration<WsAuditDataset>> endpoint,
48                      JaxWsClientFactory<WsAuditDataset> clientFactory) {
49                  return new SimpleWsProducer<>(endpoint, clientFactory, String.class, String.class);
50              }
51          };
52      }
53  
54  
55  }