Examples of RMMessage


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

            mergeRanges();
        }

        RMStore store = destination.getManager().getStore();
        if (null != store) {
            RMMessage msg = null;
            if (!MessageUtils.isTrue(message.getContextualProperty(Message.ROBUST_ONEWAY))) {
                msg = new RMMessage();
                RewindableInputStream in = (RewindableInputStream)message.get(RMMessageConstants.SAVED_CONTENT);
                in.rewind();
                msg.setContent(in);
                msg.setMessageNumber(st.getMessageNumber());
            }
            store.persistIncoming(this, msg);
        }
       
        RMEndpoint reliableEndpoint = destination.getReliableEndpoint();
View Full Code Here

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

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

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

        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

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

            res1 = stmt1.executeQuery();
            while (res1.next()) {
                long mn = res1.getLong(1);
                String to = res1.getString(2);
                Blob blob = res1.getBlob(3);
                RMMessage msg = new RMMessage();
                msg.setMessageNumber(mn);
                msg.setTo(to);
                msg.setContent(blob.getBinaryStream());
                msgs.add(msg);
                stmt2 = getStatement(con, outbound
                     ? SELECT_OUTBOUND_ATTACHMENTS_STMT_STR : SELECT_INBOUND_ATTACHMENTS_STMT_STR);
                stmt2.setString(1, sid.getValue());
                stmt2.setLong(2, mn);
                res2 = stmt2.executeQuery();
                List<InputStream> attaches = new ArrayList<InputStream>();
                while (res2.next()) {
                    attaches.add(res2.getBinaryStream(1));
                }
                msg.setAttachments(attaches);
            }
        } catch (SQLException ex) {
            conex = ex;
            LOG.log(Level.WARNING, new Message(outbound ? "SELECT_OUTBOUND_MSGS_FAILED_MSG"
                : "SELECT_INBOUND_MSGS_FAILED_MSG", LOG).toString(), ex);
View Full Code Here

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

        manager.recoverReliableEndpoint(endpoint, conduit, ProtocolVariation.RM10WSA200408);
        control.verify();
       
        control.reset();
        setUpEndpointForRecovery(endpoint, ei, si, bi, ii)
        RMMessage m = control.createMock(RMMessage.class);
        setUpRecoverReliableEndpoint(endpoint, conduit, ss, ds, m);       
        control.replay();
        manager.recoverReliableEndpoint(endpoint, conduit, ProtocolVariation.RM10WSA200408);
        control.verify();       
    }
View Full Code Here

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

        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

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

        }
    }
   
    private void setupMessage(Identifier sid, Long mn, String to, boolean outbound)
        throws IOException, SQLException  {
        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);
       
        control.replay();
        store.beginTransaction();
        store.storeMessage(sid, msg, outbound);       
        store.commit();
View Full Code Here

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

            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"
                : "SELECT_INBOUND_MSGS_FAILED_MSG", LOG).toString(), ex);
View Full Code Here

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

            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"
                : "SELECT_INBOUND_MSGS_FAILED_MSG", LOG).toString(), ex);
View Full Code Here

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

        manager.recoverReliableEndpoint(endpoint, conduit);
        control.verify();
       
        control.reset();
        setUpEndpointForRecovery(endpoint, ei, si, bi, ii)
        RMMessage m = control.createMock(RMMessage.class);
        setUpRecoverReliableEndpoint(endpoint, conduit, ss, ds, m);       
        control.replay();
        manager.recoverReliableEndpoint(endpoint, conduit);
        control.verify();       
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.