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 java.util.ArrayList;
19  import java.util.List;
20  import javax.xml.bind.annotation.*;
21  
22  
23  /**
24   * <p>Java class for BatchRequest complex type.
25   * 
26   * <p>The following schema fragment specifies the expected content contained within this class.
27   * 
28   * <pre>
29   * &lt;complexType name="BatchRequest">
30   *   &lt;complexContent>
31   *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
32   *       &lt;sequence>
33   *         &lt;element name="authRequest" type="{urn:oasis:names:tc:DSML:2:0:core}AuthRequest" minOccurs="0"/>
34   *         &lt;group ref="{urn:oasis:names:tc:DSML:2:0:core}BatchRequests" maxOccurs="unbounded" minOccurs="0"/>
35   *       &lt;/sequence>
36   *       &lt;attribute name="requestID" type="{urn:oasis:names:tc:DSML:2:0:core}RequestID" />
37   *       &lt;attribute name="processing" default="sequential">
38   *         &lt;simpleType>
39   *           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
40   *             &lt;enumeration value="sequential"/>
41   *             &lt;enumeration value="parallel"/>
42   *           &lt;/restriction>
43   *         &lt;/simpleType>
44   *       &lt;/attribute>
45   *       &lt;attribute name="responseOrder" default="sequential">
46   *         &lt;simpleType>
47   *           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
48   *             &lt;enumeration value="sequential"/>
49   *             &lt;enumeration value="unordered"/>
50   *           &lt;/restriction>
51   *         &lt;/simpleType>
52   *       &lt;/attribute>
53   *       &lt;attribute name="onError" default="exit">
54   *         &lt;simpleType>
55   *           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
56   *             &lt;enumeration value="resume"/>
57   *             &lt;enumeration value="exit"/>
58   *           &lt;/restriction>
59   *         &lt;/simpleType>
60   *       &lt;/attribute>
61   *     &lt;/restriction>
62   *   &lt;/complexContent>
63   * &lt;/complexType>
64   * </pre>
65   * 
66   * 
67   */
68  @XmlAccessorType(XmlAccessType.FIELD)
69  @XmlType(name = "BatchRequest", propOrder = {
70      "authRequest",
71      "batchRequests"
72  })
73  @XmlRootElement
74  public class BatchRequest {
75  
76      protected AuthRequest authRequest;
77      @XmlElements({
78          @XmlElement(name = "searchRequest", type = SearchRequest.class),
79          @XmlElement(name = "modifyRequest", type = ModifyRequest.class),
80          @XmlElement(name = "addRequest", type = AddRequest.class),
81          @XmlElement(name = "delRequest", type = DelRequest.class),
82          @XmlElement(name = "modDNRequest", type = ModifyDNRequest.class),
83          @XmlElement(name = "compareRequest", type = CompareRequest.class),
84          @XmlElement(name = "abandonRequest", type = AbandonRequest.class),
85          @XmlElement(name = "extendedRequest", type = ExtendedRequest.class)
86      })
87      protected List<DsmlMessage> batchRequests;
88      @XmlAttribute(name = "requestID")
89      protected String requestID;
90      @XmlAttribute(name = "processing")
91      protected RequestProcessingType processing;
92      @XmlAttribute(name = "responseOrder")
93      protected RequestResponseOrder responseOrder;
94      @XmlAttribute(name = "onError")
95      protected RequestErrorHandlingType onError;
96  
97      /**
98       * Gets the value of the authRequest property.
99       * 
100      * @return
101      *     possible object is
102      *     {@link AuthRequest }
103      *     
104      */
105     public AuthRequest getAuthRequest() {
106         return authRequest;
107     }
108 
109     /**
110      * Sets the value of the authRequest property.
111      * 
112      * @param value
113      *     allowed object is
114      *     {@link AuthRequest }
115      *     
116      */
117     public void setAuthRequest(AuthRequest value) {
118         this.authRequest = value;
119     }
120 
121     /**
122      * Gets the value of the batchRequests property.
123      * 
124      * <p>
125      * This accessor method returns a reference to the live list,
126      * not a snapshot. Therefore any modification you make to the
127      * returned list will be present inside the JAXB object.
128      * This is why there is not a <CODE>set</CODE> method for the batchRequests property.
129      * 
130      * <p>
131      * For example, to add a new item, do as follows:
132      * <pre>
133      *    getBatchRequests().add(newItem);
134      * </pre>
135      * 
136      * 
137      * <p>
138      * Objects of the following type(s) are allowed in the list
139      * {@link SearchRequest }
140      * {@link ModifyRequest }
141      * {@link AddRequest }
142      * {@link DelRequest }
143      * {@link ModifyDNRequest }
144      * {@link CompareRequest }
145      * {@link AbandonRequest }
146      * {@link ExtendedRequest }
147      * 
148      * 
149      */
150     public List<DsmlMessage> getBatchRequests() {
151         if (batchRequests == null) {
152             batchRequests = new ArrayList<DsmlMessage>();
153         }
154         return this.batchRequests;
155     }
156 
157     /**
158      * Gets the value of the requestID property.
159      * 
160      * @return
161      *     possible object is
162      *     {@link String }
163      *     
164      */
165     public String getRequestID() {
166         return requestID;
167     }
168 
169     /**
170      * Sets the value of the requestID property.
171      * 
172      * @param value
173      *     allowed object is
174      *     {@link String }
175      *     
176      */
177     public void setRequestID(String value) {
178         this.requestID = value;
179     }
180 
181     /**
182      * Gets the value of the processing property.
183      * 
184      * @return
185      *     possible object is
186      *     {@link RequestProcessingType }
187      *     
188      */
189     public RequestProcessingType getProcessing() {
190         if (processing == null) {
191             return RequestProcessingType.SEQUENTIAL;
192         } else {
193             return processing;
194         }
195     }
196 
197     /**
198      * Sets the value of the processing property.
199      * 
200      * @param value
201      *     allowed object is
202      *     {@link RequestProcessingType }
203      *     
204      */
205     public void setProcessing(RequestProcessingType value) {
206         this.processing = value;
207     }
208 
209     /**
210      * Gets the value of the responseOrder property.
211      * 
212      * @return
213      *     possible object is
214      *     {@link RequestResponseOrder }
215      *     
216      */
217     public RequestResponseOrder getResponseOrder() {
218         if (responseOrder == null) {
219             return RequestResponseOrder.SEQUENTIAL;
220         } else {
221             return responseOrder;
222         }
223     }
224 
225     /**
226      * Sets the value of the responseOrder property.
227      * 
228      * @param value
229      *     allowed object is
230      *     {@link RequestResponseOrder }
231      *     
232      */
233     public void setResponseOrder(RequestResponseOrder value) {
234         this.responseOrder = value;
235     }
236 
237     /**
238      * Gets the value of the onError property.
239      * 
240      * @return
241      *     possible object is
242      *     {@link RequestErrorHandlingType }
243      *     
244      */
245     public RequestErrorHandlingType getOnError() {
246         if (onError == null) {
247             return RequestErrorHandlingType.EXIT;
248         } else {
249             return onError;
250         }
251     }
252 
253     /**
254      * Sets the value of the onError property.
255      * 
256      * @param value
257      *     allowed object is
258      *     {@link RequestErrorHandlingType }
259      *     
260      */
261     public void setOnError(RequestErrorHandlingType value) {
262         this.onError = value;
263     }
264 
265 
266     /**
267      * <p>Java class for null.
268      * 
269      * <p>The following schema fragment specifies the expected content contained within this class.
270      * <p>
271      * <pre>
272      * &lt;simpleType>
273      *   &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
274      *     &lt;enumeration value="resume"/>
275      *     &lt;enumeration value="exit"/>
276      *   &lt;/restriction>
277      * &lt;/simpleType>
278      * </pre>
279      * 
280      */
281     @XmlType(name = "")
282     @XmlEnum
283     public enum RequestErrorHandlingType {
284 
285         @XmlEnumValue("resume")
286         RESUME("resume"),
287         @XmlEnumValue("exit")
288         EXIT("exit");
289         private final String value;
290 
291         RequestErrorHandlingType(String v) {
292             value = v;
293         }
294 
295         public String value() {
296             return value;
297         }
298 
299         public static RequestErrorHandlingType fromValue(String v) {
300             for (RequestErrorHandlingType c: RequestErrorHandlingType.values()) {
301                 if (c.value.equals(v)) {
302                     return c;
303                 }
304             }
305             throw new IllegalArgumentException(v);
306         }
307 
308     }
309 
310 
311     /**
312      * <p>Java class for null.
313      * 
314      * <p>The following schema fragment specifies the expected content contained within this class.
315      * <p>
316      * <pre>
317      * &lt;simpleType>
318      *   &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
319      *     &lt;enumeration value="sequential"/>
320      *     &lt;enumeration value="parallel"/>
321      *   &lt;/restriction>
322      * &lt;/simpleType>
323      * </pre>
324      * 
325      */
326     @XmlType(name = "")
327     @XmlEnum
328     public enum RequestProcessingType {
329 
330         @XmlEnumValue("sequential")
331         SEQUENTIAL("sequential"),
332         @XmlEnumValue("parallel")
333         PARALLEL("parallel");
334         private final String value;
335 
336         RequestProcessingType(String v) {
337             value = v;
338         }
339 
340         public String value() {
341             return value;
342         }
343 
344         public static RequestProcessingType fromValue(String v) {
345             for (RequestProcessingType c: RequestProcessingType.values()) {
346                 if (c.value.equals(v)) {
347                     return c;
348                 }
349             }
350             throw new IllegalArgumentException(v);
351         }
352 
353     }
354 
355 
356     /**
357      * <p>Java class for null.
358      * 
359      * <p>The following schema fragment specifies the expected content contained within this class.
360      * <p>
361      * <pre>
362      * &lt;simpleType>
363      *   &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
364      *     &lt;enumeration value="sequential"/>
365      *     &lt;enumeration value="unordered"/>
366      *   &lt;/restriction>
367      * &lt;/simpleType>
368      * </pre>
369      * 
370      */
371     @XmlType(name = "")
372     @XmlEnum
373     public enum RequestResponseOrder {
374 
375         @XmlEnumValue("sequential")
376         SEQUENTIAL("sequential"),
377         @XmlEnumValue("unordered")
378         UNORDERED("unordered");
379         private final String value;
380 
381         RequestResponseOrder(String v) {
382             value = v;
383         }
384 
385         public String value() {
386             return value;
387         }
388 
389         public static RequestResponseOrder fromValue(String v) {
390             for (RequestResponseOrder c: RequestResponseOrder.values()) {
391                 if (c.value.equals(v)) {
392                     return c;
393                 }
394             }
395             throw new IllegalArgumentException(v);
396         }
397 
398     }
399 
400 }