Package org.apache.qpid.framing

Examples of org.apache.qpid.framing.ContentHeaderBody


                Blob dataAsBlob = rs.getBlob(5);

                byte[] dataAsBytes = dataAsBlob.getBytes(1,(int) dataAsBlob.length());
                ByteBuffer buf = ByteBuffer.wrap(dataAsBytes);

                ContentHeaderBody chb = ContentHeaderBody.createFromBuffer(buf, dataAsBytes.length);

                if(localTx)
                {
                    commitTran(context);
                }
View Full Code Here


        TransactionalContext trancontext = new NonTransactionalContext(_store, _context, null,
                                                                       new LinkedList<RequiredDeliveryException>()
        );

        IncomingMessage message = new IncomingMessage(0L, info, trancontext,_protocolSession);
        message.setContentHeaderBody( new ContentHeaderBody());


        return message;
    }
View Full Code Here

        }

        currentMessage.setMessageStore(_virtualHost.getMessageStore());
        currentMessage.setExchange(directExchange);

        ContentHeaderBody headerBody = new ContentHeaderBody();
        headerBody.classId = BasicConsumeBodyImpl.CLASS_ID;
        headerBody.bodySize = 0;

        headerBody.properties = properties;
View Full Code Here

            {
                return null;
            }
        };

        ContentHeaderBody contentHeaderBody = new ContentHeaderBody();
        contentHeaderBody.bodySize = MESSAGE_SIZE;   // in bytes
        contentHeaderBody.properties = new BasicContentHeaderProperties();
        ((BasicContentHeaderProperties) contentHeaderBody.properties).setDeliveryMode((byte) (persistent ? 2 : 1));
        IncomingMessage msg = new IncomingMessage(_messageStore.getNewMessageId(), publish, _transactionalContext,  _protocolSession);
        msg.setContentHeaderBody(contentHeaderBody);
View Full Code Here

    /**
     * Check that when the reference count is decremented the message removes itself from the store
     */
    public void testMessageGetsRemoved() throws AMQException
    {
        ContentHeaderBody chb = createPersistentContentHeader();

        MessagePublishInfo info = new MessagePublishInfo()
        {

            public AMQShortString getExchange()
View Full Code Here

        assertEquals(0, _store.getMessageCount());
    }

    private ContentHeaderBody createPersistentContentHeader()
    {
        ContentHeaderBody chb = new ContentHeaderBody();
        BasicContentHeaderProperties bchp = new BasicContentHeaderProperties();
        bchp.setDeliveryMode((byte)2);
        chb.setProperties(bchp);
        return chb;
    }
View Full Code Here

            {
                return null;
            }
        };

        final ContentHeaderBody chb = createPersistentContentHeader();

        MessageMetaData mmd = new MessageMetaData(info, chb, 0);
        StoredMessage storedMessage = _store.addMessage(mmd);

        AMQMessage message = new AMQMessage(storedMessage);
View Full Code Here

        props.setDeliveryMode(Integer.valueOf(BasicContentHeaderProperties.PERSISTENT).byteValue());
        props.setContentType(getTestName());

        MethodRegistry methodRegistry = MethodRegistry.getMethodRegistry(ProtocolVersion.v0_9);
        int classForBasic = methodRegistry.createBasicQosOkBody().getClazz();
        ContentHeaderBody contentHeaderBody = new ContentHeaderBody(classForBasic, 1, props, MESSAGE_DATA.length);

        MessageMetaData metaData = new MessageMetaData(pubInfoBody, contentHeaderBody, 1);
        StoredMessage<MessageMetaData> handle = _store.addMessage(metaData);
        handle.addContent(0, ByteBuffer.wrap(MESSAGE_DATA));
        TestMessage message = new TestMessage(id, handle);
View Full Code Here

        public MessageMetaData entryToObject(final TupleInput input)
        {
            try
            {
                final MessagePublishInfo publishBody = readMessagePublishInfo(input);
                final ContentHeaderBody contentHeaderBody = readContentHeaderBody(input);
                final int contentChunkCount = input.readInt();

                return new MessageMetaData(publishBody, contentHeaderBody, contentChunkCount);
            }
            catch (Exception e)
View Full Code Here

        currentMessage = new IncomingMessage(messageInfo);

        currentMessage.setExchange(exchange);

        ContentHeaderBody headerBody = new ContentHeaderBody(BasicConsumeBodyImpl.CLASS_ID,0,properties,0l);

        try
        {
            currentMessage.setContentHeaderBody(headerBody);
        }
View Full Code Here

TOP

Related Classes of org.apache.qpid.framing.ContentHeaderBody

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.