use of org.apache.qpid.server.protocol.v0_8.transport in project qpid-broker-j by apache.
the class MessageConverter_0_10_to_0_8 method convertToStoredMessage.
private StoredMessage<MessageMetaData> convertToStoredMessage(final MessageTransferMessage message, NamedAddressSpace addressSpace) {
final MessageMetaData metaData = convertMetaData(message, addressSpace);
final int metadataSize = metaData.getStorableSize();
return new StoredMessage<org.apache.qpid.server.protocol.v0_8.MessageMetaData>() {
@Override
public MessageMetaData getMetaData() {
return metaData;
}
@Override
public long getMessageNumber() {
return message.getMessageNumber();
}
@Override
public QpidByteBuffer getContent(final int offset, final int length) {
return message.getContent(offset, length);
}
@Override
public int getContentSize() {
return metaData.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 getMetadataSize() + getContentSize();
}
@Override
public boolean flowToDisk() {
return false;
}
@Override
public void reallocate() {
}
};
}
Aggregations