Package com.sun.xml.ws.rx.rm.runtime.sequence.Sequence

Examples of com.sun.xml.ws.rx.rm.runtime.sequence.Sequence.AckRange


        }

        AckRange.sort(ranges);

        // check proper bounds of acked ranges
        AckRange lastAckRange = ranges.get(ranges.size() - 1);
        if (data.getLastMessageNumber() < lastAckRange.upper) {
            throw new InvalidAcknowledgementException(this.getId(), lastAckRange.upper, ranges);
        }

        final Collection<Long> unackedMessageNumbers = data.getUnackedMessageNumbers();
        if (unackedMessageNumbers.isEmpty()) {
            // we have checked the ranges are ok and there's nothing to acknowledge.
            return;
        }

        // acknowledge messages
        Iterator<AckRange> rangeIterator = ranges.iterator();
        AckRange currentRange = rangeIterator.next();

        for (long unackedMessageNumber : unackedMessageNumbers) {
            if (unackedMessageNumber >= currentRange.lower && unackedMessageNumber <= currentRange.upper) {
                data.markAsAcknowledged(unackedMessageNumber);
            } else if (rangeIterator.hasNext()) {
View Full Code Here


    private boolean isDeliverable(ApplicationMessage message) {
        List<Sequence.AckRange> ackedIds = sequence.getAcknowledgedMessageNumbers();
        if (ackedIds.isEmpty()) {
            return message.getMessageNumber() == 1L; // this is a first message
        } else {
            AckRange firstRange = ackedIds.get(0);
            return (firstRange.lower != 1L) ? message.getMessageNumber() == 1L : message.getMessageNumber() == firstRange.upper + 1;
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.xml.ws.rx.rm.runtime.sequence.Sequence.AckRange

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.