FileDocCategorySizeDatePackage
SequenceAcknowledgementElement.javaAPI DocExample9989Tue May 29 16:56:44 BST 2007com.sun.xml.ws.rm.protocol

SequenceAcknowledgementElement

public class SequenceAcknowledgementElement extends Object
Abstraction of the SequenceAcknowledgement WS-RM protocol element. Based on a JAXB schema compiler generated class that has properties for each child element of the SequenceAcknowledgement element. A property used to serialize/ deserialize the BufferRemaining extensibility element is added.

Fields Summary
protected Identifier
identifier
protected List
acknowledgementRange
protected List
nack
public Integer
bufferRemaining
protected List
any
private Map
otherAttributes
Constructors Summary
public SequenceAcknowledgementElement()



     

    
Methods Summary
public voidaddAckRange(long lower, long upper)

        if (nack != null) {
            throw new IllegalArgumentException(Messages.BOTH_ACKS_AND_NACKS_MESSAGE.format());
        }
        //check validity of indices
        if (lower > upper) {
            throw new IllegalArgumentException(Messages.UPPERBOUND_LESSTHAN_LOWERBOUND_MESSAGE.format());
        }

        //TODO Further validity checking
        SequenceAcknowledgementElement.AcknowledgementRange range
                = new SequenceAcknowledgementElement.AcknowledgementRange();
        range.setLower(BigInteger.valueOf(lower));
        range.setUpper(BigInteger.valueOf(upper));
        getAcknowledgementRange().add(range);

    
public voidaddNack(long index)

        if (acknowledgementRange != null) {
            throw new IllegalArgumentException(Messages.BOTH_ACKS_AND_NACKS_MESSAGE.format());
        }

        getNack().add(BigInteger.valueOf(index));
    
public java.util.ListgetAcknowledgementRange()
Gets the value of the acknowledgementRange property.

return
The value of the property, which is a list of AcknowledgementRange objects

        if (acknowledgementRange == null) {
            acknowledgementRange = new ArrayList<SequenceAcknowledgementElement.AcknowledgementRange>();
        }
        return this.acknowledgementRange;
    
public java.util.ListgetAny()
Gets the value of the any property representing extensibility elements

return
The list of elements.

        if (any == null) {
            any = new ArrayList<Object>();
        }
        return this.any;
    
public intgetBufferRemaining()

        if (bufferRemaining == null) {
            return -1;
        }
        return bufferRemaining;
    
public java.lang.StringgetId()

        return getIdentifier().getValue();
    
public IdentifiergetIdentifier()
Gets the value of the identifier property.

return
The value of the property.

        return identifier;
    
public java.util.ListgetNack()
Gets the value of the nack property.

return
The value of the property, which is a list of BigIntegers

        if (nack == null) {
            nack = new ArrayList<BigInteger>();
        }
        return this.nack;
    
public java.util.MapgetOtherAttributes()
Gets a map that contains attributes that aren't bound to any typed property on this class.

return
The value of the property

        return otherAttributes;
    
public voidsetBufferRemaining(int value)

        bufferRemaining = value;
    
public voidsetId(java.lang.String id)

        Identifier identifier = new Identifier();
        identifier.setValue(id);
        setIdentifier(identifier);
    
public voidsetIdentifier(Identifier value)
Sets the value of the identifier property.

param
value The new value of the property.

        this.identifier = value;
    
public java.lang.StringtoString()

       
        String ret = Messages.SEQUENCE_ACKNOWLEDGEMENT_TOSTRING_STRING.format(getId(), getBufferRemaining());
        List<AcknowledgementRange> ranges = getAcknowledgementRange();
        if (ranges != null) {
            for (AcknowledgementRange range: ranges) {
                ret += "\t\t" + range.toString() + "\n";
            }
        }
        return ret;