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

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


        highNumberCompleted = mn;
        wakeupAll();
    }
   
    void purgeAcknowledged(long messageNr) {
        RMStore store = destination.getManager().getStore();
        if (null == store) {
            return;
        }
        store.removeMessages(getIdentifier(), Collections.singleton(messageNr), false);
    }
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) {
            CachedOutputStream saved =
                (CachedOutputStream)message.get(RMMessageConstants.SAVED_CONTENT);
            RMMessage msg = new RMMessage();
            msg.setMessageNumber(sequenceType.getMessageNumber());
            msg.setContent(saved);
            store.persistIncoming(seq, msg);
        }

    }
View Full Code Here

                }
            }
            LOG.fine("Completed purging resend candidates.");
        }
        if (purged.size() > 0) {
            RMStore store = manager.getStore();
            if (null != store) {
                store.removeMessages(seq.getIdentifier(), purged, true);
            }
        }
    }
View Full Code Here

        assertNull(manager.getStore());
        assertNull(manager.getRetransmissionQueue());
        assertNotNull(manager.getTimer());

        Bus bus = control.createMock(Bus.class);
        RMStore store = control.createMock(RMStore.class);
        RetransmissionQueue queue = control.createMock(RetransmissionQueue.class);
       
        manager.setBus(bus);
        manager.setStore(store);
        manager.setRetransmissionQueue(queue);
View Full Code Here

        manager.recoverReliableEndpoint(endpoint, conduit, ProtocolVariation.RM10WSA200408);
        control.verify();
       
        control.reset();
       
        RMStore store = control.createMock(RMStore.class);
        manager.setStore(store);
      
        control.replay();
        manager.recoverReliableEndpoint(endpoint, conduit, ProtocolVariation.RM10WSA200408);
        control.verify();          
View Full Code Here

   
    void setUpRecoverReliableEndpoint(Endpoint endpoint,
                                      Conduit conduit,
                                      SourceSequence ss,
                                      DestinationSequence ds, RMMessage m)  {               
        RMStore store = control.createMock(RMStore.class);
        RetransmissionQueue queue = control.createMock(RetransmissionQueue.class);
        manager.setStore(store);
        manager.setRetransmissionQueue(queue);
       
        Collection<SourceSequence> sss = new ArrayList<SourceSequence>();
        if (null != ss) {
            sss.add(ss);           
        }
        EasyMock.expect(store.getSourceSequences("{S}s.{P}p", ProtocolVariation.RM10WSA200408))
            .andReturn(sss);
        if (null == ss) {
            return;
        }        
       
        Collection<DestinationSequence> dss = new ArrayList<DestinationSequence>();
        if (null != ds) {
            dss.add(ds);           
        }
        EasyMock.expect(store.getDestinationSequences("{S}s.{P}p", ProtocolVariation.RM10WSA200408))
            .andReturn(dss);
        if (null == ds) {
            return;
        }
        Collection<RMMessage> ms = new ArrayList<RMMessage>();
        if (null != m) {
            ms.add(m);
        }
        Identifier id = new Identifier();
        id.setValue("S1");
        EasyMock.expect(ss.getIdentifier()).andReturn(id).times(null == m ? 1 : 2);
        EasyMock.expect(store.getMessages(id, true)).andReturn(ms);
       
       
        manager.setEndpointMaps(new HashMap<ProtocolVariation, Map<Endpoint, RMEndpoint>>());
        RMEndpoint rme = control.createMock(RMEndpoint.class);
        EasyMock.expect(manager.createReliableEndpoint(endpoint, ProtocolVariation.RM10WSA200408))
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

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.