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() {
}
};
}
Aggregations