View Javadoc
1   /*
2    * Copyright 2017 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.hpd.stub.dsmlv2;
17  
18  import javax.xml.bind.annotation.XmlAccessType;
19  import javax.xml.bind.annotation.XmlAccessorType;
20  import javax.xml.bind.annotation.XmlAnyElement;
21  import javax.xml.bind.annotation.XmlAttribute;
22  import javax.xml.bind.annotation.XmlEnum;
23  import javax.xml.bind.annotation.XmlEnumValue;
24  import javax.xml.bind.annotation.XmlType;
25  
26  
27  /**
28   * <p>Java class for ErrorResponse complex type.
29   * 
30   * <p>The following schema fragment specifies the expected content contained within this class.
31   * 
32   * <pre>
33   * &lt;complexType name="ErrorResponse">
34   *   &lt;complexContent>
35   *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
36   *       &lt;sequence>
37   *         &lt;element name="message" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
38   *         &lt;element name="detail" minOccurs="0">
39   *           &lt;complexType>
40   *             &lt;complexContent>
41   *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
42   *                 &lt;sequence>
43   *                   &lt;any/>
44   *                 &lt;/sequence>
45   *               &lt;/restriction>
46   *             &lt;/complexContent>
47   *           &lt;/complexType>
48   *         &lt;/element>
49   *       &lt;/sequence>
50   *       &lt;attribute name="requestID" type="{urn:oasis:names:tc:DSML:2:0:core}RequestID" />
51   *       &lt;attribute name="type">
52   *         &lt;simpleType>
53   *           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
54   *             &lt;enumeration value="notAttempted"/>
55   *             &lt;enumeration value="couldNotConnect"/>
56   *             &lt;enumeration value="connectionClosed"/>
57   *             &lt;enumeration value="malformedRequest"/>
58   *             &lt;enumeration value="gatewayInternalError"/>
59   *             &lt;enumeration value="authenticationFailed"/>
60   *             &lt;enumeration value="unresolvableURI"/>
61   *             &lt;enumeration value="other"/>
62   *           &lt;/restriction>
63   *         &lt;/simpleType>
64   *       &lt;/attribute>
65   *     &lt;/restriction>
66   *   &lt;/complexContent>
67   * &lt;/complexType>
68   * </pre>
69   * 
70   * 
71   */
72  @XmlAccessorType(XmlAccessType.FIELD)
73  @XmlType(name = "ErrorResponse", propOrder = {
74      "message",
75      "detail"
76  })
77  public class ErrorResponse {
78  
79      protected String message;
80      protected Detail detail;
81      @XmlAttribute(name = "requestID")
82      protected String requestID;
83      @XmlAttribute(name = "type")
84      protected ErrorType type;
85  
86      /**
87       * Gets the value of the message property.
88       * 
89       * @return
90       *     possible object is
91       *     {@link String }
92       *     
93       */
94      public String getMessage() {
95          return message;
96      }
97  
98      /**
99       * Sets the value of the message property.
100      * 
101      * @param value
102      *     allowed object is
103      *     {@link String }
104      *     
105      */
106     public void setMessage(String value) {
107         this.message = value;
108     }
109 
110     /**
111      * Gets the value of the detail property.
112      * 
113      * @return
114      *     possible object is
115      *     {@link Detail }
116      *     
117      */
118     public Detail getDetail() {
119         return detail;
120     }
121 
122     /**
123      * Sets the value of the detail property.
124      * 
125      * @param value
126      *     allowed object is
127      *     {@link Detail }
128      *     
129      */
130     public void setDetail(Detail value) {
131         this.detail = value;
132     }
133 
134     /**
135      * Gets the value of the requestID property.
136      * 
137      * @return
138      *     possible object is
139      *     {@link String }
140      *     
141      */
142     public String getRequestID() {
143         return requestID;
144     }
145 
146     /**
147      * Sets the value of the requestID property.
148      * 
149      * @param value
150      *     allowed object is
151      *     {@link String }
152      *     
153      */
154     public void setRequestID(String value) {
155         this.requestID = value;
156     }
157 
158     /**
159      * Gets the value of the type property.
160      * 
161      * @return
162      *     possible object is
163      *     {@link ErrorType }
164      *     
165      */
166     public ErrorType getType() {
167         return type;
168     }
169 
170     /**
171      * Sets the value of the type property.
172      * 
173      * @param value
174      *     allowed object is
175      *     {@link ErrorType }
176      *     
177      */
178     public void setType(ErrorType value) {
179         this.type = value;
180     }
181 
182 
183     /**
184      * <p>Java class for anonymous complex type.
185      * 
186      * <p>The following schema fragment specifies the expected content contained within this class.
187      * 
188      * <pre>
189      * &lt;complexType>
190      *   &lt;complexContent>
191      *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
192      *       &lt;sequence>
193      *         &lt;any/>
194      *       &lt;/sequence>
195      *     &lt;/restriction>
196      *   &lt;/complexContent>
197      * &lt;/complexType>
198      * </pre>
199      * 
200      * 
201      */
202     @XmlAccessorType(XmlAccessType.FIELD)
203     @XmlType(name = "", propOrder = {
204         "any"
205     })
206     public static class Detail {
207 
208         @XmlAnyElement(lax = true)
209         protected Object any;
210 
211         /**
212          * Gets the value of the any property.
213          * 
214          * @return
215          *     possible object is
216          *     {@link Object }
217          *     
218          */
219         public Object getAny() {
220             return any;
221         }
222 
223         /**
224          * Sets the value of the any property.
225          * 
226          * @param value
227          *     allowed object is
228          *     {@link Object }
229          *     
230          */
231         public void setAny(Object value) {
232             this.any = value;
233         }
234 
235     }
236 
237 
238     /**
239      * <p>Java class for null.
240      * 
241      * <p>The following schema fragment specifies the expected content contained within this class.
242      * <p>
243      * <pre>
244      * &lt;simpleType>
245      *   &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
246      *     &lt;enumeration value="notAttempted"/>
247      *     &lt;enumeration value="couldNotConnect"/>
248      *     &lt;enumeration value="connectionClosed"/>
249      *     &lt;enumeration value="malformedRequest"/>
250      *     &lt;enumeration value="gatewayInternalError"/>
251      *     &lt;enumeration value="authenticationFailed"/>
252      *     &lt;enumeration value="unresolvableURI"/>
253      *     &lt;enumeration value="other"/>
254      *   &lt;/restriction>
255      * &lt;/simpleType>
256      * </pre>
257      * 
258      */
259     @XmlType(name = "")
260     @XmlEnum
261     public enum ErrorType {
262 
263         @XmlEnumValue("notAttempted")
264         NOT_ATTEMPTED("notAttempted"),
265         @XmlEnumValue("couldNotConnect")
266         COULD_NOT_CONNECT("couldNotConnect"),
267         @XmlEnumValue("connectionClosed")
268         CONNECTION_CLOSED("connectionClosed"),
269         @XmlEnumValue("malformedRequest")
270         MALFORMED_REQUEST("malformedRequest"),
271         @XmlEnumValue("gatewayInternalError")
272         GATEWAY_INTERNAL_ERROR("gatewayInternalError"),
273         @XmlEnumValue("authenticationFailed")
274         AUTHENTICATION_FAILED("authenticationFailed"),
275         @XmlEnumValue("unresolvableURI")
276         UNRESOLVABLE_URI("unresolvableURI"),
277         @XmlEnumValue("other")
278         OTHER("other");
279         private final String value;
280 
281         ErrorType(String v) {
282             value = v;
283         }
284 
285         public String value() {
286             return value;
287         }
288 
289         public static ErrorType fromValue(String v) {
290             for (ErrorType c: ErrorType.values()) {
291                 if (c.value.equals(v)) {
292                     return c;
293                 }
294             }
295             throw new IllegalArgumentException(v);
296         }
297 
298     }
299 
300 }