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 * <complexType name="ErrorResponse"> 34 * <complexContent> 35 * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> 36 * <sequence> 37 * <element name="message" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> 38 * <element name="detail" minOccurs="0"> 39 * <complexType> 40 * <complexContent> 41 * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> 42 * <sequence> 43 * <any/> 44 * </sequence> 45 * </restriction> 46 * </complexContent> 47 * </complexType> 48 * </element> 49 * </sequence> 50 * <attribute name="requestID" type="{urn:oasis:names:tc:DSML:2:0:core}RequestID" /> 51 * <attribute name="type"> 52 * <simpleType> 53 * <restriction base="{http://www.w3.org/2001/XMLSchema}string"> 54 * <enumeration value="notAttempted"/> 55 * <enumeration value="couldNotConnect"/> 56 * <enumeration value="connectionClosed"/> 57 * <enumeration value="malformedRequest"/> 58 * <enumeration value="gatewayInternalError"/> 59 * <enumeration value="authenticationFailed"/> 60 * <enumeration value="unresolvableURI"/> 61 * <enumeration value="other"/> 62 * </restriction> 63 * </simpleType> 64 * </attribute> 65 * </restriction> 66 * </complexContent> 67 * </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 * <complexType> 190 * <complexContent> 191 * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> 192 * <sequence> 193 * <any/> 194 * </sequence> 195 * </restriction> 196 * </complexContent> 197 * </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 * <simpleType> 245 * <restriction base="{http://www.w3.org/2001/XMLSchema}string"> 246 * <enumeration value="notAttempted"/> 247 * <enumeration value="couldNotConnect"/> 248 * <enumeration value="connectionClosed"/> 249 * <enumeration value="malformedRequest"/> 250 * <enumeration value="gatewayInternalError"/> 251 * <enumeration value="authenticationFailed"/> 252 * <enumeration value="unresolvableURI"/> 253 * <enumeration value="other"/> 254 * </restriction> 255 * </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 }