Package org.xmlsoap.schemas.ws._2005._02.rm.SequenceAcknowledgement

Examples of org.xmlsoap.schemas.ws._2005._02.rm.SequenceAcknowledgement.AcknowledgementRange


    public SequenceManager(SequenceStore store) {
        sequenceStore = store;
    }

    public SequenceAcknowledgement assertValid(SequenceType sequence) {
        Identifier identifier = sequence.getIdentifier();
        Sequence s = sequenceStore.retrieve(identifier);

        if (s == null) {
            throw new SoapFault("The value of wsrm:Identifier is not a known Sequence identifier", "Sender",
                    "wsrm:UnknownSequence", identifier.toString());
        }

        // Is the message number out of range?
        BigInteger value = sequence.getMessageNumber();
        if (value.compareTo(BigInteger.ZERO) <= 0 || value.compareTo(MAX_INTEGER) > 0) {

            // We must terminate the sequence now.
            sequenceStore.delete(identifier);

            throw new SoapFault("The maximum value for wsrm:MessageNumber has been exceeded", "Sender",
                    "wsrm:MessageNumberRollover", identifier.toString());
        }

        int intValue = value.intValue();

        // If we received the last message, then check to see if the message
        // being
        // processed exceeds it's sequence.
        if (s.lastMessageNumber > 0 && intValue > s.lastMessageNumber) {
            throw new SoapFault(
                    "The value for wsrm:MessageNumber exceeds the value of the MessageNumber  accompanying a LastMessage element in this Sequence.",
                    "Sender", "wsrm:LastMessageNumberExceeded", identifier.toString());
        }

        // Is this message comming out of order??
        if (intValue != s.lastMessageAcked + 1) {
            // This implementation is really simple and just drops out of order
View Full Code Here


        return null;
    }

    public SequenceAcknowledgement acknowledge(SequenceType sequence) {
        Identifier identifier = sequence.getIdentifier();

        // We might need something like a retrieve for update so that
        // we can lock this record across a cluster
        Sequence s = sequenceStore.retrieve(identifier);
View Full Code Here

        acknowledgement.getAcknowledgementRange().add(range);
        return acknowledgement;
    }

    public SequenceAcknowledgement acknowledgeRequested(AckRequestedType sequence) {
        Identifier identifier = sequence.getIdentifier();
        Sequence s = sequenceStore.retrieve(identifier);

        if (s == null) {
            throw new SoapFault("The value of wsrm:Identifier is not a known Sequence identifier", "Sender",
                    "wsrm:UnknownSequence", sequence.getIdentifier().toString());
View Full Code Here

        // Is this message comming out of order??
        if (intValue != s.lastMessageAcked + 1) {
            // This implementation is really simple and just drops out of order
            // messages.

            SequenceAcknowledgement acknowledgement = new SequenceAcknowledgement();
            acknowledgement.setIdentifier(identifier);
            if (s.lastMessageAcked > 0) {
                AcknowledgementRange range = new AcknowledgementRange();
                range.setLower(BigInteger.ONE);
                range.setUpper(new BigInteger("" + s.lastMessageAcked));
                acknowledgement.getAcknowledgementRange().add(range);
            }
            return acknowledgement;
        }

        return null;
View Full Code Here

            s.lastMessageNumber = value;
        }

        sequenceStore.update(s);

        SequenceAcknowledgement acknowledgement = new SequenceAcknowledgement();
        acknowledgement.setIdentifier(sequence.getIdentifier());
        AcknowledgementRange range = new AcknowledgementRange();
        range.setLower(BigInteger.ONE);
        range.setUpper(new BigInteger("" + s.lastMessageAcked));
        acknowledgement.getAcknowledgementRange().add(range);
        return acknowledgement;
    }
View Full Code Here

        if (s == null) {
            throw new SoapFault("The value of wsrm:Identifier is not a known Sequence identifier", "Sender",
                    "wsrm:UnknownSequence", sequence.getIdentifier().toString());
        }

        SequenceAcknowledgement acknowledgement = new SequenceAcknowledgement();
        acknowledgement.setIdentifier(sequence.getIdentifier());
        if (s.lastMessageAcked > 0) {
            AcknowledgementRange range = new AcknowledgementRange();
            range.setLower(BigInteger.ONE);
            range.setUpper(new BigInteger("" + s.lastMessageAcked));
            acknowledgement.getAcknowledgementRange().add(range);
        }
        return acknowledgement;
    }
View Full Code Here

            // messages.

            SequenceAcknowledgement acknowledgement = new SequenceAcknowledgement();
            acknowledgement.setIdentifier(identifier);
            if (s.lastMessageAcked > 0) {
                AcknowledgementRange range = new AcknowledgementRange();
                range.setLower(BigInteger.ONE);
                range.setUpper(new BigInteger("" + s.lastMessageAcked));
                acknowledgement.getAcknowledgementRange().add(range);
            }
            return acknowledgement;
        }
View Full Code Here

        sequenceStore.update(s);

        SequenceAcknowledgement acknowledgement = new SequenceAcknowledgement();
        acknowledgement.setIdentifier(sequence.getIdentifier());
        AcknowledgementRange range = new AcknowledgementRange();
        range.setLower(BigInteger.ONE);
        range.setUpper(new BigInteger("" + s.lastMessageAcked));
        acknowledgement.getAcknowledgementRange().add(range);
        return acknowledgement;
    }
View Full Code Here

        }

        SequenceAcknowledgement acknowledgement = new SequenceAcknowledgement();
        acknowledgement.setIdentifier(sequence.getIdentifier());
        if (s.lastMessageAcked > 0) {
            AcknowledgementRange range = new AcknowledgementRange();
            range.setLower(BigInteger.ONE);
            range.setUpper(new BigInteger("" + s.lastMessageAcked));
            acknowledgement.getAcknowledgementRange().add(range);
        }
        return acknowledgement;
    }
View Full Code Here

        assertNotNull("Should have an identifier", value);
       
        System.out.println("Created identifier: " + value);
        System.out.println("Accept: " + response.getAccept());
       
        TerminateSequenceType terminateArgs = new TerminateSequenceType();
        terminateArgs.setIdentifier(identifier);
        sequenceManager.terminateSequence(terminateArgs);
    }
View Full Code Here

TOP

Related Classes of org.xmlsoap.schemas.ws._2005._02.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.