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.requests.query;
17  
18  import lombok.EqualsAndHashCode;
19  import lombok.Getter;
20  import lombok.Setter;
21  import lombok.ToString;
22  import org.openehealth.ipf.commons.ihe.xds.core.metadata.AssociationType;
23  import org.openehealth.ipf.commons.ihe.xds.core.metadata.AvailabilityStatus;
24  import org.openehealth.ipf.commons.ihe.xds.core.metadata.DocumentEntryType;
25  
26  import javax.xml.bind.annotation.*;
27  import java.util.List;
28  
29  /**
30   * Represents a stored query for GetRelatedDocuments.
31   * @author Jens Riemschneider
32   */
33  @XmlAccessorType(XmlAccessType.FIELD)
34  @XmlType(name = "GetRelatedDocumentsQuery", propOrder = {
35          "associationTypes", "documentEntryTypes", "associationStatuses", "metadataLevel"})
36  @XmlRootElement(name = "getRelatedDocumentsQuery")
37  @EqualsAndHashCode(callSuper = true, doNotUseGetters = true)
38  @ToString(callSuper = true, doNotUseGetters = true)
39  public class GetRelatedDocumentsQuery extends GetFromDocumentQuery
40          implements DocumentEntryTypeAwareStoredQuery
41  {
42      private static final long serialVersionUID = -8768793068458839362L;
43  
44      @XmlElement(name = "associationType")
45      @Getter @Setter private List<AssociationType> associationTypes;
46      @XmlElement(name = "documentEntryType")
47      @Getter @Setter private List<DocumentEntryType> documentEntryTypes;
48      @XmlElement(name = "associationStatus")
49      @Getter @Setter private List<AvailabilityStatus> associationStatuses;
50      @Getter @Setter private Integer metadataLevel;
51  
52      /**
53       * Constructs the query.
54       */
55      public GetRelatedDocumentsQuery() {
56          super(QueryType.GET_RELATED_DOCUMENTS);
57      }
58  
59      @Override
60      public void accept(Visitor visitor) {
61          visitor.visit(this);
62      }
63  }