Package org.objectweb.celtix.ws.rm

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


                Identifier sid = RMUtils.getWSRMFactory().createIdentifier();               
                sid.setValue(res.getString(1));
                EndpointReferenceType acksTo = RMUtils.createReference(res.getString(2))
                BigDecimal lm = res.getBigDecimal(3);
                InputStream is = res.getBinaryStream(4);
                SequenceAcknowledgement ack = null;
                if (null != is) {
                    ack = RMUtils.getPersistenceUtils().getSequenceAcknowledgment(is);
                }
                DestinationSequence seq = new DestinationSequence(sid, acksTo,
                                                                  lm == null ? null : lm.toBigInteger(), ack);
View Full Code Here


                                                            headerElement,
                                                            unmarshaller);
                           
                            rmps.setSequence(s);
                        } else if (Names.WSRM_SEQUENCE_ACK_NAME.equals(localName)) {
                            SequenceAcknowledgement ack = decodeProperty(SequenceAcknowledgement.class,
                                                            headerElement,
                                                            unmarshaller);
                            acks.add(ack);                           
                        } else if (Names.WSRM_ACK_REQUESTED_NAME.equals(localName)) {
                            AckRequestedType ar = decodeProperty(AckRequestedType.class,
View Full Code Here

    public void testAddAck() {
        RMPropertiesImpl rmps = new RMPropertiesImpl();
        IMocksControl control = createNiceControl();
       
        DestinationSequence seq = control.createMock(DestinationSequence.class);
        SequenceAcknowledgement ack = control.createMock(SequenceAcknowledgement.class);
        seq.getAcknowledgment();
        expectLastCall().andReturn(ack);
       
        DestinationSequence otherSeq = control.createMock(DestinationSequence.class);
        SequenceAcknowledgement otherAck = control.createMock(SequenceAcknowledgement.class);
        otherSeq.getAcknowledgment();
        expectLastCall().andReturn(otherAck);
       
        control.replay();
       
View Full Code Here

        Identifier sid2 = s.generateSequenceIdentifier();
        SourceSequence seq = new SourceSequence(sid1, null, null, BigInteger.TEN, true);
        seq.setSource(s);
        s.addSequence(seq);
              
        SequenceAcknowledgement ack = RMUtils.getWSRMFactory().createSequenceAcknowledgement();
        ack.setIdentifier(sid1);       
        s.setAcknowledged(ack);
        assertSame(ack, seq.getAcknowledgement());
        ack.setIdentifier(sid2);
        s.setAcknowledged(ack);
       
        control.verify();
       
        control.reset();
  
        ack = RMUtils.getWSRMFactory().createSequenceAcknowledgement();
        ack.setIdentifier(sid1);
        AcknowledgementRange range =
            RMUtils.getWSRMFactory().createSequenceAcknowledgementAcknowledgementRange();

        range.setLower(BigInteger.ONE);
        range.setUpper(BigInteger.TEN);
        ack.getAcknowledgementRange().add(range);
       
        RMProxy proxy = control.createMock(RMProxy.class);   
        handler.getProxy();
        expectLastCall().andReturn(proxy);
        proxy.terminateSequence(seq);
View Full Code Here

        assertNull(seq.getLastMessageNr());
        assertSame(ref, seq.getAcksTo());
        assertNotNull(seq.getAcknowledgment());
        assertNotNull(seq.getMonitor());  
       
        SequenceAcknowledgement ack = RMUtils.getWSRMFactory().createSequenceAcknowledgement();       
        seq = new DestinationSequence(id, ref, BigInteger.TEN, ack);
        assertEquals(id, seq.getIdentifier());
        assertEquals(BigInteger.TEN, seq.getLastMessageNr());
        assertSame(ref, seq.getAcksTo());
        assertSame(ack, seq.getAcknowledgment());
View Full Code Here

        Identifier sid = RMUtils.getWSRMFactory().createIdentifier();
        sid.setValue(s);
        EndpointReferenceType epr = RMUtils.createReference(Names.WSA_ANONYMOUS_ADDRESS);
       
           
        SequenceAcknowledgement ack = RMUtils.getWSRMFactory().createSequenceAcknowledgement();
        AcknowledgementRange range =
            RMUtils.getWSRMFactory().createSequenceAcknowledgementAcknowledgementRange();
        range.setLower(BigInteger.ONE);
        range.setUpper(BigInteger.ONE);
        ack.getAcknowledgementRange().add(range);
        BigInteger lmn = null;
       
        if ("sequence2".equals(s)) {
            range =
                RMUtils.getWSRMFactory().createSequenceAcknowledgementAcknowledgementRange();
            range.setLower(new BigInteger("3"));
            range.setUpper(BigInteger.TEN);
            ack.getAcknowledgementRange().add(range);
            lmn = BigInteger.TEN;
        }
       
        EasyMock.expect(seq.getIdentifier()).andReturn(sid);
        EasyMock.expect(seq.getAcksTo()).andReturn(epr);
View Full Code Here

        assertTrue(!seq.equals(this));
    }
   
    public void testSetAcknowledged() {
        SourceSequence seq = new SourceSequence(id);
        SequenceAcknowledgement ack = seq.getAcknowledgement();
        ack = RMUtils.getWSRMFactory().createSequenceAcknowledgement();
        AcknowledgementRange r = RMUtils.getWSRMFactory().createSequenceAcknowledgementAcknowledgementRange();
        r.setLower(new BigInteger("1"));
        r.setUpper(new BigInteger("2"));
        ack.getAcknowledgementRange().add(r);
        r = RMUtils.getWSRMFactory().createSequenceAcknowledgementAcknowledgementRange();
        r.setLower(new BigInteger("4"));
        r.setUpper(new BigInteger("6"));
        ack.getAcknowledgementRange().add(r);
        r = RMUtils.getWSRMFactory().createSequenceAcknowledgementAcknowledgementRange();
        r.setLower(new BigInteger("8"));
        r.setUpper(new BigInteger("10"));
        ack.getAcknowledgementRange().add(r);
        seq.setAcknowledged(ack);
        assertSame(ack, seq.getAcknowledgement());
        assertEquals(3, ack.getAcknowledgementRange().size());
        assertTrue(!seq.isAcknowledged(new BigInteger("3")))
    }
View Full Code Here

        SourceSequence seq = new SourceSequence(id, null, null, new BigInteger("4"), false);       
       
        assertTrue(!seq.allAcknowledged());
        seq.setLastMessage(true);
        assertTrue(!seq.allAcknowledged());
        SequenceAcknowledgement ack = RMUtils.getWSRMFactory().createSequenceAcknowledgement();
        AcknowledgementRange r = RMUtils.getWSRMFactory().createSequenceAcknowledgementAcknowledgementRange();
        r.setLower(BigInteger.ONE);
        r.setUpper(new BigInteger("2"));
        ack.getAcknowledgementRange().add(r);
        seq.setAcknowledged(ack);
        assertTrue(!seq.allAcknowledged());
        r.setUpper(new BigInteger("4"));
        assertTrue(seq.allAcknowledged());
    }
View Full Code Here

    }
   
    // this method cannot be private because of a bug in PMD which otherwise
    // would report it as an 'unused private method'
    protected void acknowledge(SourceSequence seq, int... messageNumbers) {
        SequenceAcknowledgement ack = factory.createSequenceAcknowledgement();
        int i = 0;
        while (i < messageNumbers.length) {
            AcknowledgementRange r = factory.createSequenceAcknowledgementAcknowledgementRange();
            Integer li = new Integer(messageNumbers[i]);
            BigInteger l = new BigInteger(li.toString());
            r.setLower(l);
            i++;
           
            while (i < messageNumbers.length && (messageNumbers[i] - messageNumbers[i - 1]) == 1) {
                i++;
            }
            Integer ui = new Integer(messageNumbers[i - 1]);
            BigInteger u = new BigInteger(ui.toString());
            r.setUpper(u);
            ack.getAcknowledgementRange().add(r);
        }
        seq.setAcknowledged(ack);
    }
View Full Code Here

        assertTrue(codec.handleMessage(context));
        RMProperties rmps = RMContextUtils.retrieveRMProperties(context, false);
        Collection<SequenceAcknowledgement> acks = rmps.getAcks();
        assertNotNull(acks);
        assertEquals(1, acks.size());
        SequenceAcknowledgement ack = acks.iterator().next();
        assertNotNull(ack);
        assertEquals(ack.getIdentifier().getValue(), SEQ_IDENTIFIER);
        assertEquals(2, ack.getAcknowledgementRange().size());
        assertNull(rmps.getSequence());
        assertNull(rmps.getAcksRequested());
    }
View Full Code Here

TOP

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

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.