View Javadoc
1   /*
2    * Copyright 2009 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.core.validate;
17  
18  import org.openehealth.ipf.commons.ihe.xds.XdsInteractionId;
19  import org.openehealth.ipf.commons.ihe.xds.XdsIntegrationProfile;
20  
21  /**
22   * Validation profile for XDS-like transactions.
23   * This has become an interface in IPF 3.2 and is implemented by subclasses of
24   * {@link XdsInteractionId XDS interaction IDs}
25   *
26   *
27   * @author Jens Riemschneider
28   * @author Dmytro Rud
29   * @author Michael Ottati
30   *
31   */
32  public interface ValidationProfile {
33  
34      /**
35       * @return <code>true</code> if checks are done for query transactions.
36       */
37      boolean isQuery();
38  
39  
40      /**
41       * @return ID of the eHealth transaction.
42       */
43      XdsInteractionId getInteractionId();
44  
45  
46      /**
47       * @return ID of interaction profile the transaction belongs to.
48       */
49      XdsIntegrationProfile getInteractionProfile();
50  
51  
52      /**
53       * @return <code>true</code> when the transaction uses ebXML 3.0.
54       */
55      default boolean isEbXml30Based() {
56          return getInteractionProfile().isEbXml30Based();
57      }
58  
59      default boolean isPartOf(Class<? extends XdsIntegrationProfile> clazz) {
60          return clazz.isAssignableFrom(getInteractionProfile().getClass());
61      }
62  
63  }