Package org.xmlsoap.schemas.ws._2003._03.addressing

Examples of org.xmlsoap.schemas.ws._2003._03.addressing.AttributedURI


    protected boolean specifyExpires = false;

    public void testCreateAndTerminateSequence() throws Exception {
        CreateSequenceType createArguments = new CreateSequenceType();

        EndpointReferenceType reference = new EndpointReferenceType();
        reference.setAddress(new AttributedURI());
        reference.getAddress().setValue("http://localhost/test/" + getClass().getName() + "/" + getName());
        createArguments.setAcksTo(reference);

        if (specifyExpires) {
            Expires expires = new Expires();
            createArguments.setExpires(expires);
View Full Code Here


        if (specifyExpires) {
            Expires expires = new Expires();
            createArguments.setExpires(expires);
        }

        CreateSequenceResponseType response = sequenceManager.createSequence(createArguments);
        Identifier identifier = response.getIdentifier();
        String value = identifier.getValue();
        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

        if (createSequence.getExpires() != null) {
            s.expires = convertToLocalTime(createSequence.getExpires());
        }
        sequenceStore.create(s);

        CreateSequenceResponseType response = new CreateSequenceResponseType();
        response.setIdentifier(s.getIdentifier());
        if (s.expires != 0) {
            response.setExpires(convertToDuration(s.expires));
        }
        return response;
    }
View Full Code Here

public class SequenceManagerTest extends TestCase {
    protected SequenceAbsractPortType sequenceManager;
    protected boolean specifyExpires = false;

    public void testCreateAndTerminateSequence() throws Exception {
        CreateSequenceType createArguments = new CreateSequenceType();

        EndpointReferenceType reference = new EndpointReferenceType();
        reference.setAddress(new AttributedURI());
        reference.getAddress().setValue("http://localhost/test/" + getClass().getName() + "/" + getName());
        createArguments.setAcksTo(reference);

        if (specifyExpires) {
            Expires expires = new Expires();
            createArguments.setExpires(expires);
        }

        CreateSequenceResponseType response = sequenceManager.createSequence(createArguments);
        Identifier identifier = response.getIdentifier();
        String value = identifier.getValue();
View Full Code Here

        reference.setAddress(new AttributedURI());
        reference.getAddress().setValue("http://localhost/test/" + getClass().getName() + "/" + getName());
        createArguments.setAcksTo(reference);

        if (specifyExpires) {
            Expires expires = new Expires();
            createArguments.setExpires(expires);
        }

        CreateSequenceResponseType response = sequenceManager.createSequence(createArguments);
        Identifier identifier = response.getIdentifier();
View Full Code Here

            Expires expires = new Expires();
            createArguments.setExpires(expires);
        }

        CreateSequenceResponseType response = sequenceManager.createSequence(createArguments);
        Identifier identifier = response.getIdentifier();
        String value = identifier.getValue();
        assertNotNull("Should have an identifier", value);
       
        System.out.println("Created identifier: " + value);
        System.out.println("Accept: " + response.getAccept());
       
View Full Code Here

    private final IdGenerator idGenerator = new IdGenerator();
    private final ConcurrentHashMap sequences = new ConcurrentHashMap();
   
    public void create(Sequence s) {
        String id = idGenerator.generateId();
        Identifier identifier = new Identifier();
        identifier.setValue(id);
        s.setIdentifier(identifier);
        sequences.put(id,s);
    }
View Full Code Here

    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

TOP

Related Classes of org.xmlsoap.schemas.ws._2003._03.addressing.AttributedURI

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.