View Javadoc
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  
18  
19  package org.uddi.api_v3;
20  
21  import java.io.Serializable;
22  import java.util.ArrayList;
23  import java.util.List;
24  
25  import javax.xml.bind.JAXBElement;
26  import javax.xml.bind.JAXBException;
27  import javax.xml.bind.Unmarshaller;
28  import javax.xml.bind.annotation.XmlAccessType;
29  import javax.xml.bind.annotation.XmlAccessorType;
30  import javax.xml.bind.annotation.XmlAttribute;
31  import javax.xml.bind.annotation.XmlElement;
32  import javax.xml.bind.annotation.XmlRootElement;
33  import javax.xml.bind.annotation.XmlTransient;
34  import javax.xml.bind.annotation.XmlType;
35  
36  import org.uddi.JAXBContextUtil;
37  import org.w3c.dom.Node;
38  
39  
40  /**
41   * <p>Java class for dispositionReport complex type.
42   * 
43   * <p>The following schema fragment specifies the expected content contained within this class.
44   * 
45   * <pre>
46   * &lt;complexType name="dispositionReport">
47   *   &lt;complexContent>
48   *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
49   *       &lt;sequence>
50   *         &lt;element ref="{urn:uddi-org:api_v3}result" maxOccurs="unbounded"/>
51   *       &lt;/sequence>
52   *       &lt;attribute name="truncated" type="{urn:uddi-org:api_v3}truncated" />
53   *     &lt;/restriction>
54   *   &lt;/complexContent>
55   * &lt;/complexType>
56   * </pre>
57   * 
58   * 
59   */
60  @XmlAccessorType(XmlAccessType.FIELD)
61  @XmlType(name = "dispositionReport", propOrder = {
62      "result"
63  })
64  @XmlRootElement
65  public class DispositionReport implements Serializable {
66  	@XmlTransient
67  	private static final long serialVersionUID = 5852663849477002516L;
68  	@XmlElement(required = true)
69      protected List<Result> result;
70      @XmlAttribute
71      protected Boolean truncated;
72      
73      public final static transient String E_ACCOUNT_LIMIT_EXCEEDED     = "E_accountLimitExceeded";
74  	public final static transient String E_ASSERTION_NOT_FOUND        = "E_assertionNotFound"; 
75  	public final static transient String E_AUTH_TOKEN_EXPIRED         = "E_authTokenExpired";
76  	public final static transient String E_AUTH_TOKEN_REQUIRED        = "E_authTokenRequired";
77  	public final static transient String E_BUSY                       = "E_busy";
78  	public final static transient String E_CATEGORIZATION_NOT_ALLOWED = "E_categorizationNotAllowed";
79  	public final static transient String E_FATAL_ERROR                = "E_fatalError";
80  	public final static transient String E_INVALID_COMBINATION        = "E_invalidCombination";
81  	public final static transient String E_INVALID_CATEGORY           = "E_invalidCategory";
82  	public final static transient String E_INVALID_COMPLETION_STATUS  = "E_invalidCompletionStatus";
83  	public final static transient String E_INVALID_KEY_PASSED         = "E_invalidKeyPassed";
84  	public final static transient String E_KEY_UNAVAILABLE         	  = "E_keyUnavailable";
85  	public final static transient String E_INVALID_PROJECTION         = "E_invalidProjection";
86  	public final static transient String E_INVALID_TIME               = "E_invalidTime";
87  	public final static transient String E_INVALID_URL_PASSED         = "E_invalidURLPassed";
88  	public final static transient String E_INVALID_VALUE              = "E_invalidValue";
89  	public final static transient String E_KEY_RETIRED                = "E_keyRetired";
90  	public final static transient String E_LANGUAGE_ERROR             = "E_languageError";
91  	public final static transient String E_MESSAGE_TOO_LARGE          = "E_messageTooLarge";
92  	public final static transient String E_NAME_TOO_LONG              = "E_nameTooLong";
93  	public final static transient String E_OPERATOR_MISMATCH          = "E_operatorMismatch";
94  	public final static transient String E_PUBLISHER_CANCELLED        = "E_publisherCancelled";
95  	public final static transient String E_REQUEST_DENIED             = "E_requestDenied";
96  	public final static transient String E_REQUEST_TIMEOUT            = "E_requestTimeout";
97  	public final static transient String E_RESULT_SET_TOO_LARGE       = "E_resultSetTooLarge";
98  	public final static transient String E_SECRET_UNKNOWN             = "E_secretUnknown";
99  	public final static transient String E_SUCCESS                    = "E_success";
100 	public final static transient String E_TOO_MANY_OPTIONS           = "E_tooManyOptions";
101 	public final static transient String E_TRANSFER_ABORTED           = "E_transferAborted";
102 	public final static transient String E_UNKNOWN_USER               = "E_unknownUser";
103 	public final static transient String E_UNRECOGNIZED_VERSION       = "E_unrecognizedVersion";
104 	public final static transient String E_UNSUPPORTED                = "E_unsupported";
105 	public final static transient String E_UNVALIDATABLE              = "E_unvalidatable";
106 	public final static transient String E_USER_MISMATCH              = "E_userMismatch";
107 	public final static transient String E_VALUE_NOT_ALLOWED          = "E_valueNotAllowed";
108 	public final static transient String E_TOKEN_ALREADY_EXISTS       = "E_tokenAlreadyExists";
109 	public final static transient String E_TRANSFER_NOT_ALLOWED       = "E_transferNotAllowed";
110 
111     /**
112      * 
113      */
114     public DispositionReport() {
115 		super();
116 	}
117     /**
118      * 
119      * @param node
120      * @throws JAXBException 
121      */
122     public DispositionReport(Node node) throws JAXBException  {
123 		super();
124 		JAXBContextUtil.getContext(this.getClass().getPackage().getName());
125 		Unmarshaller u = JAXBContextUtil.getContext(
126 				this.getClass().getPackage().getName()).createUnmarshaller();
127 		JAXBElement<DispositionReport> element =  u.unmarshal(node, DispositionReport.class);
128 		this.result = element.getValue().getResult();
129 		this.truncated = element.getValue().truncated;
130 	}
131 
132 	/**
133      * Gets the value of the result property.
134      * 
135      * <p>
136      * This accessor method returns a reference to the live list,
137      * not a snapshot. Therefore any modification you make to the
138      * returned list will be present inside the JAXB object.
139      * This is why there is not a <CODE>set</CODE> method for the result property.
140      * 
141      * <p>
142      * For example, to add a new item, do as follows:
143      * <pre>
144      *    getResult().add(newItem);
145      * </pre>
146      * 
147      * 
148      * <p>
149      * Objects of the following type(s) are allowed in the list
150      * {@link Result }
151      * 
152      * 
153      */
154     public List<Result> getResult() {
155         if (result == null) {
156             result = new ArrayList<Result>();
157         }
158         return this.result;
159     }
160 
161     /**
162      * Gets the value of the truncated property.
163      * 
164      * @return
165      *     possible object is
166      *     {@link Boolean }
167      *     
168      */
169     public Boolean isTruncated() {
170         return truncated;
171     }
172 
173     /**
174      * Sets the value of the truncated property.
175      * 
176      * @param value
177      *     allowed object is
178      *     {@link Boolean }
179      *     
180      */
181     public void setTruncated(Boolean value) {
182         this.truncated = value;
183     }
184     
185     /**
186      * Determines if one of the Results in the this DispositionReport has a Error Code
187      * that matches the errCodeKey passed in. The errCodeKey should be one
188      * of the 
189      * 
190      * @param errCodeKey
191      * @return true if the errCodeKey matches with a code in the Results.
192      */
193     public boolean countainsErrorCode(final String errCodeKey) {
194     	boolean isKeyMatch = false;
195 		for (Result result : getResult()) {
196 			String errCode = result.getErrInfo().getErrCode();
197 			if (errCodeKey.equals(errCode)) {
198 				isKeyMatch = true;
199 				break;
200 			}
201 		}
202     	return isKeyMatch;
203     }
204 
205 }