Package org.apache.cxf.ws.rm.persistence

Examples of org.apache.cxf.ws.rm.persistence.RMStore


            && acknowledgement.getAcknowledgementRange().get(0).getLower().equals(BigInteger.ONE)
            && acknowledgement.getAcknowledgementRange().get(0).getUpper().subtract(mn).signum() >= 0;
    }
   
    void purgeAcknowledged(BigInteger messageNr) {
        RMStore store = destination.getManager().getStore();
        if (null == store) {
            return;
        }
        Collection<BigInteger> messageNrs = new ArrayList<BigInteger>();
        messageNrs.add(messageNr);
        store.removeMessages(getIdentifier(), messageNrs, false);
    }
View Full Code Here


    public void testPurgeAcknowledged() {
        destination = control.createMock(Destination.class);
        DestinationSequence seq = new DestinationSequence(id, ref, destination);       
        manager = control.createMock(RMManager.class);
        EasyMock.expect(destination.getManager()).andReturn(manager);
        RMStore store = control.createMock(RMStore.class);
        EasyMock.expect(manager.getStore()).andReturn(store);
        store.removeMessages(EasyMock.eq(id),
            CastUtils.cast(EasyMock.isA(Collection.class), BigInteger.class), EasyMock.eq(false));
        EasyMock.expectLastCall();
        control.replay();
        seq.purgeAcknowledged(BigInteger.ONE);
        control.verify();
View Full Code Here

    void verifyStorePopulation() {
       
        RMManager manager = bus.getExtension(RMManager.class);
        assertNotNull(manager);
       
        RMStore store = manager.getStore();
        assertNotNull(store);
       
        Client client = ClientProxy.getClient(greeter);
        String id = RMUtils.getEndpointIdentifier(client.getEndpoint());
       
        Collection<DestinationSequence> dss =
            store.getDestinationSequences(id, ProtocolVariation.RM10WSA200408);
        assertEquals(1, dss.size());
       
        Collection<SourceSequence> sss =
            store.getSourceSequences(id, ProtocolVariation.RM10WSA200408);
        assertEquals(1, sss.size());
       
        Collection<RMMessage> msgs =
            store.getMessages(sss.iterator().next().getIdentifier(), true);
        assertEquals(2, msgs.size())
       
        msgs =
            store.getMessages(sss.iterator().next().getIdentifier(), false);
        assertEquals(0, msgs.size())
    }
View Full Code Here

    void verifyRecovery() throws Exception {
       
        RMManager manager = bus.getExtension(RMManager.class);
        assertNotNull(manager);
       
        RMStore store = manager.getStore();
        assertNotNull(store);
       
        Client client = ClientProxy.getClient(greeter);
        String id = RMUtils.getEndpointIdentifier(client.getEndpoint());
       
        Collection<DestinationSequence> dss =
            store.getDestinationSequences(id, ProtocolVariation.RM10WSA200408);
        assertEquals(1, dss.size());
       
        Collection<SourceSequence> sss =
            store.getSourceSequences(id, ProtocolVariation.RM10WSA200408);
        assertEquals(1, sss.size());
       
        int i = 0;
        while (store.getMessages(sss.iterator().next().getIdentifier(), true).size() > 0 && i < 10) {
            Thread.sleep(200);
            i++;
        }
      
        assertEquals(0, store.getMessages(sss.iterator().next().getIdentifier(), true).size());
        assertEquals(0, store.getMessages(sss.iterator().next().getIdentifier(), false).size());       
    }
View Full Code Here

    public void addSequence(DestinationSequence seq, boolean persist) {
        if (seq.getProtocol() == getReliableEndpoint().getProtocol()) {
            seq.setDestination(this);
            map.put(seq.getIdentifier().getValue(), seq);
            if (persist) {
                RMStore store = getReliableEndpoint().getManager().getStore();
                if (null != store) {
                    store.createDestinationSequence(seq);
                }
            }
        } else {
            LOG.log(Level.SEVERE, "Incompatible protocol version");
        }
View Full Code Here

        }
    }

    public void removeSequence(DestinationSequence seq) {
        map.remove(seq.getIdentifier().getValue());
        RMStore store = getReliableEndpoint().getManager().getStore();
        if (null != store) {
            store.removeDestinationSequence(seq.getIdentifier());
        }
    }
View Full Code Here

            RMConstants consts = getReliableEndpoint().getProtocol().getConstants();
            SequenceFaultFactory sff = new SequenceFaultFactory(consts);
            throw sff.createUnknownSequenceFault(sequenceType.getIdentifier());
        }

        RMStore store = getReliableEndpoint().getManager().getStore();
        if (null != store) {
            RMMessage msg = null;
            if (!MessageUtils.isTrue(message.getContextualProperty(Message.ROBUST_ONEWAY))) {
                msg = new RMMessage();
                msg.setContent((CachedOutputStream)message.get(RMMessageConstants.SAVED_CONTENT));
                msg.setMessageNumber(sequenceType.getMessageNumber());
            }
            store.persistIncoming(seq, msg);
        }

    }
View Full Code Here

    public void testPurgeAcknowledged() {
        destination = control.createMock(Destination.class);
        DestinationSequence seq = new DestinationSequence(id, ref, destination);       
        manager = control.createMock(RMManager.class);
        EasyMock.expect(destination.getManager()).andReturn(manager);
        RMStore store = control.createMock(RMStore.class);
        EasyMock.expect(manager.getStore()).andReturn(store);
        store.removeMessages(EasyMock.eq(id),
            CastUtils.cast(EasyMock.isA(Collection.class), BigInteger.class), EasyMock.eq(false));
        EasyMock.expectLastCall();
        control.replay();
        seq.purgeAcknowledged(BigInteger.ONE);
        control.verify();
View Full Code Here

    public void addSequence(SourceSequence seq, boolean persist) {
        if (seq.getProtocol() == getReliableEndpoint().getProtocol()) {
            seq.setSource(this);
            map.put(seq.getIdentifier().getValue(), seq);
            if (persist) {
                RMStore store = getReliableEndpoint().getManager().getStore();
                if (null != store) {
                    store.createSourceSequence(seq);
                }
            }
        } else {
            LOG.log(Level.SEVERE, "Incompatible protocol version");
        }
View Full Code Here

        }
    }
   
    public void removeSequence(SourceSequence seq) {       
        map.remove(seq.getIdentifier().getValue());
        RMStore store = getReliableEndpoint().getManager().getStore();
        if (null != store) {
            store.removeSourceSequence(seq.getIdentifier());
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.ws.rm.persistence.RMStore

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.