001: //
002: // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-422
003: // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
004: // Any modifications to this file will be lost upon recompilation of the source schema.
005: // Generated on: 2007.07.10 at 02:10:42 PM PDT
006: //
007:
008: package com.sun.xml.ws.rm.v200702;
009:
010: import com.sun.xml.ws.rm.protocol.AbstractSequenceAcknowledgement;
011: import com.sun.xml.ws.rm.protocol.Messages;
012:
013: import org.w3c.dom.Element;
014:
015: import javax.xml.bind.annotation.*;
016: import javax.xml.namespace.QName;
017: import java.math.BigInteger;
018: import java.util.ArrayList;
019: import java.util.HashMap;
020: import java.util.List;
021: import java.util.Map;
022:
023: /**
024: * <p>Java class for anonymous complex type.
025: *
026: * <p>The following schema fragment specifies the expected content contained within this class.
027: *
028: * <pre>
029: * <complexType>
030: * <complexContent>
031: * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
032: * <sequence>
033: * <element ref="{http://docs.oasis-open.org/ws-rx/wsrm/200702}Identifier"/>
034: * <choice>
035: * <sequence>
036: * <choice>
037: * <element name="AcknowledgementRange" maxOccurs="unbounded">
038: * <complexType>
039: * <complexContent>
040: * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
041: * <sequence>
042: * </sequence>
043: * <attribute name="Upper" use="required" type="{http://www.w3.org/2001/XMLSchema}unsignedLong" />
044: * <attribute name="Lower" use="required" type="{http://www.w3.org/2001/XMLSchema}unsignedLong" />
045: * </restriction>
046: * </complexContent>
047: * </complexType>
048: * </element>
049: * <element name="None">
050: * <complexType>
051: * <complexContent>
052: * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
053: * <sequence>
054: * </sequence>
055: * </restriction>
056: * </complexContent>
057: * </complexType>
058: * </element>
059: * </choice>
060: * <element name="Final" minOccurs="0">
061: * <complexType>
062: * <complexContent>
063: * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
064: * <sequence>
065: * </sequence>
066: * </restriction>
067: * </complexContent>
068: * </complexType>
069: * </element>
070: * </sequence>
071: * <element name="Nack" type="{http://www.w3.org/2001/XMLSchema}unsignedLong" maxOccurs="unbounded"/>
072: * </choice>
073: * <any/>
074: * </sequence>
075: * </restriction>
076: * </complexContent>
077: * </complexType>
078: * </pre>
079: *
080: *
081: */
082: @XmlAccessorType(XmlAccessType.FIELD)
083: @XmlType(name="",propOrder={"identifier","acknowledgementRange","none","_final","bufferRemaining","nack","any"})
084: @XmlRootElement(name="SequenceAcknowledgement",namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702")
085: public class SequenceAcknowledgementElement extends
086: AbstractSequenceAcknowledgement {
087:
088: @XmlElement(name="Identifier",required=true,namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702")
089: protected Identifier identifier;
090: @XmlElement(name="AcknowledgementRange",namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702")
091: protected List<SequenceAcknowledgementElement.AcknowledgementRange> acknowledgementRange;
092: @XmlElement(name="None",namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702")
093: protected SequenceAcknowledgementElement.None none;
094: @XmlElement(name="Final",namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702")
095: protected SequenceAcknowledgementElement.Final _final;
096: @XmlElement(name="BufferRemaining",namespace="http://schemas.microsoft.com/ws/2006/05/rm")
097: public Integer bufferRemaining;
098:
099: @XmlElement(name="Nack",namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702")
100: @XmlSchemaType(name="unsignedLong")
101: protected List<BigInteger> nack;
102: @XmlAnyElement(lax=true)
103: protected List<Object> any;
104: @XmlAnyAttribute
105: private Map<QName, String> otherAttributes = new HashMap<QName, String>();
106:
107: /**
108: * Gets the value of the identifier property.
109: *
110: * @return
111: * possible object is
112: * {@link Identifier }
113: *
114: */
115: public Identifier getIdentifier() {
116: return identifier;
117: }
118:
119: /**
120: * Sets the value of the identifier property.
121: *
122: * @param value
123: * allowed object is
124: * {@link Identifier }
125: *
126: */
127: public void setIdentifier(Identifier value) {
128: this .identifier = value;
129: }
130:
131: /**
132: * Gets the value of the acknowledgementRange property.
133: *
134: * <p>
135: * This accessor method returns a reference to the live list,
136: * not a snapshot. Therefore any modification you make to the
137: * returned list will be present inside the JAXB object.
138: * This is why there is not a <CODE>set</CODE> method for the acknowledgementRange property.
139: *
140: * <p>
141: * For example, to add a new item, do as follows:
142: * <pre>
143: * getAcknowledgementRange().add(newItem);
144: * </pre>
145: *
146: *
147: * <p>
148: * Objects of the following type(s) are allowed in the list
149: * {@link SequenceAcknowledgement.AcknowledgementRange }
150: *
151: *
152: */
153: public List<SequenceAcknowledgementElement.AcknowledgementRange> getAcknowledgementRange() {
154: if (acknowledgementRange == null) {
155: acknowledgementRange = new ArrayList<SequenceAcknowledgementElement.AcknowledgementRange>();
156: }
157: return this .acknowledgementRange;
158: }
159:
160: /**
161: * Gets the value of the none property.
162: *
163: * @return
164: * possible object is
165: * {@link SequenceAcknowledgementElement.None }
166: *
167: */
168: public SequenceAcknowledgementElement.None getNone() {
169: return none;
170: }
171:
172: /**
173: * Sets the value of the none property.
174: *
175: * @param value
176: * allowed object is
177: * {@link SequenceAcknowledgementElement.None }
178: *
179: */
180: public void setNone(SequenceAcknowledgementElement.None value) {
181: this .none = value;
182: }
183:
184: /**
185: * Gets the value of the final property.
186: *
187: * @return
188: * possible object is
189: * {@link SequenceAcknowledgement.Final }
190: *
191: */
192: public SequenceAcknowledgementElement.Final getFinal() {
193: return _final;
194: }
195:
196: /**
197: * Sets the value of the final property.
198: *
199: * @param value
200: * allowed object is
201: * {@link SequenceAcknowledgementElement.Final }
202: *
203: */
204: public void setFinal(SequenceAcknowledgementElement.Final value) {
205: this ._final = value;
206: }
207:
208: /**
209: * Gets the value of the nack property.
210: *
211: * <p>
212: * This accessor method returns a reference to the live list,
213: * not a snapshot. Therefore any modification you make to the
214: * returned list will be present inside the JAXB object.
215: * This is why there is not a <CODE>set</CODE> method for the nack property.
216: *
217: * <p>
218: * For example, to add a new item, do as follows:
219: * <pre>
220: * getNack().add(newItem);
221: * </pre>
222: *
223: *
224: * <p>
225: * Objects of the following type(s) are allowed in the list
226: * {@link BigInteger }
227: *
228: *
229: */
230: public List<BigInteger> getNack() {
231: if (nack == null) {
232: nack = new ArrayList<BigInteger>();
233: }
234: return this .nack;
235: }
236:
237: /**
238: * Gets the value of the any property.
239: *
240: * <p>
241: * This accessor method returns a reference to the live list,
242: * not a snapshot. Therefore any modification you make to the
243: * returned list will be present inside the JAXB object.
244: * This is why there is not a <CODE>set</CODE> method for the any property.
245: *
246: * <p>
247: * For example, to add a new item, do as follows:
248: * <pre>
249: * getAny().add(newItem);
250: * </pre>
251: *
252: *
253: * <p>
254: * Objects of the following type(s) are allowed in the list
255: * {@link Object }
256: * {@link Element }
257: *
258: *
259: */
260: public List<Object> getAny() {
261: if (any == null) {
262: any = new ArrayList<Object>();
263: }
264: return this .any;
265: }
266:
267: /**
268: * Gets a map that contains attributes that aren't bound to any typed property on this class.
269: *
270: * <p>
271: * the map is keyed by the name of the attribute and
272: * the value is the string value of the attribute.
273: *
274: * the map returned by this method is live, and you can add new attribute
275: * by updating the map directly. Because of this design, there's no setter.
276: *
277: *
278: * @return
279: * always non-null
280: */
281: public Map<QName, String> getOtherAttributes() {
282: return otherAttributes;
283: }
284:
285: /**
286: * <p>Java class for anonymous complex type.
287: *
288: * <p>The following schema fragment specifies the expected content contained within this class.
289: *
290: * <pre>
291: * <complexType>
292: * <complexContent>
293: * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
294: * <sequence>
295: * </sequence>
296: * <attribute name="Upper" use="required" type="{http://www.w3.org/2001/XMLSchema}unsignedLong" />
297: * <attribute name="Lower" use="required" type="{http://www.w3.org/2001/XMLSchema}unsignedLong" />
298: * </restriction>
299: * </complexContent>
300: * </complexType>
301: * </pre>
302: *
303: *
304: */
305: @XmlAccessorType(XmlAccessType.FIELD)
306: @XmlType(name="")
307: public static class AcknowledgementRange {
308:
309: @XmlAttribute(name="Upper",required=true)
310: @XmlSchemaType(name="unsignedLong")
311: protected BigInteger upper;
312: @XmlAttribute(name="Lower",required=true)
313: @XmlSchemaType(name="unsignedLong")
314: protected BigInteger lower;
315: @XmlAnyAttribute
316: private Map<QName, String> otherAttributes = new HashMap<QName, String>();
317:
318: /**
319: * Gets the value of the upper property.
320: *
321: * @return
322: * possible object is
323: * {@link BigInteger }
324: *
325: */
326: public BigInteger getUpper() {
327: return upper;
328: }
329:
330: /**
331: * Sets the value of the upper property.
332: *
333: * @param value
334: * allowed object is
335: * {@link BigInteger }
336: *
337: */
338: public void setUpper(BigInteger value) {
339: this .upper = value;
340: }
341:
342: /**
343: * Gets the value of the lower property.
344: *
345: * @return
346: * possible object is
347: * {@link BigInteger }
348: *
349: */
350: public BigInteger getLower() {
351: return lower;
352: }
353:
354: /**
355: * Sets the value of the lower property.
356: *
357: * @param value
358: * allowed object is
359: * {@link BigInteger }
360: *
361: */
362: public void setLower(BigInteger value) {
363: this .lower = value;
364: }
365:
366: /**
367: * Gets a map that contains attributes that aren't bound to any typed property on this class.
368: *
369: * <p>
370: * the map is keyed by the name of the attribute and
371: * the value is the string value of the attribute.
372: *
373: * the map returned by this method is live, and you can add new attribute
374: * by updating the map directly. Because of this design, there's no setter.
375: *
376: *
377: * @return
378: * always non-null
379: */
380: public Map<QName, String> getOtherAttributes() {
381: return otherAttributes;
382: }
383:
384: }
385:
386: /**
387: * <p>Java class for anonymous complex type.
388: *
389: * <p>The following schema fragment specifies the expected content contained within this class.
390: *
391: * <pre>
392: * <complexType>
393: * <complexContent>
394: * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
395: * <sequence>
396: * </sequence>
397: * </restriction>
398: * </complexContent>
399: * </complexType>
400: * </pre>
401: *
402: *
403: */
404: @XmlAccessorType(XmlAccessType.FIELD)
405: @XmlType(name="")
406: public static class Final {
407:
408: }
409:
410: /**
411: * <p>Java class for anonymous complex type.
412: *
413: * <p>The following schema fragment specifies the expected content contained within this class.
414: *
415: * <pre>
416: * <complexType>
417: * <complexContent>
418: * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
419: * <sequence>
420: * </sequence>
421: * </restriction>
422: * </complexContent>
423: * </complexType>
424: * </pre>
425: *
426: *
427: */
428: @XmlAccessorType(XmlAccessType.FIELD)
429: @XmlType(name="")
430: public static class None {
431:
432: }
433:
434: public void setId(String id) {
435: com.sun.xml.ws.rm.v200702.Identifier identifier = new Identifier();
436: identifier.setValue(id);
437: setIdentifier(identifier);
438: }
439:
440: public String getId() {
441: return getIdentifier().getValue();
442: }
443:
444: public int getBufferRemaining() {
445: if (bufferRemaining == null) {
446: return -1;
447: }
448: return bufferRemaining;
449: }
450:
451: public void setBufferRemaining(int value) {
452: bufferRemaining = value;
453: }
454:
455: public void addAckRange(long lower, long upper) {
456: if (nack != null) {
457: throw new IllegalArgumentException(
458: Messages.BOTH_ACKS_AND_NACKS_MESSAGE.format());
459: }
460: //check validity of indices
461: if (lower > upper) {
462: throw new IllegalArgumentException(
463: Messages.UPPERBOUND_LESSTHAN_LOWERBOUND_MESSAGE
464: .format());
465: }
466:
467: //TODO Further validity checking
468: SequenceAcknowledgementElement.AcknowledgementRange range = new SequenceAcknowledgementElement.AcknowledgementRange();
469: range.setLower(BigInteger.valueOf(lower));
470: range.setUpper(BigInteger.valueOf(upper));
471: getAcknowledgementRange().add(range);
472:
473: }
474:
475: public void addNack(long index) {
476: if (acknowledgementRange != null) {
477: throw new IllegalArgumentException(
478: Messages.BOTH_ACKS_AND_NACKS_MESSAGE.format());
479: }
480:
481: getNack().add(BigInteger.valueOf(index));
482: }
483:
484: }
|