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;
17  
18  import lombok.EqualsAndHashCode;
19  import lombok.ToString;
20  
21  import javax.xml.bind.annotation.XmlAccessType;
22  import javax.xml.bind.annotation.XmlAccessorType;
23  import javax.xml.bind.annotation.XmlRootElement;
24  import javax.xml.bind.annotation.XmlType;
25  import java.io.Serializable;
26  
27  /**
28   * Contains a reference to a single document in an XDS repository.
29   * <p>
30   * All members of this class are allowed to be <code>null</code>.
31   * @author Jens Riemschneider
32   */
33  
34  @XmlAccessorType(XmlAccessType.FIELD)
35  @XmlType(name = "DocumentReference", propOrder = {"homeCommunityId", "repositoryUniqueId", "documentUniqueId" })
36  @XmlRootElement(name = "documentReference")
37  @EqualsAndHashCode(doNotUseGetters = true)
38  @ToString(doNotUseGetters = true)
39  public class DocumentReference implements Serializable {
40      private static final long serialVersionUID = 7147966094676034661L;
41      
42      private String repositoryUniqueId;
43      private String documentUniqueId;
44      private String homeCommunityId;
45     
46      /**
47       * Constructs the document reference.
48       */
49      public DocumentReference() {}
50      
51      /**
52       * Constructs the document reference.
53       * @param repositoryUniqueId
54       *          the unique ID of the repository containing the document.
55       * @param documentUniqueId
56       *          the unique ID of the document.
57       * @param homeCommunityId
58       *          the home community ID.
59       */
60      public DocumentReference(String repositoryUniqueId, String documentUniqueId, String homeCommunityId) {
61          this.repositoryUniqueId = repositoryUniqueId;
62          this.documentUniqueId = documentUniqueId;
63          this.homeCommunityId = homeCommunityId;
64      }
65  
66      /**
67       * @return the unique ID of the repository containing the document.
68       */
69      public String getRepositoryUniqueId() {
70          return repositoryUniqueId;
71      }
72      
73      /**
74       * @param repositoryUniqueId
75       *          the unique ID of the repository containing the document.
76       */
77      public void setRepositoryUniqueId(String repositoryUniqueId) {
78          this.repositoryUniqueId = repositoryUniqueId;
79      }
80      
81      /**
82       * @return the unique ID of the document.
83       */
84      public String getDocumentUniqueId() {
85          return documentUniqueId;
86      }
87      
88      /**
89       * @param documentUniqueId
90       *          the unique ID of the document.
91       */
92      public void setDocumentUniqueId(String documentUniqueId) {
93          this.documentUniqueId = documentUniqueId;
94      }
95      
96      /**
97       * @return the home community ID.
98       */
99      public String getHomeCommunityId() {
100         return homeCommunityId;
101     }
102 
103     /**
104      * @param homeCommunityId
105      *          the home community ID.
106      */
107     public void setHomeCommunityId(String homeCommunityId) {
108         this.homeCommunityId = homeCommunityId;
109     }
110 
111 }