Adding timestamp to print-data

This is a simple change to add the timestamp on toString which will appear on print-data
This commit is contained in:
Clebert Suconic 2015-05-27 09:55:14 -04:00
parent eb4355a62e
commit fbe0508350
1 changed files with 14 additions and 1 deletions

View File

@ -319,10 +319,23 @@ public class ServerMessageImpl extends MessageImpl implements ServerMessage
public String toString()
{
return "ServerMessage[messageID=" + messageID + ",durable=" + isDurable() + ",userID=" + getUserID() + ",priority=" + this.getPriority() + ", bodySize=" + this.getBodyBufferCopy().capacity() +
",expiration=" + (this.getExpiration() != 0 ? new java.util.Date(this.getExpiration()) : 0) +
", timestamp=" + toDate(getTimestamp()) + ",expiration=" + toDate(getExpiration()) +
", durable=" + durable + ", address=" + getAddress() + ",properties=" + properties.toString() + "]@" + System.identityHashCode(this);
}
private static String toDate(long timestamp)
{
if (timestamp == 0)
{
return "0";
}
else
{
return new java.util.Date(timestamp).toString();
}
}
public InputStream getBodyInputStream()
{
return null;