Package org.objectweb.celtix.ws.rm.SequenceAcknowledgement

Examples of org.objectweb.celtix.ws.rm.SequenceAcknowledgement.AcknowledgementRange


        sid.setValue("sequence2");
        s2.setIdentifier(sid);
        s2.setMessageNumber(BigInteger.TEN);

        ack1 = factory.createSequenceAcknowledgement();
        AcknowledgementRange r = factory.createSequenceAcknowledgementAcknowledgementRange();
        r.setLower(BigInteger.ONE);
        r.setUpper(BigInteger.ONE);
        ack1.getAcknowledgementRange().add(r);
        ack1.setIdentifier(s1.getIdentifier());

        ack2 = factory.createSequenceAcknowledgement();
        r = factory.createSequenceAcknowledgementAcknowledgementRange();
        r.setLower(BigInteger.ONE);
        r.setUpper(BigInteger.TEN);
        ack2.getAcknowledgementRange().add(r);
        ack2.setIdentifier(s2.getIdentifier());

        ar1 = factory.createAckRequestedType();
        ar1.setIdentifier(s1.getIdentifier());
View Full Code Here


        if (!lastMessage) {
            return false;
        }

        if (acked.getAcknowledgementRange().size() == 1) {        
            AcknowledgementRange r = acked.getAcknowledgementRange().get(0);
            return r.getLower().equals(BigInteger.ONE) && r.getUpper().equals(currentMessageNumber);
        }
        return false;
    }
View Full Code Here

        monitor.acknowledgeMessage();
       
        boolean done = false;
        int i = 0;
        for (; i < acked.getAcknowledgementRange().size(); i++) {
            AcknowledgementRange r = acked.getAcknowledgementRange().get(i);
            if (r.getLower().compareTo(messageNumber) <= 0
                && r.getUpper().compareTo(messageNumber) >= 0) {
                done = true;
                break;
            } else {
                BigInteger diff = r.getLower().subtract(messageNumber);
                if (diff.signum() == 1) {
                    if (diff.equals(BigInteger.ONE)) {
                        r.setLower(messageNumber);
                        done = true;
                    }
                    break;
                } else if (messageNumber.subtract(r.getUpper()).equals(BigInteger.ONE)) {
                    r.setUpper(messageNumber);
                    done = true;
                    break;
                }
            }
        }

        if (!done) {
            AcknowledgementRange range = RMUtils.getWSRMFactory()
                .createSequenceAcknowledgementAcknowledgementRange();
            range.setLower(messageNumber);
            range.setUpper(messageNumber);
            acked.getAcknowledgementRange().add(i, range);
        }
              
        scheduleAcknowledgement();
    }
View Full Code Here

TOP

Related Classes of org.objectweb.celtix.ws.rm.SequenceAcknowledgement.AcknowledgementRange

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.