Search in sources :

Example 11 with MessageMetaData_0_10

use of org.apache.qpid.server.protocol.v0_10.MessageMetaData_0_10 in project qpid-broker-j by apache.

the class MessageConverter_0_8_to_0_10 method convertToStoredMessage.

private StoredMessage<MessageMetaData_0_10> convertToStoredMessage(final AMQMessage message_0_8) {
    final MessageMetaData_0_10 messageMetaData_0_10 = convertMetaData(message_0_8);
    final int metadataSize = messageMetaData_0_10.getStorableSize();
    return new StoredMessage<MessageMetaData_0_10>() {

        @Override
        public MessageMetaData_0_10 getMetaData() {
            return messageMetaData_0_10;
        }

        @Override
        public long getMessageNumber() {
            return message_0_8.getMessageNumber();
        }

        @Override
        public QpidByteBuffer getContent(final int offset, final int length) {
            return message_0_8.getContent(offset, length);
        }

        @Override
        public int getContentSize() {
            return messageMetaData_0_10.getContentSize();
        }

        @Override
        public int getMetadataSize() {
            return metadataSize;
        }

        @Override
        public void remove() {
            throw new UnsupportedOperationException();
        }

        @Override
        public boolean isInContentInMemory() {
            return true;
        }

        @Override
        public long getInMemorySize() {
            return getContentSize() + getMetadataSize();
        }

        @Override
        public boolean flowToDisk() {
            return false;
        }

        @Override
        public void reallocate() {
        }
    };
}
Also used : StoredMessage(org.apache.qpid.server.store.StoredMessage) MessageMetaData_0_10(org.apache.qpid.server.protocol.v0_10.MessageMetaData_0_10)

Aggregations

Header (org.apache.qpid.server.protocol.v0_10.transport.Header)7 MessageMetaData_0_10 (org.apache.qpid.server.protocol.v0_10.MessageMetaData_0_10)6 DeliveryProperties (org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties)6 MessageProperties (org.apache.qpid.server.protocol.v0_10.transport.MessageProperties)6 UUID (java.util.UUID)2 QpidByteBuffer (org.apache.qpid.server.bytebuffer.QpidByteBuffer)2 MessageTransferMessage (org.apache.qpid.server.protocol.v0_10.MessageTransferMessage)2 StoredMessage (org.apache.qpid.server.store.StoredMessage)2 URISyntaxException (java.net.URISyntaxException)1 BufferUnderflowException (java.nio.BufferUnderflowException)1 Date (java.util.Date)1 LinkedHashMap (java.util.LinkedHashMap)1 InternalMessageHeader (org.apache.qpid.server.message.internal.InternalMessageHeader)1 ReplyTo (org.apache.qpid.server.protocol.v0_10.transport.ReplyTo)1 Struct (org.apache.qpid.server.protocol.v0_10.transport.Struct)1 AMQShortString (org.apache.qpid.server.protocol.v0_8.AMQShortString)1 BasicContentHeaderProperties (org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties)1 ConvertedContentAndMimeType (org.apache.qpid.server.protocol.v1_0.MessageConverter_from_1_0.ConvertedContentAndMimeType)1 MessageConverter_from_1_0.getAmqp0xConvertedContentAndMimeType (org.apache.qpid.server.protocol.v1_0.MessageConverter_from_1_0.getAmqp0xConvertedContentAndMimeType)1 MessageMetaData_1_0 (org.apache.qpid.server.protocol.v1_0.MessageMetaData_1_0)1