use of org.apache.qpid.server.message.MessageInfoImpl in project qpid-broker-j by apache.
the class ReportRunner method convertMessage.
private static ReportableMessage convertMessage(QueueEntry entry) {
final MessageInfoImpl messageInfo = new MessageInfoImpl(entry, true);
ServerMessage message = entry.getMessage();
byte[] content;
try (QpidByteBuffer contentBuffer = message.getContent()) {
content = new byte[contentBuffer.remaining()];
contentBuffer.get(content);
}
return new ReportableMessage() {
@Override
public String getInitialRoutingAddress() {
return messageInfo.getInitialRoutingAddress();
}
@Override
public ReportableMessageHeader getMessageHeader() {
return convertMessageHeader(messageInfo);
}
@Override
public ByteBuffer getContent() {
return ByteBuffer.wrap(content).asReadOnlyBuffer();
}
@Override
public boolean isPersistent() {
return messageInfo.isPersistent();
}
@Override
public long getSize() {
return messageInfo.getSize();
}
@Override
public Date getExpiration() {
return messageInfo.getExpirationTime();
}
@Override
public long getMessageNumber() {
return messageInfo.getId();
}
@Override
public Date getArrivalTime() {
return messageInfo.getArrivalTime();
}
};
}
Aggregations