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

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


                res = stmt.executeQuery();
                while (res.next()) {
                    long mn = res.getLong(1);
                    String to = res.getString(2);
                    Blob blob = res.getBlob(3);
                    RMMessage msg = new RMMessage();
                    msg.setMessageNumber(mn);
                    msg.setTo(to);
                    msg.setContent(blob.getBinaryStream());
                    msgs.add(msg);
                }
            }
        } catch (Exception ex) {
            LOG.log(Level.WARNING, new Message(outbound ? "SELECT_OUTBOUND_MSGS_FAILED_MSG"
View Full Code Here


                ResultSet res = stmt.executeQuery();
                while (res.next()) {
                    long mn = res.getLong(1);
                    String to = res.getString(2);
                    Blob blob = res.getBlob(3);
                    RMMessage msg = new RMMessage();
                    msg.setMessageNumber(mn);
                    msg.setTo(to);
                    msg.setContent(blob.getBinaryStream());
                    msgs.add(msg);
                }
            }
        } catch (Exception ex) {
            LOG.log(Level.WARNING, new Message(outbound ? "SELECT_OUTBOUND_MSGS_FAILED_MSG"
View Full Code Here

        manager.recoverReliableEndpoint(endpoint, conduit);
        control.verify();
       
        control.reset();
        setUpEndpointForRecovery(endpoint, ei, si, bi, ii)
        RMMessage m = control.createMock(RMMessage.class);
        Capture<Message> mc = new Capture<Message>();
        setUpRecoverReliableEndpoint(endpoint, conduit, ss, ds, m, mc);       
        control.replay();
        manager.recoverReliableEndpoint(endpoint, conduit);
        control.verify();
View Full Code Here

            mergeRanges();
        }

        RMStore store = destination.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(st.getMessageNumber());
            }
            store.persistIncoming(this, msg);
        }
       
        RMEndpoint reliableEndpoint = destination.getReliableEndpoint();
View Full Code Here

            try {
                Source s = manager.getSource(message);
                RMProperties rmps = RMContextUtils.retrieveRMProperties(message, true);
                Identifier sid = rmps.getSequence().getIdentifier();
                SourceSequence ss = s.getSequence(sid);
                RMMessage msg = new RMMessage();
                msg.setMessageNumber(rmps.getSequence().getMessageNumber());
                if (!MessageUtils.isRequestor(message)) {
                    AddressingProperties maps = RMContextUtils.retrieveMAPs(message, false, true);
                    if (null != maps && null != maps.getTo()) {
                        msg.setTo(maps.getTo().getValue());
                    }
                }
                msg.setContent(saved);
                store.persistOutgoing(ss, msg);
            } catch (RMException e) {
                // ignore
            }
        }
View Full Code Here

        store.removeDestinationSequence(sid2);       
    }
   
    @Test
    public void testCreateDeleteMessages() throws IOException, SQLException  {
        RMMessage msg1 = control.createMock(RMMessage.class);
        RMMessage msg2 = control.createMock(RMMessage.class);
        Identifier sid1 = new Identifier();
        sid1.setValue("sequence1");
        EasyMock.expect(msg1.getMessageNumber()).andReturn(ONE);
        EasyMock.expect(msg2.getMessageNumber()).andReturn(ONE);
        byte[] bytes = new byte[89];
        EasyMock.expect(msg1.getInputStream()).andReturn(new ByteArrayInputStream(bytes));
        EasyMock.expect(msg1.getSize()).andReturn((long)bytes.length);
        EasyMock.expect(msg2.getInputStream()).andReturn(new ByteArrayInputStream(bytes));
        EasyMock.expect(msg2.getSize()).andReturn((long)bytes.length);
       
        control.replay();
        store.beginTransaction();
        store.storeMessage(sid1, msg1, true);
        store.storeMessage(sid1, msg2, false);
        store.commit();
        control.verify();
       
        control.reset();
        EasyMock.expect(msg1.getMessageNumber()).andReturn(ONE);
        EasyMock.expect(msg1.getInputStream()).andReturn(new ByteArrayInputStream(bytes));
        EasyMock.expect(msg1.getSize()).andReturn((long)bytes.length);
       
        control.replay();
        store.beginTransaction();
        try {
            store.storeMessage(sid1, msg1, true);
        } catch (SQLException ex) {
            assertEquals("23505", ex.getSQLState());
        }
        store.abort();
        control.verify();
       
        control.reset();
        EasyMock.expect(msg1.getMessageNumber()).andReturn(TEN);
        EasyMock.expect(msg2.getMessageNumber()).andReturn(TEN);
        EasyMock.expect(msg1.getInputStream()).andReturn(new ByteArrayInputStream(bytes));
        EasyMock.expect(msg1.getSize()).andReturn((long)bytes.length);
        EasyMock.expect(msg2.getInputStream()).andReturn(new ByteArrayInputStream(bytes));
        EasyMock.expect(msg2.getSize()).andReturn((long)bytes.length);
       
        control.replay();
        store.beginTransaction();
        store.storeMessage(sid1, msg1, true);
        store.storeMessage(sid1, msg2, false);
View Full Code Here

        }
    }
   
    private void setupMessage(Identifier sid, Long mn, String to, boolean outbound)
        throws IOException, SQLException  {
        RMMessage msg = createRMMessage(mn, to);
       
        control.replay();
        store.beginTransaction();
        store.storeMessage(sid, msg, outbound);       
        store.commit();
View Full Code Here

        control.reset();
    }

    private void setupOutboundMessage(SourceSequence seq, long mn, String to)
        throws IOException, SQLException  {
        RMMessage msg = createRMMessage(ONE, to);
        control.replay();
        store.persistOutgoing(seq, msg);
        control.reset();
    }
View Full Code Here

        control.reset();
    }

    private void setupInboundMessage(DestinationSequence seq, long mn, String to)
        throws IOException, SQLException  {
        RMMessage msg = createRMMessage(ONE, to);
        control.replay();
        store.persistIncoming(seq, msg);
        control.reset();
    }
View Full Code Here

        store.persistIncoming(seq, msg);
        control.reset();
    }
   
    private RMMessage createRMMessage(Long mn, String to) throws IOException {
        RMMessage msg = control.createMock(RMMessage.class);
        EasyMock.expect(msg.getMessageNumber()).andReturn(mn);
        EasyMock.expect(msg.getTo()).andReturn(to);
        byte[] value = ("Message " + mn.longValue()).getBytes();
        EasyMock.expect(msg.getInputStream()).andReturn(new ByteArrayInputStream(value));
        EasyMock.expect(msg.getSize()).andReturn((long)value.length);
        EasyMock.expect(msg.getCachedOutputStream()).andReturn(new CachedOutputStream()).anyTimes();
        return msg;
    }
View Full Code Here

TOP

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

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.