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

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


            while (res.next()) {
                BigInteger mn = res.getBigDecimal(1).toBigInteger();
                String to = res.getString(2);
                Blob blob = res.getBlob(3);
                byte[] bytes = blob.getBytes(1, (int)blob.length());    
                RMMessage msg = new RMMessage();
                msg.setMessageNumber(mn);
                msg.setTo(to);
                msg.setContent(bytes);
                msgs.add(msg);               
            }           
        } catch (SQLException 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


        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

            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 (SQLException ex) {
            conex = 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);
        setUpRecoverReliableEndpoint(endpoint, conduit, ss, m);       
        control.replay();
        manager.recoverReliableEndpoint(endpoint, conduit);
        control.verify();       
    }
View Full Code Here

        if (null != store) {
            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(bytes);
            store.persistOutgoing(ss, msg);
        }
    }
View Full Code Here

            while (res.next()) {
                BigInteger mn = res.getBigDecimal(1).toBigInteger();
                String to = res.getString(2);
                Blob blob = res.getBlob(3);
                byte[] bytes = blob.getBytes(1, (int)blob.length());    
                RMMessage msg = new RMMessage();
                msg.setMessageNumber(mn);
                msg.setTo(to);
                msg.setContent(bytes);
                msgs.add(msg);               
            }           
        } catch (SQLException 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

            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

            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);
        }
       
        RMAssertion rma = RM10PolicyUtils.getRMAssertion(destination.getManager().getRMAssertion(), message);
View Full Code Here

        store.removeDestinationSequence(sid2);       
    }
   
    @Test
    public void testCreateDeleteMessages() throws IOException, SQLException  {
        RMMessage msg = control.createMock(RMMessage.class);
        Identifier sid1 = RMUtils.getWSRMFactory().createIdentifier();
        sid1.setValue("sequence1");
        EasyMock.expect(msg.getMessageNumber()).andReturn(BigInteger.ONE).times(2);
        byte[] bytes = new byte[89];
        EasyMock.expect(msg.getContent()).andReturn(bytes).times(2);
       
        control.replay();
        store.beginTransaction();
        store.storeMessage(sid1, msg, true);
        store.storeMessage(sid1, msg, false);
        store.commit();
        control.verify();
       
        control.reset();
        EasyMock.expect(msg.getMessageNumber()).andReturn(BigInteger.ONE);
        EasyMock.expect(msg.getContent()).andReturn(bytes);
       
        control.replay();
        store.beginTransaction();
        try {
            store.storeMessage(sid1, msg, true);
        } catch (SQLException ex) {
            assertEquals("23505", ex.getSQLState());
        }
        store.abort();
        control.verify();
       
        control.reset();
        EasyMock.expect(msg.getMessageNumber()).andReturn(BigInteger.TEN).times(2);
        EasyMock.expect(msg.getContent()).andReturn(bytes).times(2);
       
        control.replay();
        store.beginTransaction();
        store.storeMessage(sid1, msg, true);
        store.storeMessage(sid1, msg, false);
View Full Code Here

        return sid;
    }
   
    private void setupMessage(Identifier sid, BigInteger 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);
        String value = "Message " + mn.longValue();
        EasyMock.expect(msg.getContent()).andReturn(value.getBytes());
       
        control.replay();
        store.beginTransaction();
        store.storeMessage(sid, msg, outbound);       
        store.commit();
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.