View Javadoc
1   /*
2    * Copyright 2014 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  
17  package org.openehealth.ipf.platform.camel.ihe.mllp.core;
18  
19  import lombok.Getter;
20  
21  import java.util.Map;
22  
23  import org.openehealth.ipf.commons.ihe.hl7v2.audit.MllpAuditDataset;
24  import org.openehealth.ipf.commons.ihe.hl7v2.storage.UnsolicitedFragmentationStorage;
25  import org.openehealth.ipf.commons.ihe.hl7v2.storage.InteractiveContinuationStorage;
26  
27  /**
28   * Camel endpoint configuration for MLLP-based eHealth transactions (like IHE PIX, PDQ, XAD-PID, etc.).
29   * @author Dmytro Rud
30   */
31  public class MllpTransactionEndpointConfiguration extends MllpEndpointConfiguration {
32      private static final long serialVersionUID = -6154765290339153487L;
33  
34      @Getter private final boolean supportUnsolicitedFragmentation;
35      @Getter private final int unsolicitedFragmentationThreshold;
36      @Getter private final UnsolicitedFragmentationStorage unsolicitedFragmentationStorage;
37  
38      @Getter private final boolean supportInteractiveContinuation;
39      @Getter private final int interactiveContinuationDefaultThreshold;
40      @Getter private final InteractiveContinuationStorage interactiveContinuationStorage;
41      @Getter private final boolean autoCancel;
42  
43      /**
44       * @deprecated
45       */
46      protected MllpTransactionEndpointConfiguration(MllpComponent<MllpTransactionEndpointConfiguration, ? extends MllpAuditDataset> component, Map<String, Object> parameters) throws Exception {
47          this(component, UNKNOWN_URI, parameters);
48      }
49  
50      protected MllpTransactionEndpointConfiguration(MllpComponent<MllpTransactionEndpointConfiguration, ? extends MllpAuditDataset> component, String uri, Map<String, Object> parameters) throws Exception {
51          super(component, uri, parameters);
52  
53          supportUnsolicitedFragmentation = component.getAndRemoveParameter(
54                  parameters, "supportUnsolicitedFragmentation", boolean.class, false);
55          unsolicitedFragmentationThreshold = component.getAndRemoveParameter(
56                  parameters, "unsolicitedFragmentationThreshold", int.class, -1);            // >= 3 segments
57  
58          unsolicitedFragmentationStorage = component.resolveAndRemoveReferenceParameter(
59                  parameters,
60                  "unsolicitedFragmentationStorage",
61                  UnsolicitedFragmentationStorage.class);
62  
63          supportInteractiveContinuation = component.getAndRemoveParameter(
64                  parameters, "supportInteractiveContinuation", boolean.class, false);
65          interactiveContinuationDefaultThreshold = component.getAndRemoveParameter(
66                  parameters, "interactiveContinuationDefaultThreshold", int.class, -1);      // >= 1 data record
67  
68          interactiveContinuationStorage = component.resolveAndRemoveReferenceParameter(
69                          parameters,
70                          "interactiveContinuationStorage",
71                          InteractiveContinuationStorage.class);
72  
73          autoCancel = component.getAndRemoveParameter(parameters, "autoCancel", boolean.class, false);
74      }
75  
76  }