1 /* 2 * Copyright 2001-2008 The Apache Software Foundation. 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 */ 17 package org.uddi.api_v2; 18 19 import java.util.ArrayList; 20 import java.util.List; 21 import javax.xml.bind.JAXBElement; 22 import javax.xml.bind.JAXBException; 23 import javax.xml.bind.Unmarshaller; 24 import javax.xml.bind.annotation.XmlAccessType; 25 import javax.xml.bind.annotation.XmlAccessorType; 26 import javax.xml.bind.annotation.XmlAttribute; 27 import javax.xml.bind.annotation.XmlElement; 28 import javax.xml.bind.annotation.XmlType; 29 import org.uddi.JAXBContextUtil; 30 import org.w3c.dom.Node; 31 32 /** 33 * <p> 34 * Java class for dispositionReport complex type. 35 * 36 * <p> 37 * The following schema fragment specifies the expected content contained within 38 * this class. 39 * 40 * <pre> 41 * <complexType name="dispositionReport"> 42 * <complexContent> 43 * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> 44 * <sequence> 45 * <element ref="{urn:uddi-org:api_v2}result" maxOccurs="unbounded"/> 46 * </sequence> 47 * <attribute name="generic" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> 48 * <attribute name="operator" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> 49 * <attribute name="truncated" type="{urn:uddi-org:api_v2}truncated" /> 50 * </restriction> 51 * </complexContent> 52 * </complexType> 53 * </pre> 54 * 55 * 56 */ 57 @XmlAccessorType(XmlAccessType.FIELD) 58 @XmlType(name = "dispositionReport", propOrder = { 59 "result" 60 }) 61 public class DispositionReport { 62 63 64 65 @XmlElement(required = true) 66 protected List<Result> result; 67 @XmlAttribute(name = "generic", required = true) 68 protected String generic; 69 @XmlAttribute(name = "operator", required = true) 70 protected String operator; 71 @XmlAttribute(name = "truncated") 72 protected Truncated truncated; 73 74 /** 75 * (30000) Signifies that a particular publisher assertion (consisting of 76 * two businessKey values, and a keyed reference with three components) 77 * cannot be identified in a save or delete operation. 78 */ 79 public final static transient String E_ASSERTION_NOT_FOUND = "E_assertionNotFound"; 80 /** 81 * E_authTokenExpired: (10110) Signifies that the authentication token 82 * information has timed out. 83 */ 84 public final static transient String E_AUTH_TOKEN_EXPIRED = "E_authTokenExpired"; 85 /** 86 * E_authTokenRequired: (10120) Signifies that an invalid authentication 87 * token was passed to an API call that requires authentication. 88 */ 89 public final static transient String E_AUTH_TOKEN_REQUIRED = "E_authTokenRequired"; 90 /** 91 * E_accountLimitExceeded: (10160) Signifies that a save request exceeded 92 * the quantity limits for a given data type. See "Structure Limits" in 93 * Appendix D for details. 94 */ 95 public final static transient String E_ACCOUNT_LIMIT_EXCEEDED = "E_accountLimitExceeded"; 96 /** 97 * E_busy: (10400) Signifies that the request cannot be processed at the 98 * current time. 99 */ 100 public final static transient String E_BUSY = "E_busy"; 101 /** 102 * E_categorizationNotAllowed: (20100) RETIRED. Used for UDDI Version 1.0 103 * compatibility. Replaced by E_valueNotAllowed in 2 and higher. 104 * Restrictions have been placed on the types of information that can be 105 * categorized within a specific taxonomy. The data provided does not 106 * conform to the restrictions placed on the category used. Used with 107 * categorization only. 108 */ 109 public final static transient String E_CATEGORIZATION_NOT_ALLOWED = "E_categorizationNotAllowed"; 110 /** 111 * E_fatalError: (10500) Signifies that a serious technical error has 112 * occurred while processing the request. 113 */ 114 public final static transient String E_FATAL_ERROR = "E_fatalError"; 115 /** 116 * E_invalidCategory (20000): RETIRED. Used for UDDI Version 1.0 117 * compatibility only. Replaced by E_invalidValue in version 2 and higher. 118 * Signifies that the given keyValue did not correspond to a category 119 * within the taxonomy identified by the tModelKey. Used with 120 * categorization only. 121 */ 122 @Deprecated 123 public final static transient String E_INVALID_CATEGORY = "E_invalidCategory"; 124 /** 125 * E_invalidCompletionStatus: (30100) signifies that one of the assertion 126 * status values passed is unrecognized. The completion status that caused 127 * the problem will be clearly indicated in the error text. 128 */ 129 public final static transient String E_INVALID_COMPLETION_STATUS = "E_invalidCompletionStatus"; 130 /** 131 * E_invalidKeyPassed: (10210) Signifies that the uuid_key value passed did 132 * not match with any known key values. The details on the invalid key will 133 * be included in the dispositionReport element. 134 */ 135 public final static transient String E_INVALID_KEY_PASSED = "E_invalidKeyPassed"; 136 /** 137 * E_invalidProjection: (20230) Signifies that an attempt was made to save 138 * a businessEntity containing a service projection that does not match the 139 * businessService being projected. The serviceKey of at least one such 140 * businessService will be included in the dispositionReport. 141 */ 142 public final static transient String E_INVALID_PROJECTION = "E_invalidProjection"; 143 /** 144 * E_invalidURLPassed: (10220) DO NOT USE. Signifies that an error occurred 145 * during processing of a save function involving accessing data from a 146 * remote URL. The details of the HTTP Get report will be included in the 147 * dispositionReport element. Not used in V1 or V2. 148 */ 149 public final static transient String E_INVALID_URL_PASSED = "E_invalidURLPassed"; 150 /** 151 * E_invalidValue: (20200) A value that was passed in a keyValue attribute 152 * did not pass validation. This applies to checked categorizations, 153 * identifiers and other validated code lists. The error text will clearly 154 * indicate the key and value combination that failed validation. 155 */ 156 public final static transient String E_INVALID_VALUE = "E_invalidValue"; 157 /** 158 * E_keyRetired: (10310) DO NOT USE. Signifies that a uuid_key value passed 159 * has been removed from the registry. While the key was once valid as an 160 * accessor, and is still possibly valid, the publisher has removed the 161 * information referenced by the uuid_key passed. V1 errata – not used. 162 * Included here for historical code-set completion. 163 */ 164 public final static transient String E_KEY_RETIRED = "E_keyRetired"; 165 /** 166 * E_languageError: (10060) Signifies that an error was detected while 167 * processing elements that were annotated with xml:lang qualifiers. 168 * Presently, only the description and name elements support xml:lang 169 * qualifications. 170 */ 171 public final static transient String E_LANGUAGE_ERROR = "E_languageError"; 172 /** 173 * E_messageTooLarge: (30110) Signifies that the message is too large. The 174 * upper limit will be clearly indicated in the error text. 175 */ 176 public final static transient String E_MESSAGE_TOO_LARGE = "E_messageTooLarge"; 177 /** 178 * E_nameTooLong: (10020) RETIRED. Used for UDDI Version 1.0 compatibility 179 * only. Signifies that the partial name value passed exceeds the maximum 180 * name length designated by the policy of an implementation or Operator 181 * Site. 182 */ 183 public final static transient String E_NAME_TOO_LONG = "E_nameTooLong"; 184 /** 185 * E_operatorMismatch: (10130) DO NOT USE. Signifies that an attempt was 186 * made to use the publishing API to change data that is mastered at 187 * another Operator Site. This error is only relevant to the public 188 * Operator Sites and does not apply to other UDDI compatible registries. 189 * V1 defined this in error – caused precedence problems with 190 * E_unknownUser. Included here for historical code set completeness. 191 * Retired. 192 */ 193 public final static transient String E_OPERATOR_MISMATCH = "E_operatorMismatch"; 194 /** 195 * E_publisherCancelled: (30220) The target publisher cancelled the custody 196 * transfer operation. 197 */ 198 public final static transient String E_PUBLISHER_CANCELLED = "E_publisherCancelled"; 199 /** 200 * E_requestDenied: (30210) A custody transfer request has been refused. 201 */ 202 public final static transient String E_REQUEST_DENIED = "E_requestDenied"; 203 /** 204 * E_requestTimeout: (20240) Signifies that the request could not be 205 * carried out because a needed web service, such as validate_values, did 206 * not respond in a reasonable amount of time. Details identifying the 207 * failing service will be included in the dispositionReport element. 208 */ 209 public final static transient String E_REQUEST_TIMEOUT = "E_requestTimeout"; 210 /** 211 * E_secretUnknown: (30230) The target publisher was unable to match the 212 * shared secret and the five (5) attempt limit was exhausted. The target 213 * operator automatically cancelled the transfer operation. 214 */ 215 public final static transient String E_SECRET_UNKNOWN = "E_secretUnknown"; 216 /** 217 * E_success: (0) Signifies no failure occurred. This return code is used 218 * with the dispositionReport for reporting results from requests with no 219 * natural response document. 220 */ 221 public final static transient String E_SUCCESS = "E_success"; 222 /** 223 * E_tooManyOptions: (10030) Signifies that too many or incompatible 224 * arguments were passed. The error text will clearly indicate the nature 225 * of the problem. 226 */ 227 public final static transient String E_TOO_MANY_OPTIONS = "E_tooManyOptions"; 228 /** 229 * E_transferAborted: (30200) Signifies that a custody transfer request 230 * will not succeed. 231 */ 232 public final static transient String E_TRANSFER_ABORTED = "E_transferAborted"; 233 /** 234 * E_unknownUser: (10150) Signifies that the user ID and password pair 235 * passed in a get_authToken message is not known to the Operator Site or 236 * is not valid. 237 */ 238 public final static transient String E_UNKNOWN_USER = "E_unknownUser"; 239 /** 240 * E_unrecognizedVersion: (10040) Signifies that the value of the generic 241 * attribute passed is unsupported by the Operator Instance being queried. 242 */ 243 public final static transient String E_UNRECOGNIZED_VERSION = "E_unrecognizedVersion"; 244 /** 245 * E_unsupported: (10050) Signifies that the implementer does not support a 246 * feature or API. 247 */ 248 public final static transient String E_UNSUPPORTED = "E_unsupported"; 249 /** 250 * E_unvalidatable: (20220) Signifies that an attempt was made to reference 251 * a taxonomy or identifier system in a keyedReference whose tModel is 252 * categorized with the unvalidatable categorization. 253 */ 254 public final static transient String E_UNVALIDATABLE = "E_unvalidatable"; 255 /** 256 * E_userMismatch: (10140) Signifies that an attempt was made to use the 257 * publishing API to change data that is controlled by another party. 258 */ 259 public final static transient String E_USER_MISMATCH = "E_userMismatch"; 260 /** 261 * E_valueNotAllowed: (20210) Signifies that a value did not pass 262 * validation because of contextual issues. The value may be valid in some 263 * contexts, but not in the context used. The error text may contain 264 * information about the contextual problem. 265 */ 266 public final static transient String E_VALUE_NOT_ALLOWED = "E_valueNotAllowed"; 267 268 public DispositionReport(Node firstChild) throws JAXBException{ 269 super(); 270 JAXBContextUtil.getContext(this.getClass().getPackage().getName()); 271 Unmarshaller u = JAXBContextUtil.getContext( 272 this.getClass().getPackage().getName()).createUnmarshaller(); 273 JAXBElement<DispositionReport> element = u.unmarshal(firstChild, DispositionReport.class); 274 this.result = element.getValue().getResult(); 275 this.truncated = element.getValue().truncated; 276 } 277 278 public DispositionReport() { 279 280 } 281 282 /** 283 * Gets the value of the result property. 284 * 285 * <p> 286 * This accessor method returns a reference to the live list, not a 287 * snapshot. Therefore any modification you make to the returned list will 288 * be present inside the JAXB object. This is why there is not a 289 * <CODE>set</CODE> method for the result property. 290 * 291 * <p> 292 * For example, to add a new item, do as follows: 293 * <pre> 294 * getResult().add(newItem); 295 * </pre> 296 * 297 * 298 * <p> 299 * Objects of the following type(s) are allowed in the list {@link Result } 300 * 301 * 302 */ 303 public List<Result> getResult() { 304 if (result == null) { 305 result = new ArrayList<Result>(); 306 } 307 return this.result; 308 } 309 310 /** 311 * Gets the value of the generic property. 312 * 313 * @return possible object is {@link String } 314 * 315 */ 316 public String getGeneric() { 317 return generic; 318 } 319 320 /** 321 * Sets the value of the generic property. 322 * 323 * @param value allowed object is {@link String } 324 * 325 */ 326 public void setGeneric(String value) { 327 this.generic = value; 328 } 329 330 /** 331 * Gets the value of the operator property. 332 * 333 * @return possible object is {@link String } 334 * 335 */ 336 public String getOperator() { 337 return operator; 338 } 339 340 /** 341 * Sets the value of the operator property. 342 * 343 * @param value allowed object is {@link String } 344 * 345 */ 346 public void setOperator(String value) { 347 this.operator = value; 348 } 349 350 /** 351 * Gets the value of the truncated property. 352 * 353 * @return possible object is {@link Truncated } 354 * 355 */ 356 public Truncated getTruncated() { 357 return truncated; 358 } 359 360 /** 361 * Sets the value of the truncated property. 362 * 363 * @param value allowed object is {@link Truncated } 364 * 365 */ 366 public void setTruncated(Truncated value) { 367 this.truncated = value; 368 } 369 370 /** 371 * Determines if one of the Results in the this DispositionReport has a Error Code 372 * that matches the errCodeKey passed in. The errCodeKey should be one 373 * of the 374 * 375 * @param errCodeKey 376 * @return true if the errCodeKey matches with a code in the Results. 377 */ 378 public boolean countainsErrorCode(final String errCodeKey) { 379 boolean isKeyMatch = false; 380 for (Result result : getResult()) { 381 String errCode = result.getErrInfo().getErrCode(); 382 if (errCodeKey.equals(errCode)) { 383 isKeyMatch = true; 384 break; 385 } 386 } 387 return isKeyMatch; 388 } 389 390 }