Package org.xmlsoap.schemas.ws.x2004.x03.rm

Examples of org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument$SequenceAcknowledgement$AcknowledgementRange


     * @param exposed (non-<code>null</code>)
     * @return converted
     */
    public static SequenceAcknowledgement
    convert(org.apache.cxf.ws.rm.v200502wsa15.SequenceAcknowledgement exposed) {
        SequenceAcknowledgement internal = new SequenceAcknowledgement();
        internal.setIdentifier(convert(exposed.getIdentifier()));
        List<SequenceAcknowledgement.AcknowledgementRange> internalRanges
            = internal.getAcknowledgementRange();
        for (org.apache.cxf.ws.rm.v200502wsa15.SequenceAcknowledgement.AcknowledgementRange range
            : exposed.getAcknowledgementRange()) {
            SequenceAcknowledgement.AcknowledgementRange internalRange
                = new SequenceAcknowledgement.AcknowledgementRange();
            internalRange.setLower(range.getLower());
            internalRange.setUpper(range.getUpper());
            internalRanges.add(internalRange);
            putAll(range.getOtherAttributes(), internalRange.getOtherAttributes());
        }
        addAll(exposed.getAny(), internal.getAny());
        putAll(exposed.getOtherAttributes(), internal.getOtherAttributes());
        return internal;
    }
View Full Code Here


        EasyMock.expect(manager.getDeliveryAssurance()).andReturn(da).anyTimes();
        EasyMock.expect(da.isSetAtMostOnce()).andReturn(false).anyTimes();
        EasyMock.expect(da.isSetAtLeastOnce()).andReturn(true).anyTimes();
        EasyMock.expect(da.isSetInOrder()).andReturn(true).anyTimes();
       
        SequenceAcknowledgement ack = factory.createSequenceAcknowledgement();
        List<AcknowledgementRange> ranges = new ArrayList<AcknowledgementRange>();
       
        final AcknowledgementRange r =
            factory.createSequenceAcknowledgementAcknowledgementRange();
        r.setUpper(new Long(messages.length));
View Full Code Here

     * @param exposed (non-<code>null</code>)
     * @return converted
     */
    public static SequenceAcknowledgement
    convert(org.apache.cxf.ws.rm.v200502.SequenceAcknowledgement exposed) {
        SequenceAcknowledgement internal = new SequenceAcknowledgement();
        internal.setIdentifier(convert(exposed.getIdentifier()));
        List<SequenceAcknowledgement.AcknowledgementRange> internalRanges
            = internal.getAcknowledgementRange();
        for (org.apache.cxf.ws.rm.v200502.SequenceAcknowledgement.AcknowledgementRange range
            : exposed.getAcknowledgementRange()) {
            SequenceAcknowledgement.AcknowledgementRange internalRange
                = new SequenceAcknowledgement.AcknowledgementRange();
            internalRange.setLower(range.getLower());
            internalRange.setUpper(range.getUpper());
            internalRanges.add(internalRange);
            putAll(range.getOtherAttributes(), internalRange.getOtherAttributes());
        }
        addAll(exposed.getAny(), internal.getAny());
        putAll(exposed.getOtherAttributes(), internal.getOtherAttributes());
        return internal;
    }
View Full Code Here

        offeringId = oi;

        currentMessageNumber = cmn;
        lastMessage = lm;
        acknowledgement = new SequenceAcknowledgement();
        acknowledgement.setIdentifier(id);
    }
View Full Code Here

   
    public void addAck(DestinationSequence seq) {
        if (null == acks) {
            acks = new ArrayList<SequenceAcknowledgement>();
        }
        SequenceAcknowledgement ack = seq.getAcknowledgment();
        acks.add(ack);
        seq.acknowledgmentSent();
    }
View Full Code Here

        manager = control.createMock(RMManager.class);
        Source source = control.createMock(Source.class);
        rme = control.createMock(RMEndpoint.class);
        EasyMock.expect(rme.getSource()).andReturn(source).anyTimes();
        interceptor.setManager(manager);
        SequenceAcknowledgement ack1 = control.createMock(SequenceAcknowledgement.class);
        SequenceAcknowledgement ack2 = control.createMock(SequenceAcknowledgement.class);
        Collection<SequenceAcknowledgement> acks = new ArrayList<SequenceAcknowledgement>();
        acks.add(ack1);
        acks.add(ack2);
        EasyMock.expect(rmps.getAcks()).andReturn(acks);
        Identifier id1 = control.createMock(Identifier.class);
        EasyMock.expect(ack1.getIdentifier()).andReturn(id1);
        SourceSequence ss1 = control.createMock(SourceSequence.class);
        EasyMock.expect(source.getSequence(id1)).andReturn(ss1);
        ss1.setAcknowledged(ack1);
        EasyMock.expectLastCall();
        Identifier id2 = control.createMock(Identifier.class);
        EasyMock.expect(ack2.getIdentifier()).andReturn(id2);
        EasyMock.expect(source.getSequence(id2)).andReturn(null);
        control.replay();
        try {
            interceptor.processAcknowledgments(rme, rmps, ProtocolVariation.RM10WSA200408);
            fail("Expected SequenceFault not thrown");
View Full Code Here

    public void testSetAcknowledged() throws RMException {
        SourceSequence seq = new SourceSequence(id, ProtocolVariation.RM10WSA200408);
        setUpSource();
        seq.setSource(source);
       
        SequenceAcknowledgement ack = seq.getAcknowledgement();
        ack = factory.createSequenceAcknowledgement();
        SequenceAcknowledgement.AcknowledgementRange r =
            factory.createSequenceAcknowledgementAcknowledgementRange();
        r.setLower(new Long(1));
        r.setUpper(new Long(2));
        ack.getAcknowledgementRange().add(r);
        r = factory.createSequenceAcknowledgementAcknowledgementRange();
        r.setLower(new Long(4));
        r.setUpper(new Long(6));
        ack.getAcknowledgementRange().add(r);
        r = factory.createSequenceAcknowledgementAcknowledgementRange();
        r.setLower(new Long(8));
        r.setUpper(new Long(10));
        ack.getAcknowledgementRange().add(r);
        rq.purgeAcknowledged(seq);
        EasyMock.expectLastCall();
       
        control.replay();
        seq.setAcknowledged(ack);
        assertSame(ack, seq.getAcknowledgement());
        assertEquals(3, ack.getAcknowledgementRange().size());
        assertTrue(!seq.isAcknowledged(3))
        assertTrue(seq.isAcknowledged(5));
        control.verify();
    }
View Full Code Here

        seq.setSource(source);
       
        assertTrue(!seq.allAcknowledged());
        seq.setLastMessage(true);
        assertTrue(!seq.allAcknowledged());
        SequenceAcknowledgement ack = factory.createSequenceAcknowledgement();
        SequenceAcknowledgement.AcknowledgementRange r =
            factory.createSequenceAcknowledgementAcknowledgementRange();
        r.setLower(new Long(1));
        r.setUpper(new Long(2));
        ack.getAcknowledgementRange().add(r);
        rq.purgeAcknowledged(seq);
        EasyMock.expectLastCall();
       
        control.replay();
        seq.setAcknowledged(ack);
View Full Code Here

        }
        return seq.isLastMessage();
    }
   
    protected void acknowledge(SourceSequence seq, int... messageNumbers) throws RMException {
        SequenceAcknowledgement ack = factory.createSequenceAcknowledgement();
        int i = 0;
        while (i < messageNumbers.length) {
            SequenceAcknowledgement.AcknowledgementRange r =
                factory.createSequenceAcknowledgementAcknowledgementRange();
            Long l = new Long(messageNumbers[i]);
            r.setLower(l);
            i++;
           
            while (i < messageNumbers.length && (messageNumbers[i] - messageNumbers[i - 1]) == 1) {
                i++;
            }
            Long u = new Long(messageNumbers[i - 1]);
            r.setUpper(u);
            ack.getAcknowledgementRange().add(r);
        }
        seq.setAcknowledged(ack);
    }
View Full Code Here

    private static SequenceAcknowledgement ack2;
   
    protected IMocksControl control;
   
    public static void setUpOnce() {
        ack1 = new SequenceAcknowledgement();
        SequenceAcknowledgement.AcknowledgementRange range =
            new SequenceAcknowledgement.AcknowledgementRange();
       
        range.setLower(ONE);
        range.setUpper(ONE);
        ack1.getAcknowledgementRange().add(range);
       
        ack2 = new SequenceAcknowledgement();
        range = new SequenceAcknowledgement.AcknowledgementRange();
        range.setLower(ONE);
        range.setUpper(ONE);
        ack2.getAcknowledgementRange().add(range);
        range = new SequenceAcknowledgement.AcknowledgementRange();
View Full Code Here

TOP

Related Classes of org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument$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.